Gary L. Simmons  rev 08/26/03  http://battlecatslitterbox.com/Anvil/HAS/EngineHacking.html
Litterbox  Anvil Tips  Hamish Sanderson's EditNotes


The Battle Cat's Litterbox


Anvil Tips | HAS Tutorials | Edit Notes | Sounds & Music | Images File | Tools | Nonstandard Colors | Control Modifications | HUD Modifications | Prefs Modifications | PICT Notes | Engine Hacking | Documentation | Bandwidth Saving | Unused Sounds | Hakvil | Shapes 1 | Shapes 2 | Color Clippings | Custom Icons | Clut Notes


Hacking the Marathon Infinity Engine


Engine Hacking is much more than wrestling with the choke knob as you start your old 46 flat head Ford on a frosty North Dakota morning. Engine Hacking extends far beyond taking a fire ax to that same engine when it won't start after 10 frustrating minutes of red faced swearing and teeth grinding. Engine Hacking doesn't even refer to the internal combustion engine at all you confused noddling twit! Engine Hacking is the term Hamish Sanderson uses to describe the process of profoundly changing the Marathon resources into something completely custom. This is a must see for total conversion scenario makers. - gls


There's a whole heap of stuff that can be done to the Marathon Infinity engine using ResEdit and/or Fux! Some mods are 'necessary' due to changes to weapon types (where you'd want to alter the names in the inventory to match). Others are great if you're doing a more radical conversion where you want to give Marathon Infinity a 'different look' to some (or even a large) extent. For the really insane folks, it's worth realizing that it's quite possible to customize the Marathon Infinity engine using the existing tools until even its own mother wouldn't recognize it! (I've done this sort of thing myself.)

ResEdit stuff

ResEdit Stuff

The main resources to know of are:

CLUT
CLUT 130 is the only one that seems to be of use (I've never figured what 5000 and 5001 do or don't do, and 5002 contains the Marathon Infinity Standard colors but isn't actually used for anything in the engine as far as I can tell).

The entries are:

 0 foreground color for ammo energy indicator bars *
 1 background color for ammo energy indicator bars *
 2 general background, for terminals and the surrounding area on screens larger than 640x480 +
 3 foreground color for inventory text
 4 background color for inventory headings
 5 background color for other inventory text
 6-13 automap player colors ++
 14 unknown
 15 unknown
 16 background color for terminal status lines
 17 foreground color for terminal status lines
 18-25 foreground colors for terminal text

* Unless you've changed it with Fux! Fux allows you to select any color from this list to be used as ammo energy bars (you could very probably tack extra colors onto the end of this CLUT for use via Fux if you wished).

+ This is probably best left set to black. BTW, funny stuff happens with borders around the Main Controls screen when playing in 256 colors. I think it has something to do with Marathon Infinity referring to the CLUT for the Main Controls screen instead of to this CLUT (I guess it's a bug). I suspect it has something to do with the in-game CLUT having black positioned 19th and the engine being hard coded to look to this position for its 'global' black. It seems that after quitting a game, the engine seems to continue looking at the 19th entry of the current CLUT (in the Main Controls screen, this means the main controls screen CLUT found in the Images file). It's really rather bizarre, and a bit unpleasant visually, although I suspect it could be gotten around by tweaking the relevant [e.g. main controls screen] CLUTs so they have black in 19th position instead of at the end (doing this shouldn't have any side-effects, AFAIK).

++ If changing these, you may want to remember that these correctly reflect the player colors in net games (unless you've been changing those in the Shapes file and Team/Player color menu in the Preferences too). It's common practice these days for folks to modify map colors and change the color of the player in the automap, but bear in mind that those colors do serve a useful purpose in net games (i.e. lets you see who's who when you're looking for a [un]friendly face to frag).

One other note: bear in mind that if changing any of these colors, the Marathon Infinity engine is limited in 256 colors as to what it can display. So it's best to pick new colors that match the Marathon Infinity palette if you don't want unpredictable results.

 

CNTL/DITL/DLOG
(see Preferences Modifications section)



finf
(see HUD Modifications section)



ic14/ic18/ICN#/ics#/ics4/ics8
(see Custom Icons and Unique Creator Code section)

[Editor's Note: Hamish Sanderson, when queried about the nonexistent "Custom Icons and Unique Creator Code section" in his Anvil tutorials said, "Sorry, that bit never got written." It could have been worse, God could have said the same thing concerning the last 3 of the 10 Commandments! Fortunately for us God found the time to jot down all the Commandments and much like Moses and God, Chris Komarnicki has collaborated with Hamish and together they have finally completed the long lost Custom Icon section. I guess this is more like Indiana Jones and the lost Ark actually, only with out all the arrows, snakes, flying wings and Nazis. Hmmm... actually I suppose it is more like just two computer geeks out-wonking one another. - gls 01/16/2001]

 

MENU
(see Preferences Modifications section)

Also note that menu ID#129 contains the Main Controls screen options (New Game, Quit, etc). Although you never see the menu itself, you can add/remove/alter the keyboard shortcuts for each item, should you wish. e.g. If your project is solo-only and you've gone to the trouble of hiding all the Netgame options in the Main Controls screen and Preferences so they can't be used, then you'll probably also want to remove the keyboard shortcuts from this menu so that net play options can't be accessed that way either.

 

nrct
(see HUD Modifications and Main Controls Screen Modification sections)

 

PICT
You'll find a few minor bits and pieces in here; the 'Preferences' and 'Configure Keyboard' graphics that appear in the Preferences dialogues, and the various 'Network Game' graphics also. Modifying these isn't a problem, but remember that when displayed, if in 256 colors they will use the current CLUT (probably the Main Controls screen CLUT), so bear this in mind when choosing a color scheme. (See the PICT Notes section for more information on working with PICT graphics.)

 

SIZE
This is where memory allocation settings for Marathon Infinity are stored. ID#-1 contains the default allocations that Marathon Infinity ships with; the #0 and #1 entries only appear if you've altered the allocation via the Finder in the Get Info box. You probably won't want to include this resource in any patch you might distribute ­ unless your project actually requires more memory than the standard Marathon Infinity to run (e.g. if it contains a _lot_ of textures, etc). If that's the case, in ID#-1 alter the Size and Minimum Size values (calculated in bytes) to suit, but don't include the #0 and #1 resources in your patch (you'll probably want to delete these after you've permanently modified the default memory allocation anyway) as it's impolite to inflict your own preferred memory allocations onto end-users (who may not appreciate an application that's set to use 30Mb because you like to play in Millions of colors when they install it on their 12Mb system ­ you should read the Marathon Infinity manual if you don't already know why that sort of thing's a bad idea).

 

STR#
Lots of good stuff in here (as well as a few antique leftovers from Marathon 1:):

ID#129 - filenames of Marathon Infinity's various support files, preferences file, recorded film (Marathon Infinity stores a film of the last-played game in the System Folder's Preferences folder; this is what gets played when you select 'Replay Last Game'). Note that the Shapes.16 and Sounds.16 entries don't work (presumably these are leftovers from a feature that didn't make it into the final release).

If you're releasing a scenario that uses modified copies of the original Shapes, Sounds and Marathon application, rather than a simple map add-on which will happily sit in the end-user's Marathon Infinity folder and work with the default support files, then I'd _strongly_ recommend that you assign unique Preferences and Recording names (e.g. "<your scenario's name> Preferences"). This will avoid any Marathon Infinity screw-ups which tend to occur when you have more than one copy of Marathon Infinity on your Hard Drive, each in different folders and using unique support files in those folders ­ if such applications have a common Preferences then one version of Marathon Infinity can end up using another's support files, as the paths to those files seem to be stored in the Preferences (along with the filenames themselves). This sort of behavior can have lots of nasty side-effects, from maps appearing in somebody else's texture sets, to hard crashes (when the Shapes file being used by accident doesn't contain all the collections/sequences of the one that should have been).

The 'Movie' filename is for a feature that presumably was cut at some point from Marathon Infinity itself - the ability to play a QuickTime movie as a cut scene intro to the first level when the player hits 'Begin New Game'. This feature is entirely functional (and has been used by scenarios such as Evil to provide a simple intro movie), though I have to say it would have been of much more usefulness had the cut scene movie been made to play at the _end_ of a scenario, not at the start. Personally, I think that this feature is vastly overrated by some folks, given its restricted use [it makes little sense to me to have the glitziest cut scene at the start of a map and not at the end], and adding a QT movie to a scenario can easily bloat the package's size dreadfully when it comes to distributing it, without actually adding to the game play itself in any way. I firmly believe that the effort required to create a good-quality cut scene movie would be _much_ better spent on making a kick-ass scenario, rather than indulging in such irrelevant novelties. Nuff said.

ID#135 ­ This contains the text that appears in the top and bottom terminal status lines. You will very probably want to modify/remove this if you are working on a non-Marathon project. Note that the last entry ('%H%M %m.%d.%Y') is the 'date/time clock' reading that appears whenever you read terms and appears to change over time. In fact, all it really does is advance a bit whenever you logon to a terminal; you can replace this string with regular text if you like.

ID#137 ­ These are the weapon name strings that appear for the currently-used weapon as displayed in the HUD. If you change weapon types then you'll probably want to change the names to do with them.

ID#150 ­ These are the weapons, ammo and retrievable items [S'pht key card and insertion chip] names that appear in the HUD's inventory. Again, you'll want to modify this string if you change any weapons/ammo/items in your project.

BTW, you'll find that these strings are referred to in the internal Items table which you can access via Fux (though you're very unlikely to need to mess with these unless doing some pretty unusual mods).

ID#151 ­ These are the names that appear in the HUD for each section of the inventory (though it's probably unlikely you'll want to change these).

Fux Stuff

Fux StuffFux allows you to modify various internal tables in the Marathon Infinity application - these are lists of various preset values determining the behavior for some Marathon Infinity features, and thanks to Fux these can now be easily altered. Some tables are of more practical use than others; I've included a complete list of them here but you should refer to Fux's Readme for more specific details. Some of these are definitely worth exploring if you're doing scenario work, especially where you want to modify various types of behaviors to make things a bit different.

Ambient sounds
Pretty useless really, since you can't add extra entries to this table (to add extra ambient sounds). If you do wish to add extra ambient sounds to your project, seek out Mike Trinder's Ambience plugin for Chisel - this nifty tool allows you to set up an extra table in an unused portion of the Platforms table to hold additional Ambient sound references. Note, however, that this is not something for the faint of heart to attempt ­ the rewards are obvious, but the procedure is quite advanced and less than straightforward.

Color shifts
Nothing more I can add beyond the Fux Readme.

Control panels
Lots of potential here for more advanced projects, for example:
You could add new types of insertion switches that use different types of items to activate them (an insertion switch is any type of switch that consumes an item; note that these are strictly _one-shot_ switches, BTW).
You could change the texture used by a particular switch (e.g. you could have platform and light switches use one texture, and wires and insertion switches use another - a much like Marathon 1 had two types of textures; one for lights/platforms and another for repair/insertion). You could even move some switches to work in different texture set, although since there is no easy way of modifying Forge's internal CP table then you'll find it pretty hard to work on maps using such a modification.
You could change the sounds made by a switch when activated/deactivated/inoperable.

I wouldn't recommend trying to change platform switches to tag or light switches, etc. although it's straightforward enough to change between types of Tag switches. I've changed the Water set's Oxygen Recharger to a 3x Shield Recharger without any trouble though (bearing in mind that this was for a project without and O2-draining media in set 1).

Damage Types
You very probably should leave Damage Types well alone.

  • The Push Value. I've never had any luck changing the Push value (if anyone else has, let me know).
  • The Hit sound (the value is directly related to the sound's Class in the Sounds file) is only used for Absorption (played when being hit whilst invulnerable, or [I think] colliding with another player/monster when teleporting onto the same spot).
  • The Death sound is the sound made by the player at the moment of death (the splat sound they make when they hit the ground is determined in the dying sequences of the Marine collection in the Shapes file). Death? does seem to relate somehow to the type of death sequence used (-1 = soft, 6 = hard, 7 = suffocation, 8 = flaming) by a player/monster when dying. I'm unable to expand on that any further though.

Environments
You might possibly want to make use of the unused 'extra collection' field if you were working on something rather advanced where you wanted to load more than one texture set and one scenery set into Marathon Infinity. However, unless you can hack the same changes into Forge manually, you're unlikely to get much practical use out of such a modification (Mike Trinder's Merge plugin for Chisel could let you work around this problem, although you'd effectively need to work blind on a specially built merged map ­ note that the project Mike designed this effect specifically for never made it to completion though <hint>).

File Types
(see Custom Icons and Unique Creator Code section)

Infravision colors
Pretty self-explanatory.

Items
This should be pretty obvious and, like the Control panels table, may be of good use to folks doing more advanced work. Note that although it should be possible to alter the various extra ball items to function as other types of items, there may well be issues that will arise out of such a change (such as the inability to directly place such items via Forge, plus the fact that Ball behavior is partly hard-coded into the engine itself).

Map lines, Map polygons, Map text (see also Miscellaneous below)
Not much I can add here except to remind you that when playing in 256 colors, the colors picked here will be remapped to their closest equivalent in the Marathon Infinity standard CLUT (so you'd be wise to pick colors from that CLUT to get predictable results).

Media, Media colors
This is well explained in the Fux Readme and will very likely be of good use in more advanced projects.
Note that the 'Ambient above' and 'Ambient below' values relate directly to the Sounds file Classes, though you need to add 91 to this value to get the actual Class as defined in SE (which starts counting Classes from '1', rather than the more common '0').

The detonation/emergence Effects fields refer directly to the Effects entries in the PM (which are counted, sensibly, from '0', BTW).

Miscellaneous
The Sound slots field is of use if you change the number of sound classes in the Sounds file (this is only something very advanced scenario-makers are ever likely to attempt).

Network names
Possibly worth bearing in mind if working on a Partial/Total Conversion with net play support.

Physics
Allows you to import/export the contents of the Marathon Infinity engine's internal PM settings. Worth making use of if you have a default PM for your project that is different from Marathon Infinity's default PM to the point where your project will crash if it uses the Marathon Infinity PM by accident.

Platform
This is useful in advanced projects, not least because it allows you to alter platform behavior extensively. Note, for example, that there are 9 platform types, although Marathon Infinity only really takes advantage of 7 of those - you could modify platforms 1 and 2 ('S'pht Door Split' and 'S'pht Door Locked') to have their own unique sounds (giving you 9 distinctive door types to choose from in Forge ­ see the notes on the Sounds file on how you can fit more sounds into the existing Sounds file, BTW).
The Defaults (unused) fields are exactly that in Marathon Infinity: unused (unless you decide to make use of Mike Trinder's 'Ambience' plugin for Chisel). In Forge, these values (or some of them) are used for the Predefined settings for the various platform types (a feature that most folks find more annoying than useful, I suspect - tip: hold down Command when selecting from the platform type menu in Forge to preserve your custom settings).
As with Media's Ambient sounds, you'll need to add 91 to the Ambient value to work out what sound the platform uses as its in-motion sound.

Predefined controls

You might find this useful, but unless you've got a good reason for altering these settings I'd suggest leaving them as they are; most Marathoners will be well familiar with them already.

Random sounds
As with the Ambient sounds table, this one is of little practical use.

Scenery objects
The practical issues about altering collections used by scenery items are much the same as for Control panels (i.e. without the same ability in Forge, mapmaking life will be hell) - a pity, since I'm sure the ability to move scenery items elsewhere (e.g. into a single huge scenery collection so that all items could be used in any texture set) would be very nice for some.

On a more practical note, this is chock-full of useful stuff as regards scenery behavior, and very useful for putting that competent finish to modifications. Well worth exploring.

The 'Animated' flag is ignored, BTW. The Fux Readme is quite correct in its assumptions.
Hit effect refers directly to the Effects section of the PM. If you make an object breakable, it's very important you set this correctly - it's very easy to have it point to an effect that uses a shapes sequence from a collection that isn't loaded. e.g. Don't use a breaking lamp effect from scenery set 5 for the lamps in set 4 if you decide to make them breakable; Marathon Infinity will simply crash. If you want to do this sort of thing, I'd suggest creating a single 'breaking lamp' sequence in the Explosions or Items collection, and point a single Effect to that. Then point all the Hit effect fields for all the breaking lamps to that one Effect. (Note that this method also frees up 3 Effects in the PM for other use - I've had lots of fun and complete success with this, and I've managed to add a few different sorts of breakables using those spare Effects too.<g>)

Weapon order
The only advantage in modifying this would be if you wished to move the positions of the two-fisted weapons to a higher/lower position. e.g. If you wanted to add 2-fisted Sags that look and work correctly in the HUD and in the net player Marine shapes by using the shotgun's PM slot to support these instead, then you might want to regauge this table so that the modified shotgun (now dual Sags:) are returned to their original place in the weapons order. (I have done a similar sort of thing previously, only with the flamethrower so I could have dual versions of that instead. >;)

Weapons
The last Fux field, and one that's very useful to folks wanting to modify weapons' behaviors and have the HUD readouts display correctly for these weapons. This contains all the settings that define the layout of the weapon-in-use display in the HUD - the size/shape/no of increments of ammo bars and the position of the weapon picture and/or name (if any).

Note that if you need to add extra ammo bar graphics to the HUD then this is entirely possible; you'll need to paste the extra graphics into the Interface collection, and then do the Sequences trick that you also use for adding extra textures to ensure that the additional bitmaps are loaded by Marathon Infinity.

 

Other stuff

There's not many other things you can do to the Marathon Infinity application, apart from try to disassemble it and hack modifications directly into it (something only for really good programmer/hackers to try, and generally illegal under the terms of the software license!). In theory, you could do one or two other things, such as alter what weapons/ammo/shield power are initially present when you start a new game (although this is much easier to do by adding said items to the map and kludging it there). The 'Marathon Universal Patcher' utility might be worth checking out though if you're trying to do something a bit different (allows addition of a 'Save Anywhere' function, should you wish to dispense with Marathon Infinity's Pattern Buffer system, for example - note that if you use the Pause function as the 'Save' key, you can then change the keyboard shortcut used for this by altering MENU resource ID#128 to suit [it's a neat trick, even if you do lose the Pause function]).

Last word on application mods

Well, if it's not listed here as being supported, I think it's safe to say that it can't realistically be done - not without that Holy Grail of source code, anyway...

Finally, one very important reminder; even if you've totally replaced the entire contents of Shapes, Sounds, Images and Map files to the point where you can distribute those complete, it is quite definitely illegal to distribute a complete copy of the Marathon Infinity engine, even in modified form, unless you have explicit permission from the authors (Bungie) to do so. Please do remember this when distributing engine mods, and use a patcher for the job - it's better to be safe than sorry, you know.



Anvil Tips | HAS Tutorials | Edit Notes | Sounds & Music | Images File | Tools | Nonstandard Colors | Control Modifications | HUD Modifications | Prefs Modifications | PICT Notes | Engine Hacking | Documentation | Bandwidth Saving | Unused Sounds | Hakvil | Shapes 1 | Shapes 2 | Color Clippings | Custom Icons | Clut Notes

Top of page

Back to the Litterbox