HTML and CSS Reference
In-Depth Information
Figure 2-1. Polycraft is a complete 3D, HTML5 game built by Wonderstruck Games ( http://wonderstruckgames.com )
using the Turbulenz Engine. With 1000+ assets equating to ~50Mbs of data when uncompressed, efficiently loading
and processing assets for this amount of data is essential for a smooth gaming experience. The recommendations in
this chapter come from our experiences of developing games such as Polycraft for the Web. The development team at
Turbulenz hope that by sharing this information, other game developers will also be able to harness the power of the
web platform for their games
Caching Data
Caching content to manage the trade-off between loading times and resource limitations has always been a game
development concern. Whether it be transferring information from optical media, hard disks, or memory, the amount
of bandwidth, latency, and storage space available dictates the strategy required. The browser presents another
environment with its own characteristics and so an appropriate strategy must be chosen. There is no guarantee that
previous strategies will “just work” in this space.
In the world of browser-based gaming, caching can occur in the following locations: server side and client
side. On the server side, the type of cache depends on the server configuration and the infrastructure behind it, for
example whether a content distribution network (CDN) is being used to host the files. On the client side, it depends
on the browser configuration and ultimately the game as it decides what to do with the data it receives. The more
of these resources you have control over, the more optimizations you can make. In some occasions, certain features
won't be available so it's always worth considering having a fallback solution. Figure 2-2 shows a typical distribution
configuration. The server-side and request caches on the remote host servers, either on disk or in memory, ensure
that when a request comes in, it is handled as quickly as possible. The browser cache and web storage, typically from
the local disk, reduce the need to rely on a remote machine. The asset cache, an example of holding data (processed
or unprocessed) in memory until required, represents the game's own ability to manage the limited available
memory, avoiding the need to request it from local disk or remote host server.
 
Search WWH ::




Custom Search