this post was submitted on 13 Jan 2026
21 points (92.0% liked)

Game Development

5518 readers
5 users here now

Welcome to the game development community! This is a place to talk about and post anything related to the field of game development.

Community Wiki

founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] SleeplessCityLights@programming.dev 1 points 2 weeks ago (1 children)

That is super cool that you got auto-save and auto-load to work with pure functions. It is technically an IO operation but with data structures and enums you can guarantee the same functionality as something stored in the heap.

[–] soulsource@discuss.tchncs.de 2 points 2 weeks ago

The actual writing of course isn't pure. Loading isn't either, but we only support loading on level transition, so we can supply the data already when constructing the game state. Saving is done by gathering all the data that should be saved in a struct, what is pure and happens at a well defined point in the frame, where the game state is known to be consistent (-> I think it's after all systems have been updated), and then this struct is written out to a file.