Genie Editing Guide by Mace

Introduction

Ok, you've learned how to mod. Graphics,sounds,icons,unit names. All of those are good for modding, but what if you could go deeper? Change unit statistics? Make your own unit? Edit a technology? These and more have been sought by many modders. The answer is finally here. With lots of work, and alot of help from Ykkrosh, genie editing has been unveiled. This guide will tell you how to edit unit stats and more.

DISCLAIMER: Make sure to follow this guide EXACTLY. Not doing so could cause horrible game errors or even mess up your computer. I take no responsibility whatsoever for any damage done to your game or computer system resulting from not following this guide.

The GeniEd

Before we get started with the actual editing, you will need a special software that will allow you to edit the Genie.dat. This software, called the GeniEd, was made by Ykkrosh, the same guy who created the ModEditor, ModInstaller,and DRSViewer. Download the GeniEd HERE

Getting Started

Ok, you know what the Genie.dat is,you've got the GeniEd, and you understand the complications involved with Genie editing (if not go back and read the Introduction). Now its time to start. First of all,we need to take proper precautions to avoid problems. That means backing up the Genie.dat (and the Genie_x1.dat for CC users). Also, remember that if you edit the genie.dat and run Clone Campaigns, it wont work. thats when you edit the genie_x1.dat. But for those without CC,youll be fine. CC users whenever I say genie.dat, imagine it as genie_x1.dat instead. Before we get started, you should know that there are five steps to making changes in the game:

  1. Decompressing the data
  2. Reading the data
  3. Converting the data
  4. Editing the data
  5. Compiling the data

Decompressing the Genie

After you've backed up the data files, open the GeniEd.exe by double-clicking on it. The selection arrow will be on "Help" by default, but dont bother going there as Ykkrosh never made a help document. Use the down arrow to choose the "Edit Settings". Press enter and youll see "SWGB Location","Data Range", and "Back". The SWGB location is by default set to "C:\Program Files\Lucasarts\Star Wars Galactic Battlegrounds\Game\Data". If your data folder is not at that location, change the location so it will have your location. The "Data Range" is under that but dont mess with that. Under the "Edit Settings" option youll see the "Decompress Genie" option. Once you have the selection arrow next to it, press enter. Youll see this:

Decompressing the genie

If it says genie_x1.dat instead of genie.dat dont worry. Just use backspace to delete that and type in "genie.dat" (we'll use the genie.dat for the tutorial. CC users substitute every genie.dat in this guide to genie_x1). Once it says "genie.dat", press enter and it will print "Opening genie.dat","Decompressing", "Saving to disk",and then "Decompression complete (press any key to return)". Press enter,or any key, and it will bring you back to the main menu. Congratulations. You have just decompressed the Genie.dat.

Reading The Data

Ok, you've just decompressed the genie.dat. Now what? In order to be able to convert the Genie, GeniEd must first read the data fram the genie.dat. select the "Read Data" option and press enter. You should start seeing something like this:

Reading the data

This will take a while, as the genie is so extensive. Use this time to get a drink.

Converting The Genie To Text

Make sure that the GeniEd has finished reading the data before you start this section.

Now that the GeniEd has read the data, it knows what the genie contains. But how does that help you? you cant read the GeniEd's mind. The solution of writing it down comes to mind. Thats exactly what GeniEd is programmed to do. Select "Convert data to text" and press enter. You should start to see something like this:

Converting the genie

That wont take too long, but it all depends on the computer. Once that is finished, you'll notice a new folder in your game\data folder called "ged_data". Open it and youll see a sub folder called "text". Open that and you'll see alot of text files with names such as "civ1head","civ2units", "graphics_header",and "pcolours".

NOTE:Under "Convert data to text" there is "Open text file folder" and "Edit patches.txt" options. Don't bother with them. They dont work.

Editing the Genie

Now that you have the genie in a text format, its time to learn how to use that text to edit the Genie. Open the "civ1head.txt". You should see this:

civ1head.jpg

Looks intimidating doesn't it? Ignore the fact that its big and has lots of numbers. You'll also see that "civ1" refers to the Empire. Exit the civ1head and open the "civ1units.txt". As you scroll down youll see many numbers, function lines, and alot of UNKNOWNs. You wont be editing these unknowns because their... well... unknown. At the top of the civ1units.txt, you should see this:

# DO NOT alter this file -- always make changes to the patches file instead!
civ_1_unit_2_type: 70
civ_1_unit_2_name1_length: 12
civ_1_unit_2_id: 2
civ_1_unit_2_language: 5853
civ_1_unit_2_unknown01: c5 1a 39 00
civ_1_unit_2_graphic_default: 5811
civ_1_unit_2_minus1_01: -1
civ_1_unit_2_graphic_die: 5814
civ_1_unit_2_minus1_02: -1
civ_1_unit_2_zero_01: 0
civ_1_unit_2_hitpoints: 150
civ_1_unit_2_lineofsight: 7
civ_1_unit_2_garrison: 0
civ_1_unit_2_unknown02_03: 0.5 0.5 2
civ_1_unit_2_sounds01: 733 -1
civ_1_unit_2_deadunit: 3
civ_1_unit_2_unknown02_05: 5

The unit all of these stats are referring to is the Fambaa Shield Generator. How do I know? Theres a special way of knowing which unit is which. Notice this line:

civ_1_unit_2_language: 5853

You're probably asking "whats that got to do with anything?" Well, its got everything to do with identifying units/buildings. The number refers to what line in the language.dll to use. For example, lets say I run across this in the civ1units.txt:

civ_1_unit_773_type: 70
civ_1_unit_773_name1_length: 11
civ_1_unit_773_id: 773
civ_1_unit_773_language: 5831
civ_1_unit_773_unknown01: af 1a 30 00
civ_1_unit_773_graphic_default: 5548
civ_1_unit_773_minus1_01: -1
civ_1_unit_773_graphic_die: 10505

You're now asking yourself this: "Out of all the units in the game, how am I going to know which one this is?" Well, heres where Resource Hacker, that handy little program that you edit the Language.dll with, comes in even more handy. Open Resource Hacker and open the language.dll. Look for the number were looking at, which is 5831. You should see this when you find it:

Language.dll entry 5831

As you can see, the unit stats were looking at belong to the Tie Fighter. So this would be every data property of the Galactic Empire's fighter:

civ_1_unit_773_type: 70
civ_1_unit_773_name1_length: 11
civ_1_unit_773_id: 773
civ_1_unit_773_language: 5831
civ_1_unit_773_unknown01: af 1a 30 00
civ_1_unit_773_graphic_default: 5548
civ_1_unit_773_minus1_01: -1
civ_1_unit_773_graphic_die: 10505
civ_1_unit_773_minus1_02: -1
civ_1_unit_773_zero_01: 0
civ_1_unit_773_hitpoints: 30
civ_1_unit_773_lineofsight: 6
civ_1_unit_773_garrison: 0
civ_1_unit_773_unknown02_03: 0.5 0.5 4
civ_1_unit_773_sounds01: 430 -1
civ_1_unit_773_deadunit: -1
civ_1_unit_773_unknown02_05: 261
civ_1_unit_773_icon: 49
civ_1_unit_773_notineditor: 0
civ_1_unit_773_unknown02_07: -1 0 -1 -1 -1 -1
civ_1_unit_773_unknown02_08: 0.5 0.5
civ_1_unit_773_unknown02_09_01: 0
civ_1_unit_773_unknown02_09_02: 0
civ_1_unit_773_unknown02_09_03: 23
civ_1_unit_773_unknown02_09_04: 1
civ_1_unit_773_unknown02_09_05: 0
civ_1_unit_773_unknown02_10: 10
civ_1_unit_773_unknown02_11: 00 04 04 0a 04
civ_1_unit_773_unknown02_12: 1
civ_1_unit_773_unknown02_13: 00 67 9d 01 00 b7 60 02 00 bf 41 00 00 00 00 00
00 01 05 02 00 01 00 00 00 00
civ_1_unit_773_unknown02_14: 0.5 0.5 4
civ_1_unit_773_unknown02_15: 4
civ_1_unit_773_unknown02_16: -1
civ_1_unit_773_unknown02_17: 02 0b 00
civ_1_unit_773_unknown02_18: 1
civ_1_unit_773_unknown02_19: 02 ff ff 00 00 00 00 00
civ_1_unit_773_length01: 0
civ_1_unit_773_unknown04:
civ_1_unit_773_sounds02: 75 -1 0
civ_1_unit_773_name1: UNIT-AFGTE
civ_1_unit_773_name2_length: 14
civ_1_unit_773_name2: UNIT-FIGHTER1
civ_1_unit_773_unitline_id: 29
civ_1_unit_773_mintechlevel: 1
civ_1_unit_773_id2: 773
civ_1_unit_773_id3: 773
civ_1_unit_773_speed: 2.1
civ_1_unit_773_graphic_walk: 5551
civ_1_unit_773_unknown19_01: -1
civ_1_unit_773_unknown19_02: 0
civ_1_unit_773_unknown19_03: 0
civ_1_unit_773_unknown19_04: -1
civ_1_unit_773_unknown19_05: 0
civ_1_unit_773_unknown19_06: 0 0
civ_1_unit_773_unknown19_07: 0 -1 -1 127 127 -1 -1 127 127
civ_1_unit_773_unknown19_08: 0
civ_1_unit_773_unknown19_09: -1 -1 127 127
civ_1_unit_773_unknown20: -1
civ_1_unit_773_unknown21: 6 1
civ_1_unit_773_unknown22: -1 -1 -1 -1 0
civ_1_unit_773_sound_move: 73
civ_1_unit_773_sound_stop: 431
civ_1_unit_773_unknown24: 0
civ_1_unit_773_unknown25: 1000
civ_1_unit_773_attack_numtypes: 12
civ_1_unit_773_attack_data: 0 15 23 0 30 3 2 1 5 2 3 4 17 2 9 6 10 6 14 10 15 2 19 5
civ_1_unit_773_armour_numtypes: 3
civ_1_unit_773_armour_data: 0 0 4 0 3 0
civ_1_unit_773_unknown28: -1
civ_1_unit_773_unknown32_01: 3 0
civ_1_unit_773_attack_reload01: 2
civ_1_unit_773_projectile: 1422
civ_1_unit_773_unknown32_02: 40
civ_1_unit_773_unknown32_03: 0 0 0
civ_1_unit_773_unknown32_04: 0 0.3 2.7
civ_1_unit_773_unknown32_05: 0
civ_1_unit_773_unknown32_06: 0 0
civ_1_unit_773_graphic_attack: 5551
civ_1_unit_773_armour_displayed: 0
civ_1_unit_773_attack_displayed: 4
civ_1_unit_773_attack_range_displayed: 3
civ_1_unit_773_attack_reload02: 2
civ_1_unit_773_cost_01_type: 0
civ_1_unit_773_cost_01_amount: 50
civ_1_unit_773_cost_01_unknown: 1
civ_1_unit_773_cost_02_type: 3
civ_1_unit_773_cost_02_amount: 60
civ_1_unit_773_cost_02_unknown: 1
civ_1_unit_773_unknown35_04: 4 1 0
civ_1_unit_773_cost_time: 40
civ_1_unit_773_unknown35_05: 317 1 0 0 0
civ_1_unit_773_unknown35_06: 0
civ_1_unit_773_unknown35_07: 2 -1 -1
civ_1_unit_773_unknown35_08: 1
civ_1_unit_773_unknown35_09: 1
civ_1_unit_773_unknown35_10: 1 1 1
civ_1_unit_773_unknown35_11: -1 -1
civ_1_unit_773_unknown35_12: 0
civ_1_unit_773_duraarmour_displayed: 0

As said before, intimidating huh? Not to worry though. Im going to tell you what (most) everything means so you can edit without fear of messing up something you shouldn't. Now first of all, you don't, I repeat DON'T, want to edit the UNKNOWNs. Their unknown, so no one knows what they are, not even Ykkrosh. Now to business. What were going to edit, as an example, will be this:

civ_1_unit_773_hitpoints: 30

Editing this will of course, change the fighters hit points. Now, following the directions on that first line of the text file:

# DO NOT alter this file -- always make changes to the patches file instead!

We are going to not edit the text file were in now. Highlight the "civ_1_unit_773_hitpoints: 30" line, right click and press "Copy".

The Patches.txt

Now, exit out of the civ1units.txt and go back to the ged_data folder located in your game\data directory. Youll see a txt file named "patches". Open this up and you should see this:

# See GeniEd's Help section for information on how to use this file

Now, because Ykkrosh never made any documentation, you can't go to the help section. Thats why this guide is here. Go to the line under the comment and paste "civ_1_unit_773_hitpoints: 30" in there. So now you should see this:

# See GeniEd's Help section for information on how to use this file
civ_1_unit_773_hitpoints: 30

Edit the 30 so it will say "40" instead. Now, save the file,and exit it. Congratulations, youve just made your very first change to the genie.dat.

Compiling A New Genie

You've edited the hit point value of the Empire's fighter. Great. Now what? How do I get the changes to be in-game? Thats where GeniEd comes in again. Open GeniEd and select "Create new genie file". Press enter and you should see this:

Creating a new genie

Wait for GeniEd to finish. Once its done, go to the ged_data folder, and you should see a .dat file called "newgenie" inside. Rename the new genie to "fighterhpchange". I know, its a stupid name,but it serves our purpose. Now, you still have yet to get the changes to work in-game. This is where the trusty Mod Editor comes in. Open the Editor and create a new .mpr file. Name it "fighter change". Now, as with all mods, you must have a readme. Add a readme file into the mpr. After that, click "Add New" again. Go to the ged_data folder. Select the fighterhpchange.dat and add it in. In the box where you choose what you want it to replace (genie.dat,genie_x1.dat, graphics,etc), if it says "Genie_x1.dat", change it to "Genie.dat". For those of you who use CC, dont bother. If you've done everything as I have said, you should have been editing the genie_x1.dat anyway. Now, as with all mods, compile it into an MPI. Name it "Fighter HP Change".

Now, once it is an MPI, open the Mod Installer, and install Fighter HP Change. Now when you run the game, instead of having 30 HP, the Imperial fighter will have 40. Congratulations. You have just completed the GeniEd course and are now certified to edit the Genie[_x1].dat.



Contact the author, Mace at Mace__@msn.com.