|
INI Editing in Final Alert2
by Cannis Rabidus
Introduction:
Many consider maps and mods (modifications) to be two separate things. However, some mods can be included within a map. In fact most of the standard single-player missions include mods of some sort. Within reason, mods can be added to multiplayer/skirmish maps as well, and Final Alert offers an INI editing interface to allow mods and other changes to be added to the map. INI editing can be found on the EDIT menu. You can even change lighting, map settings, and adjust your triggers through the INI editing interface if your really wanted to for some reason - FA's INI editing is a nice backdoor into the workings of your map, but it can get you into trouble, so be careful! Screwy mods can result in units acting oddly, or even cause the dreaded "Internal Error" crash. Back up your map before doing any changes, so you can revert to a known good version if all else fails.
Background:
When Red Alert2 starts up, a number of .INI (initialization files) are read. They determine everything from what game options are offered to what units can attack what targets, by calling functions included in RA2.EXE. By the time you've gotten to the point where you can load a map, how the game will play has been fully defined. Many of these properties cannot be changed at this point, but the properties defined in RULES.INI can be changed, and they can be changed in the map itself.
We're talking about maps here, and not mods... if you were making a mod, you'd be using a replacement RULES.INI, and that file would have to define everything the standard RULES.INI does. But for RULES.INI changes/additions in a map, there's no need to define everything, since the game has already read RULES.INI. All that is necessary for map mods is to redefine already-defined parameters, or add new parameters which were not present in RULES.INI. Unchanged aspects of RULES.INI will stand, and they don't need to be redefined in the map (nor should they be - more on this later).
Note: It's highly recommended that if you're looking to do INI changes, that you get XCC Mixer, so you can extract the game's INI files for reference purposes. Remember that Westwood continually tweaks the play balance with every patch, so after every patch you should re-extract the INI files.
The structure within the INI files is to label a section (i.e., [General]), and then list keys beneath that section label. Each key is then given a value. The section ends when a new section begins. Open any RA2 INI file with a
text editor (Wordpad will do) to read them. Westwood included copious commented documentation within the INI files themselves to explain what does what.
Editing existing sections using the INI editor:
Alright, let's explore a simple map INI change to an existing section: Adjusting
Ground and IonGround map lighting (Ground/IonGround are not accessible through FA's "Lighting" editor). With your map open in the editor, click "INI editing" on the Edit menu. In the window that results, use the "Sections" drop-down to highlight Lighting. A number of keys will appear in the "Section Content" area. Highlight Ground, and a value will appear in the "Value" field. Make any adjustments you wish to this value, then highlight IonGround and repeat. When done, close the INI editing window. (For recommendations for Ground/IonGround values, see the
Map Lighting tutorial.
Adding a new section using the INI
editor:
Now let's try something a little more complicated - adding a new section. For this example, let's assume your map has no water in it at all, or it has small bodies of water that no one in their right mind would ever build a shipyard in. What such maps need is to have the
shipyard building option disabled. This is so the building list is uncluttered by a useless icon, and so the skirmish AI doesn't vainly build a shipyard and vessels in a little pond. With your map open in the editor, open the INI editing window. Under the
"Section" drop-down, click the Add button. An Insert Section dialog will open. Type in NAYARD (section name for the Soviet Shipyard), and click OK.
Now find your new NAYARD section in the drop-down list, and highlight it. Notice there are no keys - you have to add them. With NAYARD selected, click the Add button under "Section Content". A "Create key" dialog will open. Type in
TechLevel (everything you type is case-sensitive, so type it exactly like this), and click OK. Now in the "Section Content" area, highlight your new
TechLevel key, and in the "Value" field, enter -1. When a unit or structure has a TechLevel of -1, it is not buildable, so the option to build the shipyard will not be available to the Soviet player.
If you were to save your map at this point, and open the map in a text editor, you would see:
[NAYARD]
TechLevel=-1
Repeat the above for GAYARD (the Allied Shipyard). Simple, eh? Attention to details like this is the kind of thing that lets your map avoid problems that can spoil the gameplay experience for the user.
Adding Mods - Yes or No?
Perhaps you want to add something different to your map, to give it some sort of novelty. For example, you could make Navy SEALs trainable or allow both Allies and Soviets to train Spies. Or maybe you feel that some setting needs to be adjusted for your particular map, so as to restore balance that is lost due to some factor in your map design. One example might be to make a map with few resources use Oil Derricks that produce much more income than normal. Such mods are fine as long as they're not overdone... however what's overdone and what's not is up to you, after all you're the God of your world that you're creating.
You could also make units stronger, faster, etc. These new settings will override whatever RULES.INI says they should be, and this includes the RULES.INI used by a mod. So such map mods work just fine in conjunction with other mods. However, such changes should be made only after careful thought, since you risk disrupting gameplay balance.
New units, structures, weapon types, etc could be added as well. While such mods may well work, there are significant problems with this. The least problem has to do with the sidebar icons, UI strings, and the like... in a map, you can only change what's specified in RULES.INI, not in ART.INI or RA2.CSF. Worse, since everything that appears in the game is defined on numerically organized lists, adding something new requires adding to these lists. This will interfere with the lists in modded RULES.INI files, which means that your map will not play properly under a mod, and may even crash the game. Worse, such maps will be rendered obsolete by any expansion packs that Westwood releases.
In any event, be sure to test any modifications you make rigorously in the game to be sure they work right and the map runs stably. If you're adding extensive modifications to your map, you might find it easier and faster to add them using a text editor rather than through Final Alert. This can be done with no problems in multiplayer maps as long as you're editing the .MPR file version, and you save changes as an unformatted text file. <B>Don't</B> edit .MMX file versions directly. Edit the .MPR version instead, and use Final Alert to convert the .MPR to an .MMX file.
What NOT to change using the INI
editor:
It's not a good idea to edit sections like Infantry, Structures, or anything else that is a list of like items that are placed about the map. Deleting or reordering these lists shouldn't cause any real problems, but the map may take a godawful time to load. Also, some sections simply shouldn't be touched, like IsoMapPack5 - use the editor to edit the map, not the INI editor.
For questions
concerning this tutorial, please email
Cannis Rabidus.
|