Chillu1 / ModiBuff

Buff/Debuff/Modifier library focused on feature set and performance, while maintaining 0 GC. Fully pooled
Mozilla Public License 2.0
139 stars 4 forks source link

Modifier state serialization / save-load #40

Closed Chillu1 closed 10 months ago

Chillu1 commented 10 months ago

Describe the solution you'd like Serializing all modifier state that matters: timers, stacks, effects state,

Possible issues Loading the state correctly is a tricky thing to get right, since state is dependent on each other in many ways. Ex. post effects can't have state, and post effect that add state won't be able to signal that. Meta effects might also be a problem if we don't have or haven't saved total added state.

Another issue could be that the user has one state field for a stat, if we add to that stat, the user can save it mutated. Resulting in the wrong base value, which when we load will be applied twice, but some effects might not trigger correctly, if we for ex. aren't storing total added state in the effect.

Suffice to say, this will need to be strongly tested.