Here is a complete nuts and bolts guide to modding Star Trek The Next Generation: Birth of the Federation (BotF):
1. THE TOOLS OF THE TRADE:
There are two vital programs for editing BotF:
1. Ultimate Editor (UE)
2. Hex Editor
1.1 THE ULTIMATE EDITOR (UE)
The latest version of UE is avaliable here:-
https://www.armadafleetcommand.com/get-f ... file_id=71
Infomation on installing and running UE is here
1.2 THE HEX EDITOR
The hex (short for hexadecimal) editor I use, recommended to me by Gowron, is Hex Editor Nero and it is free and from hhdsoftware.com here:-
http://www.hhdsoftware.com/Download/fre ... or-neo.exe
2. WHAT IS IT ALL ABOUT?
2.1 WHY IS BOTF HARD TO MOD?
Unlike most games where many moddifications require a drag and drop approach or highly use-friendly interfaces allow customisation of the game (Civilisation 4 comes to mind) BotF was never designed to be altered by the user when it was released in 1999 customisation and modding wern't seen as importand or disirable by the games developers.
Modding BotF is a much more root and branches affair, the coding has to be done in the simplist language a computer understands - Machine Code. (If you learnt computer programming in the late 1970's early 1980's then you may have come across this before!) I am not going to go into depth about this subject however every time you see on this forum a block of number to be edited into Trek.exe this is in effect what you being asked to do. The danger of this kind of editing is mis-typing since each number represents in hexadecimal either a operation or a number and it is the operation that determine how a hexadecimal number is read by the computer processor.
2.2 WHAT IS HEXADECIMAL?
Hexadecimal is a number system with digits 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E and, F where A to F represent the decimal numbers 10 to 15
eg. 1F is 1*16 + F(15) = 31 decimal, F6 is F(15)*16 + 6 = 246 decimal
there is a reason for using a unusual number system since computer processors undersand binary i.e. only 0's and 1's; and strings of binary are hard to understand 01010100 = 84 decimal (54 hex). Where as with one hex digit we represent 4 bits and with a double digit hex number we represent 8 bits.
2.3 WHAT CAN I DO WITH UE?
As the name suggests UE is the Ultimate Editor it was created by DCER and brought together a number of editors and has been added to and expanded
and now can edit many aspects of the game these include:
2.3.1 UE & TREK.EXE
AI Ship building Stats
Ship Building and Upgrading
Ship Map Ranges
2.3.2 UE & STBOF.RES
AI Buliding Requirements
Major Empire Tolerance
Minor Race Attributes
Group Edit of Building Stats
Maximum Planet Populations
Add/Remove Ship Models
List of Modified Files
Group Edit of Ship Stats
18.104.22.168 STARTING CONDITIONS
Major Empire Home Systems
2.3.3 UE & .SAV
Galactic Map v2 (early preview)
List of Built Structures
2.3.4 UE & .SND
List of Modified Files
Switch Race Voices
2.3.5 UE TOOLS
Convert image to 16bit tga
Supervise a multiplayer game
2.4 WHY DO I NEED A HEX EDITOR?
While UE is increadably brilliant and for most people will do what they want many of the more subtle bug fixes and moddifications aren't avaliable through UE (although the ability to build minor ships in membered minors is an exception to this!)
Hex editing is used for two types of modification.
1. Changing programming.
2. Changing values
2.4.1 CHANGING PROGRAMMING
This is the most complicated and frustrating (IMHO) type of modding and ultimately really requires disasembly understanding, However this more of the Codemasters domain so I won't go into it myself here. But for an excellent example of this type of modding is found here:
viewtopic.php?name=Forums&file=viewtopi ... ght=#17544
2.4.2 CHANGING VALUES
The two examples are both obsolete as UE now does this for you however it is a good example of how just changing values can open up some new possibilities:-
2.4.3 CHANGING BOTH VALUES AND PROGRAMMING
In truth most major improvements to BotF will require a combination of the above. Therefore, getting to a point where you feel comfortable to make these changes will pay dividends.
3 Making SCT change:
SCT has used an ASM address these usuall start with either a 4 or 5 and are always a hexadecimal address refering to trek.exe. To convert this open UE and goto TOOLS -> OTHER -> CONVERT ADDRESS copy & paste or write this number into the box labeled 'Botf Assembler offset' and click the 'convert' button next to it, the other boxes should now have numbers in them:Well, I felt it was time to finish this task, thus...
The AI Map Scan Matrix Reloaded
Code:This has to be equal to the large map horizontal edge (i.e. the largest edge of the exe).
Code: Select all
41D04F mov ecx, 19h // max distance in sectors to check ?
Therewith, hopefully, AI should expand and behave as usual on enlarged maps.
Close to this, there is also a float with the same value, but I don't think it correlates with map size, but is rather a ratio value (i.e. don't change this for now):
Code: Select all
41D05A push 40390000h (first part of 8 byte float 25.0)
so 41D04F -> 0x1c44f -> 115791
Now open trek.exe in your hex editor:
if your using Nero then Ctrl-G will bring up the goto offset dialogue box -- copy and paste the hexadecimal address from UE into the goto offset box
you should have highlighted the first byte of the following:
B9 19 00 00 00
(B9 will probably be on the end of the line)
B9 is the operation mov ecx, followed by the 4byte hexadecimal value 19 00 00 00 this number is read in in a format called little endian so the right most pair of hexadecimal digits are the 'sixteens&units' and the left most is '2^17ths&2^16ths' so 19 00 00 00 is read as 00000019 or just 19 = 16+9 = 25
to increase this take the horizontal map value found in UE load trek.exe EDIT -> GAME -> GALAXY GENERATION find under 'Map size', the value in the 3x2-table at 'Large' & 'Width' vanilla is 25 UMD is 39 IIRC
eg using 39 in UE select TOOLS -> OTHER -> CALCULATOR and enter 39 in the 'decimal box'
select 'Type:' tick box 'integer (4 byte)'
select 'Endian:' tick box 'little endian'
click 'convert' next to decimal
the Hexadecimal value, 27 00 00 00, appears in the 'Hex:' box.
now in your hex editor replace 19 00 00 00 with 27 00 00 00 in effect you can just replace 19 with 27 in this example as the 00's don't change.
save you new trek.exe and your done.
Hope this helps as an overviex to hedadecimal editing Spike.