<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="pattern.xsl" ?>
<?DOCTYPE pattern SYSTEM "plml.1.00.dtd"?>
<pattern patternID="seamless_gameworld" xmlns:html="http://www.w3.org/1999/xhtml">

<name>Seamless Gameworld</name>
<author>Eelke Folmer</author>

<problem>
<usability>
The player has to wait before entering a (new) part of the game. 
</usability>
</problem>

<principle>Match between system and the real world</principle>

<forces>
<force>
Players are impatient and do not want to wait.
</force>
<force>
Players do not want their game to be interrupted.
</force>
<force>
Loading levels while playing may significantly burden the system.
</force>
</forces>

<context>
Typical to "open ended games" games e.g. 3rd person shooters, roleplaying, action or simulation games where players have the  ability to move around freely in a large persistent world. These games usually have a nonlinear game plot (if any). Usually such a world is partitioned into separate zones as this world cannot be loaded in whole in the memory. When a player moves from one zone to another the player usually has to wait for the new zone to be loaded into the memory.
</context>

<pattlet>Provide a seamless gameworld.</pattlet>

<solution>Instead of letting the player wait before entering a new zone, load the level before the player enters the zone.</solution>

<implementation>
Rendering a huge seamless world may have a significant effect on the game engine design, an example implementation could be as follows:
<html:ol>
<html:li>The entire world is broken up into chunks (chunk size depending on available memory).</html:li><html:li>Only 9 chunks are loaded into memory at any given time, the chunk the player is currently in and the 8 surrounding chunks.</html:li><html:li>As the player moves out of the central chunk into one of the bordering chunks, the 3 chunks farthest from the player are discarded and the chunk the player just entered then becomes the center chunk. Then the 3 new chunks make the 3x3 grid are loaded</html:li> </html:ol>
This algorithm can be fined tuned by having some adaptive caching algorithm that could check how close a player is getting to a certain border chunk. As the player gets closer more and more of it is paged in bits and pieces at a time, so that by the time the player gets to the chunk it is loaded and available for rendering/interaction. If the player gets a certain distance away from it, it can be completely trashed to free up resources.The chunks can either be loaded in a separate thread or in the same as long as the player does not have to wait to load a chunk. This algorithm could potentially be extended to 3 dimensions where 27 chunks may need to be cached. 
</implementation>

<rationale>
Having a large, persistent world adds a level of constant immersion for the player, as the game never stops and never loads. This solution increases efficiency and satisfaction.
</rationale>

<example><html:IMG src="images/dungeonsiege-seamless.jpg" align="left"/>
<html:b>Dungeon Siege - </html:b>This role playing game provides "content streaming" which eliminates the need for "level loading" and it also made possible the creation of enormous worlds, which do not need to fit in computer memory.
</example>

<example><html:IMG src="images/wow-seamlessworld.jpg" align="left"/>
<html:b>World of Warcraft -</html:b> This massive multiplayer online game provides a seamless world. This connects a bunch of different looking types of places and makes them appear as if they all belong as parts of a whole. Loading times are as rare as they are brief. They only crop up when traveling across the game's enormous continents or entering some specific higher-level zones that are instanced for each player group, which guarantees you a fresh challenge 
</example>

<references>
</references>

<literature>The Continuous World of Dungeon Siege, Scott Bilas, Gas Powered Games, Game Developers Conference 2003
</literature>

<architecture-implications>
</architecture-implications>

</pattern>
