For performance reasons, the cut Bitmap Data is cached, so the same operations for cutting don’t always have to be carried out.
CAMPAIGN MAP The campaign map turned out to be a particular challenge for us due to its size. Loading the campaign map at full resolution was out of the question, because otherwise a significant break would occur in which players could not interact with the game. A high quality of graphics on one hand and fast loading times on the other seemed to be near impossible. However, to ensure both, we chose a multi-step approach. First, a highly compressed image is loaded, which is additionally scaled down by a factor of five. After loading, it is scaled up again to its original size, with smoothing activated and displayed to the user. From this moment on, the user may interact with the game. Now the high-resolution campaign map is
loaded. It was previously cut into 110 pieces, however, and to quickly proceed to a higher quality of representation, the tiles visible on the screen are loaded first. In the excerpt shown in Figure 2 (left), these
are only 25 of the 110 tiles, which are initially loaded with a high priority from the server. Once the graphics are available, they are displayed on the client. Only in the last step, the remaining parts
An example of a button sprite sheet (‘Figure 1’, top- right), Forge of Empires in action, (top), and the division of the map with the high priority tiles highlighted in green (‘Figure 2’, bottom)
The central asset manager interprets the XML files and makes the assets available under the name defined by the function getImage.
public function getImage (image: String): BitmapData { var src: BitmapData = resource.getBitmapData (image name); var: int = parseInt (img. @ cropwidth, 10) | | src.width; var height: int = parseInt (img. @ cropheight, 10) | | src.height; if (@ img cropx.toString () |!. |!. img cropy.toString @ ()) { return src; }
are loaded, so that the user receives high- resolution graphics even when scrolling the campaign map. Many of these techniques only have a small effect if taken individually. With combining them, however, one succeeds in offering a smoother gaming experience to players. Through skillful management of the graphics to be loaded, developers also lay the foundations for further development of the game.
Nikolas Banspach has developed computer games full-time since 2007; first, at kr3m Media in Karlsruhe, Germany, and since early 2011, at InnoGames in Hamburg. He has been working with the Forge of Empires team from the start of the project and focuses on frontend development. www.innogames.com