742 14. Runtime Gameplay Foundation Systems
freed by simply resett ing the stack pointer to the top of the LSR data block.
At this point, a new level can be loaded in its place. This is illustrated in
Figure 14.11.
While this design is very simple, it has a number of drawbacks. For one
thing, the player only sees the game world in discrete chunks—there is no
way to implement a vast, contiguous, seamless world using this technique.
Another problem is that during the time the level’s resource data is being
loaded, there is no game world in memory. So the player is forced to watch a
two-dimensional loading screen of some sort.
14.4.2. Toward Seamless Loading: Air Locks
The best way to avoid boring level-loading screens is to permit the player
to continue playing the game while the next world chunk and its associated
Figure 14.11. A stack-based memory allocator is extremely well-suited to a one-level-at-a-
time world loading system.