Skip to content

u/verdagon

In this archive from Sep 2012 to Mar 2026

9
posts
9
comments
2
media
143
score

Top posts

Top comments

Author here! Perfect Replayability and determinism were a pretty awesome help in the 7-Day Roguelike Challenge.

Back then, I used an invincible pseudo-random AI player to play my game thousands of times overnight, writing down the run's seed every time it crashed (or hit an assertion failure). In the morning, I would just wake up, grab the crashed seeds, and use perfect replayability to reproduce the bug instantly, no fuss.

That was a toolkit on top of C# back then, where it was pretty tricky to set up. (Did you know that string.GetHashCode() is nondeterministic? Fun!)

Now we've finally brought it to Vale as a first-class feature! That and Higher RAII make it a lot easier to prototype games fast enough for 7DRL's speed. It should be pretty good for RTS or anything with lock-step simulation too, I'd imagine.

16 points

Thanks! Forcing long-term behavior is super useful once you know it's there and available. As I'm getting used to it, I'm finding more and more ways for higher RAII to enforce invariants and assumptions in my code.

That's good feedback, and others have suggested renaming it to something else. The ! means negation here, so that directive is saying "Don't automatically define a drop function for this type".

In Vale, if you unpack a &UnitController (a non-owning reference to UnitController) then it will alias all the members. However, the code in the article is sending a UnitController (an owning reference) which destroys the UnitController and rescues its innards into locals.

It's a distinction that makes sense at all levels of the compiler and language except the user-facing syntax, which... isn't ideal. I've been thinking of changing it to [unit, locToUnitToken, view] = destruct self; or something more understandable.

3 points

Currently yes, and cross-machine compatibility is in Vale's future!

We can actually control floating point behavior (Java floating point behavior is the same across all machines IIRC) with a slight performance overhead, which is acceptable for record/replay mode.

I believe LLVM lets us specify integer overflowing behavior too.

However, if there are ever things we can't control, we could capture those with a "profile" at the beginning of the recording, and then do some tests in replay mode to make sure the replaying machine acts similarly to how the recording machine did. For example, recording mode would write the result of 1.0 / 3.0 to the first 8 bytes, and the replaying mode would check that it gets the same result, to know if they're compatible.

Glad you like Vale's goals!

2 points

Subreddits

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.