Suppose you’re playing Starcraft, and you are building Zerglings.
In storage, you only need to store 1 Zergling — its base hitpoints, its damage, it’s visuals, etc. Every time you spawn a Zergling, the game looks up the Zergling “template” in storage and creates one in-game.
But if you have spawned 100 Zerglings in-game, you can no longer keep just one template. You have 100 Zerglings, each with its own HP, its own position, its own animation state, etc. This would take about 100 times more memory than just the template.
This is how it works with most of game’s data. In storage, you only keep the “templates” that can be used to regenerate the game’s state, but during play, you have to store the entire state with many entities.
Latest Answers