Configuration Files

MapObj (6.2)

Next comes the MapObj. This is where the attributes are defined for the unit's placement on the map.

  MapObj()
  {
    GodFile("army_grunt.god");
    PhysicsModel("Walker");
    TractionType("ground");
    GrainSize(1);

    ArmourClass("infantry");
    HitPoints(200);

    TypeDisplay()
    {
      Image()
      {
        Image("if_game_portraits.tga", 0, 84, 42, 42);
        Mode("Centre");
      }
    }
    GenericFX()
    {
      Add("Weapon::Fire", "weapon.grunt.fire");
      Add("MapObj::Death", "death.infantry");
      Add("MapObj::AddToMap", "damage.grunt");
      Add("Restore::Target::Process", "restore-small");
      Add("MapObj::AddToMap2", "restore-small-puff");
    }
    ShadowFile("army_grunt-shadow");
    RotateShadow(0); // default is 1

  }

Let's go through each section one at a time.

GodFile - The all-important .god file is defined here. The .god contains the geometry for the object as well as all textures and animation. Creating .god files is a very complicated business that I'll only touch on here. The art asset can be made in either SoftImage or 3DSMax and exported as a .xsi. The .xsi then gets brought into the proprietary MeshViewer tool and converted into the .god format.

PhysicsModel - The physics model affects how the unit will move on the map. It defines whether or not it tilts when it moves on slopes, how fast its speed is affected by slopes, whether it moves on the surface of water, under the water, or if it flies over the water. The Grunt is a "Walker", so it moves on the ground plain, does not tilt when going up a hill, and has its speed diminished 25% by slopes. To find a list of all physics types, look in base.x\misc\types_physics.cfg.

TractionType - This entry goes hand-in-hand with the PhysicsModel in defining on-map behavior. It determines if a unit is allowed over each type of terrain. As explained elsewhere, each terrain texture allows certain units to pass over it. The basics are, base, basenoair, and impassable. Placing water on the map automatically overrides whatever texture is on the ground beneath it, and the cell becomes one of the six types of water terrain, depending on its depth and distance from the shore. To view all the traction types, look in base.x\misc\types_traction.cfg. Here is a brief explanation of each type of terrain:

TODO: Does MediumShoreline + MediumWater still exist in AMRTS? Does water become "deep" at 2.5 meters or something else?

GrainSize - Setting this to 1 makes a unit only occupy a quarter of a cell's space, like infantry. Otherwise, the unit will occupy the entire cell, like vehicles.

ArmourClass - This is where a unit's susceptibility to weapon damage is defined. You will notice later on that each weapon has an explicit entry for its damage effect to each of the five "armor" classes: infantry, vehicle, structure, flyer, and mines. If one of these classes isn't specified in the MapObj, the unit cannot take damage.

HitPoints - Fairly self-explanatory and very important. This sets the strength of each unit. It is displayed as the green HP.

TypeDisplay - This is where you specify the art asset that will be used to represent the unit on the build menu. This is called the unit icon. It is only needed if the unit you are making can be created by the player. The four numbers after the file name explain where on the image the icon can be found. This is needed because several icons can be fit onto a single image. The first two numbers give the X and Y coordinates for the upper left corner of the icon. The next two numbers give the length and height of the icon in pixels.

GenericFX - The effects that can be run on a unit must all be listed here. Things such as damage, death, recycling, constructing, restore, and others all need to be entered. The best thing to do is to just copy these effects over from a similar unit.

ShadowFile - This is the texture that is drawn on the ground for the unit's shadow. The game will automatically use a texture based on the .god file's filename. However you can override that texture and define any texture you want with this. All infantry use method this to borrow the Grunt's shadow file. The default shadow filename follows this naming convention: .god filename-shadow.tga

RotateShadow - This determines whether the shadow will rotate as the unit rotates. Infantry set this to 0, while vehicles don't.

SourceObj

The resource objects have their own Obj that is built off the MapObj. It is very simple, with only four entries.

Mode - This is the setting for what kind of resource the object is. You have three options: StaticDepleting, StaticNonDepleting, and Collectable. StaticDepleting is the most common type: sources that have a static amount and can be emptied. StaticNonDepleting source types have an infinite amount to give. And Collectable sources are only plastic blobs. They have a static amount, but units can refill it by dying nearby the source, also the source will be deleted once depleted.

Resource - Self-explanatory. Does this source have plastic or electricity?

Capacity - This specifies how much the resource starts with.

LoadRate - While mining, every second a Dump Truck will be given this amount.