Game Development Reference
In-Depth Information
Figure 13-5. Reference output for statistics view
While the upper half of the statistics view is not editable, designers are meant to insert a weapon's name, the
number of hits, and the number of days in order to see the weapon's worst case and expected behavior. Naturally, you
could include a lot more statistical features based on the data of a weapons program.
Configuration File(s)
For the implementation to generate, David and Tobey talk to Paul, the senior programmer of the team. Paul shows
Tobey how FGS' in-house game engine manages in-game items in general and how they intend to integrate the
modeled weapons into this system. The abstract concept of weapon types is realized in the engine by an abstract class
called WeaponType . The code generator is now in place to generate a subclass for every designed weapon type that
sets its properties and prepares the necessary method stubs (see Figure 13-6 ). Moreover, every designed weapon is
mapped to an object instance of the corresponding weapon type. Therefore, the generator needs to create a simple
XML file that serves as configuration file for the game engine, as shown in Listing 13-6.
Listing 13-6. Excerpt of Reference Output XML Configuration File
<Weapons>
<Weapon id="Splitter">
<Type>Axe</Type>
<Attack>16</Attack>
<MaxDurability>23</MaxDurability>
<DurabilityBehavior>
<Day value="0.1" probability ="30" />
<Stroke value="0.2" probability ="50" />
</DurabilityBehavior>
</Weapon>
...
</Weapons>
 
Search WWH ::




Custom Search