Skip to content

Commit

Permalink
tiny doc updates
Browse files Browse the repository at this point in the history
  • Loading branch information
sjml committed Jan 16, 2025
1 parent 07200ee commit a09ca1e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/history.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ I played around with [Screeps](https://screeps.com/) a few years ago, and it's d
### Advent of Code
![Advent of Code Screenshot](./img/aoc.png)

I've been doing [Advent of Code](https://adventofcode.com/) since 2019, and it is one of my favorite things. The story is just the right level of goofy/twee, and the puzzles have made me a substantially better programmer as I've had to go deeper on math and algorithms than I ever did before. Very frequently those puzzles will have you navigating mazes, so writing code to map a space, pathfind, etc. is now close to second-nature. (This is why the map class has an [`aoc()`](https://github.com/sjml/wasmbots/blob/8fda7ef1a5a73a1b573d5ab6a616c79a58048733/engine/src/game/map.ts#L285) function that outputs in the usual format from Advent of Code. 😝)
I've been doing [Advent of Code](https://adventofcode.com/) since 2019, and it is one of my favorite things. The story is just the right level of goofy/twee, and the puzzles have made me a substantially better programmer as I've had to go deeper on math and algorithms than I ever did before. Very frequently those puzzles will have you navigating mazes, so writing code to map a space, pathfind, etc. is now close to second-nature. (This is why the map class has an [`aoc()`](https://github.com/sjml/wasmbots/blob/8fda7ef1a5a73a1b573d5ab6a616c79a58048733/engine/src/game/map.ts#L287) function that outputs in the usual format from Advent of Code. 😝)


## Building the Thing
Expand Down Expand Up @@ -88,7 +88,7 @@ Less neat is the utter dearth of anyone writing WebAssembly in Rust without wasm

For the basic web UI stuff, I use [Svelte](https://svelte.dev/). I've never bothered to learn React, which I know is everyone's favorite, but Svelte fits my brain well. Never considered another toolkit. Right after I started, though, [Svelte 5 released](https://svelte.dev/blog/svelte-5-is-alive), which I decided to jump on because this was an early-stage project. That entailed some un-learning and learning, but on the whole I've been very happy with how easily Svelte lets me build stuff.

Then there was the question of game engine. Because I was trying to keep the non-WebAssembly parts of this strictly JavaScript (or TypeScript or what-have-you), that meant looking to web-native engines instead of something like Godot. This is not a space I knew very well, but research seemed to keep pointing back to [Phaser](https://phaser.io/), which I eventually settled on. Phaser is definitely one of the most popular web game frameworks, and it hits a nice sweet spot of functionality and relatively lightness. Its documentation is very much not great, though (and they recently moved everything to a new domain without properly redirecting old stuff, so even helpful articles and web searches have been made useless). I'm not pushing it too hard, but even just trying to do this simple stuff has been a little frustrating. The problem is almost certainly me, not Phaser, as lots of other people seem to be using it without problem. This may be a situation where I've gotten spoiled by using different tools meant for a different domain. (I also used to manage [my own 2D engine](https://github.com/angel2d/angel2d), so could just be over-opinionated.)
Then there was the question of game engine. Because I was trying to keep the non-WebAssembly parts of this strictly JavaScript (or TypeScript or what-have-you), that meant looking to web-native engines instead of something like Godot. This is not a space I knew very well, but research seemed to keep pointing back to [Phaser](https://phaser.io/), which I eventually settled on. Phaser is definitely one of the most popular web game frameworks, and it hits a nice sweet spot of functionality and relatively lightness. I don't love the documentation, though, and they recently moved everything to a new domain without properly redirecting old stuff, so even helpful articles and web searches have been made useless. I'm not pushing the engine too hard, but even just trying to do this simple stuff has been a little frustrating. The problem is almost certainly me, not Phaser, as lots of other people seem to be using it without problem. This may be a situation where I've gotten spoiled by using different tools meant for a different domain. (I also used to manage [my own 2D engine](https://github.com/angel2d/angel2d), so could just be over-opinionated.)


## The Game!
Expand Down
8 changes: 8 additions & 0 deletions frontend/src/routes/(site)/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,14 @@
example bots</a> are implemented in a variety of languages and should
be useful examples.
</p>

<p>
I note that this context is not the kind of thing that WebAssembly is
<em>especially</em> good at. Every turn, memory is getting passed back
and forth between host and module, which is a relatively slow operation.
However, (a) at the scale at which we’re operating, it’s fine and (b) this
is fun. It’s not optimal. It’s fun.
</p>
</div>

<style>
Expand Down

0 comments on commit a09ca1e

Please sign in to comment.