Technical Information - Moths

This page contains information about moth-related data structures and other internals that might be useful for patching or modding Hardwar.


Each moth is based around a 'frame', with additional equipment added on. Moth frame numbers are defined as follows:

const D FN_None=0;
const D FN_MoonMoth=1;
const D FN_SilverY=2;
const D FN_NeoTiger=3;
const D FN_Hawk=4;
const D FN_DeathsHead=5;
const D FN_Police=6;
const D FN_Alien=7;
const D FN_Swallow=8;

Frame Definition

This structure describes a Moth Frame.

typedef struct
    D ObjType; // Object type when not fitted.
    B Name[32];
    B FragName[32];
    D Mass; // Mass in kg.
    D DragFactor;
    B ArticName[13]; // Base of artic name. (e.g. "MOTH1")
    D NumWeapPoints; // Number of weapons points. (In artic data!)
    D PassengerSeat; // One if has a passenger seat, else zero.
    ResID ArticID;
    // D Structure; // maximum structure rating 0-0x4000
    D Struc2;
    D Value; // Base value of a moth built out of this frame.
    ResID Frag[4];
} Frame;


An engine is defined like this:

typedef struct
   ObjType Type; // Object type when not fitted.
   D MaxThrust; // Thrust provided at max power.
   D CThrust; // Control thrust provided.
   D IdleUsage; // Power usage when idle - includes power used
                        // to defy gravity!
   D ThrustUsage; // Power usage per second at max power, on top
   // of IdleUsage.
   D ControlUsage; // Power usage per second for control thrust.
   D Mass; // Mass in kg.
} Engine;

This is the actual data used in the game:

Engine EngineList[EngineNum+1]=
   OT_None, 0, 0, 0, 0, 0, 0, // 0 - Not a valid engine.
   OT_Engine1, Metre*70, Metre*40, 200, 2000, 200, 400,
   OT_Engine2, Metre*95, Metre*50, 300, 2500, 200, 600,
   OT_Engine3, Metre*115, Metre*60, 150, 3000, 200, 800,

The thrust values are not really in units of metres of course.

Power Cells

A power cell is defined like this:

typedef struct // Structure defining the characteristics of
{ // a power cell.
   ObjType Type; // Object type when not fitted.
   D MaxPower; // Power held when fully charged.
   D ChargeRate; // Recharge rate at max light, per second.
        // If zero, recharges to full all the time. (Fusion!)
   D Mass; // Mass in kg.
} PowerCell;

The data used in the game is as follows:

PowerCell PowerCellList[PowerCellNum+1]=
   OT_None, 0, 0, 0, // 0 - Not a valid cell.
   OT_Cell1, 2000000, 410, 10,
   OT_Cell2, 4000000, 810, 20,
   OT_Cell3, 2000000, 1010, 40,
   OT_Cell4, 1500000, 610, 50,
   OT_FCell, 2000000, 0, 30,

Fitting Items

There's no information in the moth frame structure regarding the specific restrictions on what can be fitted to each moth. Unfortunately (from a modding perspective) this was hard-coded. The details are:

The above are the only moth-related restrictions - other than that they're all the same as far as what equipment can be fitted.

The Alien Moth

There are a number of hard-coded things that make a moth based on the Alien frame different to any other. Many of these are cosmetic only, but some make it useless as a player moth in online games, particularly:

Theoretically, these differences could be hacked out. They're all based on the frame number so with a lot of patience, tinkering with cases where something is compared to FN_Alien (i.e. 7) might yield some results.

Moths used by factions

The question was asked, is it possible to change the moths used by different factions, for example making the Lazarus patrols use one kind of moth and Klamp-G a different kind.

The short answer to that is that it would be very difficult to hack a solution to that. Patrol pilots for the various factions equip themselves with a moth from a factory owned by their faction. There are only two types of moth factory, each of which builds a different selection of moths. To make this change there would have to be a wider range of factories, which would then be allocated to the factions. Doing this via modding the EXE file would seem to me to be a mammoth task.