<?php
	include("header.php");
?>
		<div id="content">
		<h1>Technical Information - Moths</h1>
<p>This page contains information about moth-related data structures and other internals that might be useful for patching or modding Hardwar.</p>

<h2>Frames</h2>

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

<pre>
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;
</pre>


<h2>Frame Definition</h2>

<p>This structure describes a Moth Frame.</p>

<pre>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;
</pre>

<h2>Engines</h2>
<p>An engine is defined like this:</p>
<pre>
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;
</pre>

<p>This is the actual data used in the game:</p>
 <pre>

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,
};
</pre>

<p>The thrust values are not really in units of metres of course.</p>

<h2>Power Cells</h2>
<p>A power cell is defined like this:</p>

<pre>
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;
</pre>

<p>The data used in the game is as follows:</p>

<pre>
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,
};
</pre>


<h2>Fitting Items</h2>

<p>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:</p>

<ul>
<li>Silver Y - can't fit Laser Turret, Underkill, Pulse Laser, Groundbase, Fireburst, Devastator, Engine 2, Engine 3</li>
<li>Moon Moth - can't fit Engine 3</li>
<li>Swallow - can't fit Laser Turret</li>
</ul>

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

<h2>The Alien Moth</h2>

<p>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:</p>

<ul>
<li>It can't be damamged</li>
<li>It can't be targetted</li>
<li>It causes all systems to fail on any moth it goes near</li>
</ul>

<p>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.</p>

<h2>Moths used by factions</h2>

<p>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.</p>

<p>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.</p>

		</div>


<?php
	include("footer.php");
?>
