1
Fork 0

I forgor what I changed

This commit is contained in:
prescientmoon 2025-03-20 17:41:19 +01:00
parent 9938c0ee87
commit a385fbeb33
Signed by: prescientmoon
SSH key fingerprint: SHA256:UUF9JT2s8Xfyv76b8ZuVL7XrmimH4o49p4b+iexbVH4
5 changed files with 12 additions and 8 deletions

View file

@ -1,5 +1,7 @@
{ role=config }
``` =toml
created_at = "2025-03-04T18:07:07+01:00"
hidden = true
```
{ role=description }
@ -11,7 +13,7 @@ Rewriting a game from Rust to Odin, smooth screen transitions, plenty of UI rewr
Angelfold is a non-euclidean action/puzzle platformer I've been working on in my free time. For more details, check out the [main post][angelfold] about the game. I had been working on the game on and off for months, although a lot of it was (and still is!) exploratory work, or simply pondering the implications of the games' rules (ala [this talk][Jon Blow — truth in game design]).
[angelfold]: /echoes/angelfold
[angelfold]: /echoes/angelfold/
[Jon Blow — truth in game design]: https://www.youtube.com/watch?v=C5FUtrmO7gI
::: toc
@ -129,7 +131,7 @@ The other extreme I've heard people recommend is always wrapping things in `Arc<
There's also patterns you just... cannot express (nicely) in Rust. For instance, I cannot have a struct which stores a custom allocator together with two vectors allocated with said allocator. Ok, it _is_ possible by instead storing a reference to said allocator, and taking in a lifetime parameter and... let's stop for a second. This is all incredibly annoying to do, and trivial in Odin. That's not to mention how the [`allocator_api`][allocator_api] seems to have [stalled][allocator_api has stalled] long ago (which is fine by the way — this is a volunteer run project), while custom allocators are integrated into the language out of the box in Odin.
[allocator_api]: https://doc.rust-lang.org/beta/unstable-book/library-features/allocator-api.html
[allocator_api has stalled]: https://www.reddit.com/r/rust/comments/18yhmij/comment/kgb3jbt/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button
[allocator_api has stalled]: https://www.reddit.com/r/rust/comments/18yhmij/comment/kgb3jbt/
### Why Odin
@ -140,4 +142,5 @@ There's also patterns you just... cannot express (nicely) in Rust. For instance,
## Smooth screen transitions
## The entity system
## Further work — the seeds of procedural animation

View file

@ -33,7 +33,7 @@ Our server features a bunch of tweaks to the base game:
WYS- _gets shot_
:::
- PTT is computed as `B30 + B10`, hence it can never go down. For many long-term Arcaea players, this is a dream come true. This does mean your PTT will likely be slightly higher than in the base game, as the lack of a recency element removes the variance. As an upside, this does mean you can now play silly stuff without the constant fear of losing PTT. This also makes the server a perfect way to practice hard stuff, or to let someone new to try the game without starting to worry the instant you realise you forgot to turn on airplane mode.
- PTT is computed as `B30 + B10`, hence it can never go down. For many long-term Arcaea players, this is a dream come true. This does mean your PTT will likely be slightly higher than in the base game, as the lack of a recency element removes the variance. As an upside, this does mean you can now play silly stuff without the constant fear of losing PTT. This also makes the server is a perfect way to practice hard stuff, or to let someone new to try the game without starting to worry the instant you realise you forgot to turn on airplane mode.
{ src="insanepttgain.png" alt="A screenshot of a single play gaining an insane amount of PTT, implying the account is still new" }
::: image-figure

View file

@ -42,11 +42,11 @@ Meow
### Generating HTML
I used the existing html generator from the [jotdown][] as a starting point, but made heavy modifications to the code in order to support the features my heart longed for (like the example above!).
I used the existing html generator from the [jotdown][] crate as a starting point, but made heavy modifications to the code in order to support the features my heart longed for (like the example above!).
[jotdown]: https://docs.rs/jotdown/latest/jotdown/
Although repeated [`write!`][write!] calls work well enough for generating simple HTML, I felt the need for a more robust templating system for creating more complex elements. The system I ended up with works pretty well, although a bit simplistic feature-wise (which is by design, _copium_). For instance, the aforementioned character asides are powered by this template:
Although repeated [`write!`][write!] calls work well enough for generating simple HTML, I felt the need for a more robust templating system when creating more complex elements. The system I ended up with works pretty well, although a bit simplistic feature-wise (which is by design, _copium_). For instance, the aforementioned character asides are powered by this template:
```html
<aside class="aside" aria-labelledby="{{id}}">
@ -62,7 +62,7 @@ Although repeated [`write!`][write!] calls work well enough for generating simpl
</aside>
```
The template text gets embedded into the final binary (using [`incude_str!`][include\_str!]), then gets parsed at most once (using an [`OnceCell`][OnceCell]), into what essentially boils down into a list of ranges where content should be inserted:
The template text gets embedded into the final binary (using [`incude_str!`][include\_str!]), then gets parsed at most once (using an [`OnceCell`][OnceCell]), into what essentially boils down to a list of ranges where content should be inserted:
```rust
struct Stop<'s> {
@ -104,7 +104,7 @@ This theme of minimizing allocations when possible is something I've been trying
### LaTeX
Most websites I've come across seem to use either [MathJax][] or [KaTeX][] for LaTeX rendering. Shipping JavaScript would not be acceptable for this website, therefore MathJax was out of the equation (since as far as I understand, it operates on the client side only). I think KaTeX _can_ be used to pre-render LaTeX blocks on the server (although the the sites I've seen using it seemed not to do that for some reason). I don't particularly remember why I didn't go with it, although I guess the fact it runs on NodeJS would make usage from rust a bit painful. Oh well, I have working math, so that's what matters!
Most websites I've come across seem to use either [MathJax][] or [KaTeX][] for LaTeX rendering. Shipping JavaScript would not be acceptable for this website, therefore MathJax was out of the equation (since as far as I understand, it operates on the client side only). I think KaTeX _can_ be used to pre-render LaTeX blocks on the server (although the sites I've seen using it seemed not to do that for some reason). I don't particularly remember why I didn't go with it, although I guess the fact it runs on NodeJS would make usage from rust a bit painful. Oh well, I have working math, so that's what matters!
{ title="The ever elusive spider" character="lagrange" id="the-ever-elusive-spider" }
::: char-aside

View file

@ -1 +1 @@
pages = [["Posts", "2025-03-04T01:03:18+01:00"], [{ Post = "arcaea-pookies" }, "2025-03-04T01:03:18+01:00"], [{ Post = "the-realm-s-secrets" }, "2025-03-04T00:39:15+01:00"], [{ Post = "arcaea" }, "2025-03-03T22:34:06+01:00"], [{ Post = "yugioh-my-beloved" }, "2024-11-06T08:34:21+01:00"], [{ Post = "games" }, "2025-03-03T22:34:06+01:00"], ["NotFound", "2025-03-03T22:34:06+01:00"], ["Home", "2025-03-04T01:03:18+01:00"]]
pages = [[{ Post = "angelfold-2025-february" }, "2025-03-04T18:05:30+01:00"], ["Posts", "2025-03-04T01:03:18+01:00"], [{ Post = "arcaea-pookies" }, "2025-03-04T18:05:30+01:00"], [{ Post = "the-realm-s-secrets" }, "2025-03-04T00:39:15+01:00"], [{ Post = "arcaea" }, "2025-03-04T18:05:30+01:00"], [{ Post = "angelfold" }, "2025-03-04T18:05:30+01:00"], [{ Post = "games" }, "2025-03-04T18:05:30+01:00"], ["NotFound", "2025-03-03T22:34:06+01:00"], ["Home", "2025-03-04T01:03:18+01:00"]]

View file

@ -8,3 +8,4 @@ IgnoreAltEmpty: true
IgnoreHTTPS:
- "http://localhost:"
IgnoreURLs:
- "https://www.reddit.com"