-
Notifications
You must be signed in to change notification settings - Fork 246
Adds a per-level persistence system. #5176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Adds a per-level persistence system. #5176
Conversation
1802990 to
1dd8215
Compare
|
Depends on #5175 |
| // Is this actually desirable? People moving around or modifying | ||
| // atoms across save could result in inconsistent data. | ||
| set waitfor = FALSE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think you'd have to actually add if(_persistent_save_running) return hooks into move and other client-driven/verb things to make it block anyway, is the thing. i'm not sure waitfor = TRUE would be enough. so it'd only be a partial solution either way
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could potentially suspend all subsystems and kick people back to the lobby during saves, maybe? Similar to how DMMS suspends fluids and such until the run finishes.
1dd8215 to
4d406a4
Compare
4d406a4 to
96e2512
Compare
|
I'm going to call The atom side of this appears to be working fine, I've tested with a debug item and it all seems pretty good. EDIT: Went ahead and just let it instance datums with the serde data as a list arg, in case it's needed in the future. |
aa31be7 to
2862dd3
Compare
|
Slipped and accidentally added turf serde, limited testing on Shaded Hills but needs proper testing before I sign off on it. |
|
Depends on #5182 |
|
Testing notes:
|
f491ffe to
3a905e3
Compare
47f36b1 to
ca63ff2
Compare
ca63ff2 to
bfb3ca2
Compare
out-of-phaze
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
needs rebase
b9679aa to
c669cfa
Compare
|
Current outstanding issue with this one is that I cannot for the life of me seem to get map templates placed during init to flag the turfs as changed. Generating on Shaded Hills and restarting leaves template-shaped sections of mask turfs. Not sure what the issue is, it happened even after I made all ChangeTurf() calls and relevant sections of DMMS flag the turfs directly. I am assuming that something is newing /turf directly and not flagging. |
c669cfa to
5c195d6
Compare
does |
Genuinely no idea why I didn't think of this. Thank you :( |
f8bb209 to
a8a96a1
Compare
a8a96a1 to
f0262df
Compare
|
This is now working as far as I can tell. Main things I am worried about in live testing is accidentally cooking legacy persistence data, but it should at least write out a backup before it does any kind of migration of that data. I am not committing any changes that actually use this system in full yet, I'm going to save that for after we've done playtesting (probably via Pyrelight or maybe Scav) |
|
Realised belatedly that I need to get area serde in before this will work as intended, due to map templates setting area, but I will do that in a second PR, I don't want to fiddle with this one further currently. |
out-of-phaze
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i frankly really don't like that we still have the legacy persistence system, it really doesn't work for anything but papers and dirt (the generic 'filth' stuff was extremely annoying). but i guess some maps want a middle-ground re: persistence.
once this is in i'll try to make it faster
code/datums/datum.dm
Outdated
| /// Used to avoid unnecessary refstring creation in Destroy(). | ||
| var/tmp/has_state_machine = FALSE | ||
| /// Var for holding a unique-to-this-run identifier for a serialized datum. | ||
| VAR_PRIVATE/__run_uid |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this could use /tmp/ possibly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes please. I really wish /tmp was used more. It helps make transient vars a whole lot more obvious.
f0262df to
511b0ee
Compare
Description of changes
/atom/Serialize()to return an assoc list of relevant values suitable for saving out./atom/Preload()and/atom/PreloadData()and hooks in SSatoms flush to deserialize atoms during flush./datum/level_data/load_persistent_data()and/datum/level_data/save_persistent_data()as entrypoints for per-level persistence.General flow of level persistence:
TODO
Implement area serde.Test level generator reordering (split into 2nd PR?)Reverted these changes.Future work
Completely integrateended up largely doing this in this PR./decl/persistence_handlerinto this system instead of the bespoke serde on SSpersistence.Why and what will this PR improve
Adds a framework for handling persistence in the future.
Authorship
Myself.
Changelog
Nothing player-facing.