* [Caml-list] ANN: Boulder Dash in OCaml
@ 2024-11-12 15:55 Andreas Rossberg
2024-11-12 23:28 ` Daniel Bünzli
2024-11-26 17:38 ` Andreas Rossberg
0 siblings, 2 replies; 8+ messages in thread
From: Andreas Rossberg @ 2024-11-12 15:55 UTC (permalink / raw)
To: caml-list
Boulder Dash(*) was my favourite computer game in the 8-bit era, first released on the Atari 400/800 in 1984. Though I never owned an 8-bit machine myself, I had friends that I annoyed enough to let me play it on theirs.
As a homage to its 40th anniversary, I put together a fairly faithful clone of the original game, implemented in just a few 100 lines of bare OCaml, with nothing but the homely Graphics library. It should run on Windows, Mac, and Linux, though I was too lazy to test the latter.
Features:
• Faithful original physics, graphics, and animations
• Authentic scrolling mechanics combined with dynamic window resizing
• All 20 levels, including intermissions, and 5 difficulties
• Pause-and-go mode for relaxed playing
It is open-source here:
https://github.com/rossberg/boulder-dash
Enjoy!
/Andreas
(*) https://en.wikipedia.org/wiki/Boulder_Dash_(video_game)
"Boulder Dash" is a trademark of BBG Entertainment
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Caml-list] ANN: Boulder Dash in OCaml
2024-11-12 15:55 [Caml-list] ANN: Boulder Dash in OCaml Andreas Rossberg
@ 2024-11-12 23:28 ` Daniel Bünzli
2024-11-13 9:44 ` Andreas Rossberg
2024-11-26 17:38 ` Andreas Rossberg
1 sibling, 1 reply; 8+ messages in thread
From: Daniel Bünzli @ 2024-11-12 23:28 UTC (permalink / raw)
To: Andreas Rossberg; +Cc: caml-list
On Tuesday, 12 November 2024 at 16:55, Andreas Rossberg <rossberg@mpi-sws.org> wrote:
> Boulder Dash() was my favourite computer game in the 8-bit era,
Nice remembrance, thanks! I also likely spent quite a few days with it on a C64.
As WASM support is being merged to js_of_ocaml [0] this is screaming for a web page implementation to taste your own food :-) (and would nod to [1]).
I quickly tried to compile to js with js_of_ocaml's graphics version [2] but I timed out before getting something functional.
Best,
Daniel
[0]: https://github.com/ocsigen/js_of_ocaml/pull/1724
[1]: https://ocsigen.org/js_of_ocaml/latest/manual/files/boulderdash/index.html
[2]: https://ocsigen.org/js_of_ocaml/latest/api/js_of_ocaml-lwt/Graphics_js/index.html
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Caml-list] ANN: Boulder Dash in OCaml
2024-11-12 23:28 ` Daniel Bünzli
@ 2024-11-13 9:44 ` Andreas Rossberg
0 siblings, 0 replies; 8+ messages in thread
From: Andreas Rossberg @ 2024-11-13 9:44 UTC (permalink / raw)
To: Daniel Bünzli; +Cc: caml-list
On 13. Nov 2024, at 00:28, Daniel Bünzli <daniel.buenzli@erratique.ch> wrote:
>
> As WASM support is being merged to js_of_ocaml [0] this is screaming for a web page implementation to taste your own food :-) (and would nod to [1]).
>
> I quickly tried to compile to js with js_of_ocaml's graphics version [2] but I timed out before getting something functional.
Good idea! I also spent an hour just now trying to get it to work with either js_of_ocaml or wasm_of_ocaml, but failed. It builds fine, but with the former I just get an empty page, while the latter produces a mime type error somewhere inside that I don’t quite grasp.
I admit that I have very little experience with these tools, or web apps in general. Perhaps somebody more knowledgeable wants to give it a shot… :)
Cheers,
/Andreas
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Caml-list] ANN: Boulder Dash in OCaml
2024-11-12 15:55 [Caml-list] ANN: Boulder Dash in OCaml Andreas Rossberg
2024-11-12 23:28 ` Daniel Bünzli
@ 2024-11-26 17:38 ` Andreas Rossberg
2024-11-27 6:54 ` Yotam Barnoy
2024-11-27 10:44 ` Vu Ngoc San
1 sibling, 2 replies; 8+ messages in thread
From: Andreas Rossberg @ 2024-11-26 17:38 UTC (permalink / raw)
To: caml-list
Couldn’t let it rest, so I’m (already) announcing version 2 of it — now a much improved, practically feature-complete reimplementation of both Boulder Dash 1 & 2.
Version 2 was an excuse for me to mess around with the OCaml bindings to popular graphics engines, and as a result, it now comes with 3 backends to choose from:
1. the homely bare OCaml Graphics library (https://github.com/ocaml/graphics),
2. the TSDL binding to the SDL2 API (https://github.com/dbuenzli/tsdl),
3. the binding to the Raylib engine (https://github.com/tjammer/raylib-ocaml).
The list is in order of increasingly better user experience, for the price of a potentially harder build experience. In theory, all versions should run on Windows, Mac, and Linux, though I was too lazy to test all combinations, and I (or my opam) had trouble installing some of the dependencies on some of the systems.
Features:
* Faithful original physics, graphics, animations, sound, and music
* Authentic scrolling mechanics combined with dynamic resizing
* All 40 levels and 5 difficulties of Boulder Dash 1 & 2
* Pause-and-go mode for relaxed playing
Relative to the previous release, version 2 adds the following niceties:
* Support for SDL and Raylib engines, which allow all of the following
* Original sound effects and music
* Original level color schemes
* Full screen mode
* Faster graphics
* Dynamic graphics scaling adjustment
* Gamepad/joystick support as well as more precise keyboard controls
* Boulder Dash 2 levels and decoder
Almost looks like a real game now. One from the 80s anyways. :)
Enjoy,
/Andreas
> On 12. Nov 2024, at 16:55, Andreas Rossberg <rossberg@mpi-sws.org> wrote:
>
> Boulder Dash(*) was my favourite computer game in the 8-bit era, first released on the Atari 400/800 in 1984. Though I never owned an 8-bit machine myself, I had friends that I annoyed enough to let me play it on theirs.
>
> As a homage to its 40th anniversary, I put together a fairly faithful clone of the original game, implemented in just a few 100 lines of bare OCaml, with nothing but the homely Graphics library. It should run on Windows, Mac, and Linux, though I was too lazy to test the latter.
>
> Features:
>
> • Faithful original physics, graphics, and animations
> • Authentic scrolling mechanics combined with dynamic window resizing
> • All 20 levels, including intermissions, and 5 difficulties
> • Pause-and-go mode for relaxed playing
>
> It is open-source here:
>
> https://github.com/rossberg/boulder-dash
>
> Enjoy!
>
> /Andreas
>
> (*) https://en.wikipedia.org/wiki/Boulder_Dash_(video_game)
> "Boulder Dash" is a trademark of BBG Entertainment
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Caml-list] ANN: Boulder Dash in OCaml
2024-11-26 17:38 ` Andreas Rossberg
@ 2024-11-27 6:54 ` Yotam Barnoy
2024-11-27 9:03 ` Andreas Rossberg
2024-11-27 10:44 ` Vu Ngoc San
1 sibling, 1 reply; 8+ messages in thread
From: Yotam Barnoy @ 2024-11-27 6:54 UTC (permalink / raw)
To: Andreas Rossberg; +Cc: caml-list
[-- Attachment #1: Type: text/plain, Size: 3410 bytes --]
Very nice! Since you're already toying with the code, you might want to try
and test the impact of moving towards a more functional, immutable data
structure approach. I've found that you can separate out those parts of the
game state that change more rapidly and those that don't, and the
slow-changing parts can easily tolerate functional paradigms, with the
advantage being greater safety and reduced state complexity.
On Tue, Nov 26, 2024 at 7:39 PM Andreas Rossberg <rossberg@mpi-sws.org>
wrote:
> Couldn’t let it rest, so I’m (already) announcing version 2 of it — now a
> much improved, practically feature-complete reimplementation of both
> Boulder Dash 1 & 2.
>
> Version 2 was an excuse for me to mess around with the OCaml bindings to
> popular graphics engines, and as a result, it now comes with 3 backends to
> choose from:
>
> 1. the homely bare OCaml Graphics library (
> https://github.com/ocaml/graphics),
> 2. the TSDL binding to the SDL2 API (https://github.com/dbuenzli/tsdl),
> 3. the binding to the Raylib engine (
> https://github.com/tjammer/raylib-ocaml).
>
> The list is in order of increasingly better user experience, for the price
> of a potentially harder build experience. In theory, all versions should
> run on Windows, Mac, and Linux, though I was too lazy to test all
> combinations, and I (or my opam) had trouble installing some of the
> dependencies on some of the systems.
>
> Features:
>
> * Faithful original physics, graphics, animations, sound, and music
> * Authentic scrolling mechanics combined with dynamic resizing
> * All 40 levels and 5 difficulties of Boulder Dash 1 & 2
> * Pause-and-go mode for relaxed playing
>
> Relative to the previous release, version 2 adds the following niceties:
>
> * Support for SDL and Raylib engines, which allow all of the following
> * Original sound effects and music
> * Original level color schemes
> * Full screen mode
> * Faster graphics
> * Dynamic graphics scaling adjustment
> * Gamepad/joystick support as well as more precise keyboard controls
> * Boulder Dash 2 levels and decoder
>
> Almost looks like a real game now. One from the 80s anyways. :)
>
> Enjoy,
> /Andreas
>
>
> > On 12. Nov 2024, at 16:55, Andreas Rossberg <rossberg@mpi-sws.org>
> wrote:
> >
> > Boulder Dash(*) was my favourite computer game in the 8-bit era, first
> released on the Atari 400/800 in 1984. Though I never owned an 8-bit
> machine myself, I had friends that I annoyed enough to let me play it on
> theirs.
> >
> > As a homage to its 40th anniversary, I put together a fairly faithful
> clone of the original game, implemented in just a few 100 lines of bare
> OCaml, with nothing but the homely Graphics library. It should run on
> Windows, Mac, and Linux, though I was too lazy to test the latter.
> >
> > Features:
> >
> > • Faithful original physics, graphics, and animations
> > • Authentic scrolling mechanics combined with dynamic window resizing
> > • All 20 levels, including intermissions, and 5 difficulties
> > • Pause-and-go mode for relaxed playing
> >
> > It is open-source here:
> >
> > https://github.com/rossberg/boulder-dash
> >
> > Enjoy!
> >
> > /Andreas
> >
> > (*) https://en.wikipedia.org/wiki/Boulder_Dash_(video_game)
> > "Boulder Dash" is a trademark of BBG Entertainment
> >
>
>
[-- Attachment #2: Type: text/html, Size: 4383 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Caml-list] ANN: Boulder Dash in OCaml
2024-11-27 6:54 ` Yotam Barnoy
@ 2024-11-27 9:03 ` Andreas Rossberg
0 siblings, 0 replies; 8+ messages in thread
From: Andreas Rossberg @ 2024-11-27 9:03 UTC (permalink / raw)
To: Yotam Barnoy; +Cc: caml-list
[-- Attachment #1: Type: text/plain, Size: 4162 bytes --]
Yeah, well, the core physics of Boulder Dash is akin to a cellular automaton whose state is advanced in ticks. So its state naturally is a 2D array with a constant change rate, and there isn’t too much to gain by a more functional representation, especially since OCaml doesn’t offer functional array types.
The uglier part in terms of being very imperative is the UI code, but without a more functional graphics library that’s probably a lost cause.
Performance would be the least of the issues, given that 1 MHz computers from the 80s were able to handle this game. :)
> On 27. Nov 2024, at 07:54, Yotam Barnoy <yotambarnoy@gmail.com> wrote:
>
> Very nice! Since you're already toying with the code, you might want to try and test the impact of moving towards a more functional, immutable data structure approach. I've found that you can separate out those parts of the game state that change more rapidly and those that don't, and the slow-changing parts can easily tolerate functional paradigms, with the advantage being greater safety and reduced state complexity.
>
> On Tue, Nov 26, 2024 at 7:39 PM Andreas Rossberg <rossberg@mpi-sws.org <mailto:rossberg@mpi-sws.org>> wrote:
>> Couldn’t let it rest, so I’m (already) announcing version 2 of it — now a much improved, practically feature-complete reimplementation of both Boulder Dash 1 & 2.
>>
>> Version 2 was an excuse for me to mess around with the OCaml bindings to popular graphics engines, and as a result, it now comes with 3 backends to choose from:
>>
>> 1. the homely bare OCaml Graphics library (https://github.com/ocaml/graphics),
>> 2. the TSDL binding to the SDL2 API (https://github.com/dbuenzli/tsdl),
>> 3. the binding to the Raylib engine (https://github.com/tjammer/raylib-ocaml).
>>
>> The list is in order of increasingly better user experience, for the price of a potentially harder build experience. In theory, all versions should run on Windows, Mac, and Linux, though I was too lazy to test all combinations, and I (or my opam) had trouble installing some of the dependencies on some of the systems.
>>
>> Features:
>>
>> * Faithful original physics, graphics, animations, sound, and music
>> * Authentic scrolling mechanics combined with dynamic resizing
>> * All 40 levels and 5 difficulties of Boulder Dash 1 & 2
>> * Pause-and-go mode for relaxed playing
>>
>> Relative to the previous release, version 2 adds the following niceties:
>>
>> * Support for SDL and Raylib engines, which allow all of the following
>> * Original sound effects and music
>> * Original level color schemes
>> * Full screen mode
>> * Faster graphics
>> * Dynamic graphics scaling adjustment
>> * Gamepad/joystick support as well as more precise keyboard controls
>> * Boulder Dash 2 levels and decoder
>>
>> Almost looks like a real game now. One from the 80s anyways. :)
>>
>> Enjoy,
>> /Andreas
>>
>>
>> > On 12. Nov 2024, at 16:55, Andreas Rossberg <rossberg@mpi-sws.org <mailto:rossberg@mpi-sws.org>> wrote:
>> >
>> > Boulder Dash(*) was my favourite computer game in the 8-bit era, first released on the Atari 400/800 in 1984. Though I never owned an 8-bit machine myself, I had friends that I annoyed enough to let me play it on theirs.
>> >
>> > As a homage to its 40th anniversary, I put together a fairly faithful clone of the original game, implemented in just a few 100 lines of bare OCaml, with nothing but the homely Graphics library. It should run on Windows, Mac, and Linux, though I was too lazy to test the latter.
>> >
>> > Features:
>> >
>> > • Faithful original physics, graphics, and animations
>> > • Authentic scrolling mechanics combined with dynamic window resizing
>> > • All 20 levels, including intermissions, and 5 difficulties
>> > • Pause-and-go mode for relaxed playing
>> >
>> > It is open-source here:
>> >
>> > https://github.com/rossberg/boulder-dash
>> >
>> > Enjoy!
>> >
>> > /Andreas
>> >
>> > (*) https://en.wikipedia.org/wiki/Boulder_Dash_(video_game)
>> > "Boulder Dash" is a trademark of BBG Entertainment
>> >
>>
[-- Attachment #2: Type: text/html, Size: 5661 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Caml-list] ANN: Boulder Dash in OCaml
2024-11-26 17:38 ` Andreas Rossberg
2024-11-27 6:54 ` Yotam Barnoy
@ 2024-11-27 10:44 ` Vu Ngoc San
2024-11-27 16:58 ` Andreas Rossberg
1 sibling, 1 reply; 8+ messages in thread
From: Vu Ngoc San @ 2024-11-27 10:44 UTC (permalink / raw)
To: caml-list
that's really impressive, thanks for this!
for the sound in SDL, why not use tsdl_mixer ?
San
Le 26/11/2024 à 18:38, Andreas Rossberg a écrit :
> Couldn’t let it rest, so I’m (already) announcing version 2 of it — now a much improved, practically feature-complete reimplementation of both Boulder Dash 1 & 2.
>
> Version 2 was an excuse for me to mess around with the OCaml bindings to popular graphics engines, and as a result, it now comes with 3 backends to choose from:
>
> 1. the homely bare OCaml Graphics library (https://github.com/ocaml/graphics),
> 2. the TSDL binding to the SDL2 API (https://github.com/dbuenzli/tsdl),
> 3. the binding to the Raylib engine (https://github.com/tjammer/raylib-ocaml).
>
> The list is in order of increasingly better user experience, for the price of a potentially harder build experience. In theory, all versions should run on Windows, Mac, and Linux, though I was too lazy to test all combinations, and I (or my opam) had trouble installing some of the dependencies on some of the systems.
>
> Features:
>
> * Faithful original physics, graphics, animations, sound, and music
> * Authentic scrolling mechanics combined with dynamic resizing
> * All 40 levels and 5 difficulties of Boulder Dash 1 & 2
> * Pause-and-go mode for relaxed playing
>
> Relative to the previous release, version 2 adds the following niceties:
>
> * Support for SDL and Raylib engines, which allow all of the following
> * Original sound effects and music
> * Original level color schemes
> * Full screen mode
> * Faster graphics
> * Dynamic graphics scaling adjustment
> * Gamepad/joystick support as well as more precise keyboard controls
> * Boulder Dash 2 levels and decoder
>
> Almost looks like a real game now. One from the 80s anyways. :)
>
> Enjoy,
> /Andreas
>
>
>> On 12. Nov 2024, at 16:55, Andreas Rossberg <rossberg@mpi-sws.org> wrote:
>>
>> Boulder Dash(*) was my favourite computer game in the 8-bit era, first released on the Atari 400/800 in 1984. Though I never owned an 8-bit machine myself, I had friends that I annoyed enough to let me play it on theirs.
>>
>> As a homage to its 40th anniversary, I put together a fairly faithful clone of the original game, implemented in just a few 100 lines of bare OCaml, with nothing but the homely Graphics library. It should run on Windows, Mac, and Linux, though I was too lazy to test the latter.
>>
>> Features:
>>
>> • Faithful original physics, graphics, and animations
>> • Authentic scrolling mechanics combined with dynamic window resizing
>> • All 20 levels, including intermissions, and 5 difficulties
>> • Pause-and-go mode for relaxed playing
>>
>> It is open-source here:
>>
>> https://github.com/rossberg/boulder-dash
>>
>> Enjoy!
>>
>> /Andreas
>>
>> (*) https://en.wikipedia.org/wiki/Boulder_Dash_(video_game)
>> "Boulder Dash" is a trademark of BBG Entertainment
>>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Caml-list] ANN: Boulder Dash in OCaml
2024-11-27 10:44 ` Vu Ngoc San
@ 2024-11-27 16:58 ` Andreas Rossberg
0 siblings, 0 replies; 8+ messages in thread
From: Andreas Rossberg @ 2024-11-27 16:58 UTC (permalink / raw)
To: Vu Ngoc San; +Cc: caml-list
Ah, I wasn’t aware that binding existed, thanks for the hint!
> On 27. Nov 2024, at 11:44, Vu Ngoc San <san.vu-ngoc@laposte.net> wrote:
>
> that's really impressive, thanks for this!
> for the sound in SDL, why not use tsdl_mixer ?
>
> San
>
> Le 26/11/2024 à 18:38, Andreas Rossberg a écrit :
>> Couldn’t let it rest, so I’m (already) announcing version 2 of it — now a much improved, practically feature-complete reimplementation of both Boulder Dash 1 & 2.
>>
>> Version 2 was an excuse for me to mess around with the OCaml bindings to popular graphics engines, and as a result, it now comes with 3 backends to choose from:
>>
>> 1. the homely bare OCaml Graphics library (https://github.com/ocaml/graphics),
>> 2. the TSDL binding to the SDL2 API (https://github.com/dbuenzli/tsdl),
>> 3. the binding to the Raylib engine (https://github.com/tjammer/raylib-ocaml).
>>
>> The list is in order of increasingly better user experience, for the price of a potentially harder build experience. In theory, all versions should run on Windows, Mac, and Linux, though I was too lazy to test all combinations, and I (or my opam) had trouble installing some of the dependencies on some of the systems.
>>
>> Features:
>>
>> * Faithful original physics, graphics, animations, sound, and music
>> * Authentic scrolling mechanics combined with dynamic resizing
>> * All 40 levels and 5 difficulties of Boulder Dash 1 & 2
>> * Pause-and-go mode for relaxed playing
>>
>> Relative to the previous release, version 2 adds the following niceties:
>>
>> * Support for SDL and Raylib engines, which allow all of the following
>> * Original sound effects and music
>> * Original level color schemes
>> * Full screen mode
>> * Faster graphics
>> * Dynamic graphics scaling adjustment
>> * Gamepad/joystick support as well as more precise keyboard controls
>> * Boulder Dash 2 levels and decoder
>>
>> Almost looks like a real game now. One from the 80s anyways. :)
>>
>> Enjoy,
>> /Andreas
>>
>>
>>> On 12. Nov 2024, at 16:55, Andreas Rossberg <rossberg@mpi-sws.org> wrote:
>>>
>>> Boulder Dash(*) was my favourite computer game in the 8-bit era, first released on the Atari 400/800 in 1984. Though I never owned an 8-bit machine myself, I had friends that I annoyed enough to let me play it on theirs.
>>>
>>> As a homage to its 40th anniversary, I put together a fairly faithful clone of the original game, implemented in just a few 100 lines of bare OCaml, with nothing but the homely Graphics library. It should run on Windows, Mac, and Linux, though I was too lazy to test the latter.
>>>
>>> Features:
>>>
>>> • Faithful original physics, graphics, and animations
>>> • Authentic scrolling mechanics combined with dynamic window resizing
>>> • All 20 levels, including intermissions, and 5 difficulties
>>> • Pause-and-go mode for relaxed playing
>>>
>>> It is open-source here:
>>>
>>> https://github.com/rossberg/boulder-dash
>>>
>>> Enjoy!
>>>
>>> /Andreas
>>>
>>> (*) https://en.wikipedia.org/wiki/Boulder_Dash_(video_game)
>>> "Boulder Dash" is a trademark of BBG Entertainment
>>>
>
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2024-11-27 16:59 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-11-12 15:55 [Caml-list] ANN: Boulder Dash in OCaml Andreas Rossberg
2024-11-12 23:28 ` Daniel Bünzli
2024-11-13 9:44 ` Andreas Rossberg
2024-11-26 17:38 ` Andreas Rossberg
2024-11-27 6:54 ` Yotam Barnoy
2024-11-27 9:03 ` Andreas Rossberg
2024-11-27 10:44 ` Vu Ngoc San
2024-11-27 16:58 ` Andreas Rossberg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox