User Tools

Site Tools



Tag Tournament includes a large number of assets, such as images, animations, maps, sounds, etc. Due to their large number, repetitive nature, and proneness to further content inclusion, it would not be very convenient to hardcode their usage. This would require intensive intervention of a programmer whenever new contents would have to be added.

In order to easily define such imports, an XML file was created and is parsed every time the game is started. This file contains the paths to every resource, as well as any associated properties.


The necessary code to define a player actor animations:

    <PlayerActor name="Tom" description="Player1" tagPath="Characters/Players/TomHeart" heartPath="Characters/Players/TomHeartLargest" color="0,147,221,255">
      <Animation name="TomLeft" path="Characters/Players/TomLeft" fps="1" horizontalCount="1" collision="24,99"/>
      <Animation name="TomRight" path="Characters/Players/TomRight" fps="1" horizontalCount="1" collision="24,99"/>
      <Animation name="TomLeftMove" path="Characters/Players/TomLeftMove" fps="15" horizontalCount="8" collision="24,99"/>

The tag “PlayerActor” starts the definition of the first player, called Tom, whose graffiti texture is defined by “tagPath”. Each of his various animations include the path and, if it is an animated sprite, the number of horizontal instances and its fps. It is also necessary to define the collision box starting point and, if needed, some kind of animation offset to adjust its starting point.

According to any necessary actions, more animations may be added. The same applies for any npc configuration, which may include more attributes if specific property needs to be defined. For the chosen animation name, some standards are defined, namely:

Animation name = [Character Name] + [Direction] + [Action]

If [Action] is empty, it refers to a standing position.

Sound, Powerups and Food

Working in a similar fashion are the sound, powerup and food items (dropped by the fatboy). They all contain a name and resource path, and their enumeration in this file is especially useful when random items must be chosen out of a known list.

In the case of powerups, since there are many different effects, some more precise classes had to be coded. However, for building positive and negative versions of the same item, simply changing the value sign of the “baseEffectValue” is enough. In some cases, changing the base time duration (which may be changed according to the chosen difficulty) is sufficient to build a completely new powerup.

    <Sound name="SchoolBell" path="Sounds/SchoolBell" />
    <Sound name="Birds" path="Sounds/Birds" />
    <PowerUp name="Time Extender" class="TimeExtendInstant" path="PowerUps/Clock" baseEffectValue="60" />    
    <PowerUp name="Accuser" class="AccuserInstant" path="PowerUps/Accuser" baseEffectValue="-1" />
    <PowerUp name="Invulnerability" class="InvulnerabilityTimed" path="PowerUps/Star" baseTime="10" baseEffectValue="1"/>
    <Food name="Apple" path="Items/Food/AppleItem" baseEffectValue="3" baseTime="20"/>
    <Food name="Banana" path="Items/Food/BananaItem" baseEffectValue="5" baseTime="20"/>


Lastly, the maps definition constitute one of the main advantages of using such a file. In fact, in order to add a new map, adding some lines is enough:

<Map orderId="2" name="Canteen" path="Maps/CanteenMap"  doorWallPath="Maps/CanteenMapDoorWall" previewPath="Maps/CanteenMapPreview" collisionPath="Maps/CanteenMapCollisionSmall" vigilantStartTile="0,7"  girlStartTile="33,0" vigilantTargetTile="12,7" doorTile="4,7" clockLocation="195,15" collisionBlockSize="25" vigilant="Cook">

      <Decoration path="Maps/CanteenTable" topPosition="300,391"/>
      <PickUp name="Canteen Chair" path="Maps/CanteenChairRight" topPosition="-15,-40" damage="2" weight="20" tile="11,18"/>
      <TagSpot area="16,6,2,2" topPosition="0,-33" pointValue="3"/>

This code starts by defining the map name, background image, preview image, collision map, vigilant, clock position, as well as the starting location for vigilant, maid and girl. Inside the map tag, more items can be defined:

  • Decoration: Tables, desks, counters, etc, which lie in the room
  • Pickups: Items that a player can pick and throw
  • Tagspots: Locations of the tagspots (in tiles), as well as their texture offset, and score value
configuration.txt · Last modified: 2019/10/22 19:35 (external edit)