How to store persistent data when the game changes level?

Started by
10 comments, last by Captain P 15 years, 3 months ago
<offtopic>
Quote:Original post by Zipster
Extraneous disk access is almost always avoided as it's universally slow on just about every platform.

Unless you have one of those. :P
</offtopic>
Advertisement
Zipsters explanation is really what it comes down to: you save the persisting data in a 'higher scope', or on a higher level, however you want to call it. But if you want to keep things efficient and workable, you keep that scope in the games memory, not in a file (which is needlessly far away). And you'd design your game with that in mind, not with slapping in singletons (which impose unnecessary restrictions and 'encourage' unwanted dependencies).

Both the singleton approach and the save-to-file approach do make use of a higher scope to save the persisting data in, and so both can work, but they're also fairly cumbersome. A proper design accomplishes the same, but in a better way.


@Konfusius: spiffy! :D
Create-ivity - a game development blog Mouseover for more information.

This topic is closed to new replies.

Advertisement