| Inside the Engine: Area Creation |
|
|
|
The Broken Hourglass will ship with dozens of unique landscapes, providing fertile ground for modders who wish to introduce their own characters and quests. New area creation is well within the reach of the ambitious, however. In this installment of our Inside the Engine column, we explore the basics of area creation and discuss the special maps necessary to introduce a new area to the game. Any 3D environment artist (or 2D artist willing to put in a little extra effort) can create an area for The Broken Hourglass or other WeiNGINE games. WeiNGINE does not use tile-based environments, so each area is a unique project unto itself, and artists need not be constrained by texture limits imposed by the game. Any of the dozens of 3D staging and rendering packages in existence are solid choices for area creation. 3D software makes it easy to exactly match the camera angle used in The Broken Hourglass. An FBX-format file which contains basic staging information will be provided to modders at a later date. Drawing a new area by hand is possible, but the time investment in going back and tracing occlusion maps and generating solidity maps could prove discouraging. This is not a tutorial in creating 2D isometric landscapes generally, only how to apply the end product to a game using WeiNGINE. Plenty of artistic tutorials exist which cover the techniques involved in building appealing environments. There are four fundamental components to any area: the backdrop, occlusion map, solidity map, and lightmap. We will illustrate each of these with an actual, in-game example of a small, modest home. Backdrop: This is the on-screen representation of the area as seen by the player. There are only a few simple requirements of the backdrop.
![]() The backdrop for this area, reduced to 75% its true size for Web layout purposes Occlusion map: Occlusion maps provide information to the game about the location of objects which should occlude sprites. When a sprite is occluded, it means that an object in the gameworld is seen to be "in front" of the player, partially obscuring the sprite behind it. Occlusion maps must be two-color, black on white PNGs (BMP will also work.) The occlusion map is not used directly by the engine, but rather used by a special tool called "bmp2polylist"* which generates a series of polygon coordinate data from the maps. Occlusion maps are generally obtained by executing a special render of the area in 3D software which produces a simple silhouette of the objects, with no lighting, shadow, or texture effects. ![]() One of two wall occlusion maps Typically, an artist will be required to produce multiple occlusion maps, rather than simply providing a silhouette of the entire area. This is to ensure that colliding or overlapping objects are accounted for separately, and to eliminate the optical illusion that would be produced by a set of walls joining at a 90 degree angle in a greater-than or less-than shape. For this reason, artists will typically produce two wall maps--one with walls running from a general NW to SE line, and the other with walls running from a general NE to SW line. This will be followed by one or more maps of just the objects in the area--again, multiple maps being used if there are many overlapping objects which might tend to create right-angles and optical illusions. Usually, the bottom 8 pixels or so of an object or wall are "cut off" in the occlusion map--this is to prevent sprites from accidentally becoming occluded by objects they get too close to while still "in front" of the object. This can be achieved by simply raising the floor in the area before rendering the occlusion map. ![]() The other wall occlusion map. When all of the wall and occlusion maps are finalized, they must be run individually through the bmp2polylist tool. This will produce one XML polygon data file per image. The data in these files should be combined into a single XML file which will be used for the final occlusion calculation. ![]() The object occlusion map. Data from these three maps will be merged into a single XML file. One special category of occlusion map is the overhead occlusion. Standard occlusions are used for walls and objects--things which only obscure a sprite when the sprite should be "behind" them, from the player's point of view. Overhead occlusion is needed for objects and obstructions which will always be perceived as between the player and any sprites on the backdrop, and so should always provide occlusion--not just when a sprite's foot circle is behind the object, but whenever any part of the sprite is behind the object. Typically this is used for objects which are taller than standard humanoid height--door archways, treetops, etc. Overhead occlusion is a separate entry in the area data, and should not be combined with the regular occlusion maps. ![]() The overhead occlusion map. The overhead beams should always block any sprite from view, as they are always closer to the viewer than the sprite. Doors (a topic for another time) also have their own occlusion data, so that a closed door obscures sprites standing behind it.
![]() The solidity map. Note that red indicates a wood surface. Any other color-coded region is walkable. There are seven color-coded regions. Each has a unique footstep sound associated with it, and those footstep sounds can be overridden at the area level--meaning a "wood floor" interior can sound different from a "wood floor" exterior.
Lightmaps: Although strictly speaking not a requirement of a new area, lightmaps deliver a tremendous deal of flavor and authenticity to the in-game appearance. The lightmap is used to skew the coloration of a sprite based on the lighting information provided for the solidity block the sprite stands in. With a lightmap, characters can fade into obscurity as they walk into a dark corner, or become reddish as they walk near a giant glowing magic ruby. ![]() This area's lightmap. To summarize lightmaps:
The resulting area from our examples would be defined as follows: * - PWG's bmp2polylist process is based in part on the Triangle utility. |
|
| Last Updated ( Wednesday, 29 August 2007 ) |
| < Previous | Next > |
|---|






