Modifications

From Galaxy on Fire Wiki
Jump to navigation Jump to search

πŸ’¬ This page currently only details modifications for Galaxy on Fire 2 HD, but modifications are known to exist for the Java editions of Galaxy on Fire 2. Contribute your knowledge of Java GOF modding to this article to help us document this wonderful history, and spread the love for the older Galaxy on Fire games! πŸ’¬

Introduction

Much of the information in this article is new, incomplete, or still under testing. Most of the information that we have is thanks to the incredibly skilled individuals of the Russian modding community.
There is much more information available from the Russian modding forums that we have yet to discover!
Note that when downloading any file from 4pda.to, you will see a 404 error unless you are logged into the site.

Browse the 4pda.to modding forum for GOF2 here: https://4pda.to/forum/index.php?showtopic=483666

For further modding support, join the wiki's Kaamo Club discord server, where specialists, dedicated chat channels, and even more tools, are available.

Kaamo Club discord server: https://discord.gg/Qv8zTur

The Current State of Modding Galaxy on Fire 2

There are currently two types of modifications that are possible for Galaxy on Fire 2:

  1. Asset modifications, for example texture swaps and BIN file editing.
  2. Minor code modifications, for example unlocking the FPS limiter and enabling bloom.

Asset modifications are easy, require minimal technical knowledge, and are possible on all platforms. Tools exist for conversion of Abyss Engine's proprietary asset formats. Code modifications are currently only possible for the Android build of GOF2.

Why Can Code Changes Only Be Made For Android?


Minor code changes are currently only possible for Android and no other platforms because, to make a code change, we require access to the game's source code*, which is not publicly available.

Tools exist for some languages, such as Java and C#, to translate a compiled application into estimated source code ("decompile"). GOF2 was written in C++, for which decompiling tools exist, but their output is heavily estimated to a point where it becomes extremely difficult to read and understand, and often cannot be recompiled into a functioning application.

Decompilation tools such as Ghidra can only be reliably used on the Android version of the game as it is the only game with a binary that has not been stripped of debug information, such as function names and types. Using these tools we can get a rough idea of how the game works internally, and therefore how to modify it.

Solely for Android, a layer of Java-like code called Smali was added on top of the C++ source code, to allow the app to run. This layer can be reliably decompiled, edited, and recompiled. It does not contain the core functionality of the game, and so our capabilities are still severely limited.

*Source code: applications are written in human-readable programming languages, such as C++. They are then translated into computer-readable languages ("compiled"), so that computers such as your mobile device can read them and run them.


History

Home sweet home.

Until early 2019, modifying Galaxy on Fire, specifically Galaxy on Fire 2, was not very well known of outside of the Russian community. A few members on the Discord took it upon themselves to crack into the root files of the app, and see what assets they could manipulate using a hex editor, as well as other tools.

Modifying Stats

Arguably the most complex modding process is modding ship and weapon stats. By finding the weapon's damage for example, the modders were able to convert that number to hex, and search for that hex code in the items.bin file. This led to being able to tweak weapon damage to their heart's content, and creating some very fun and unique circumstances.

Examples

  • The Icarus Heavy AS was changed to have massive speed, damage, range and magnitude, capable of destroying entire asteroid fields in one shot.
  • The M6 A1 "Wolf" gained 2 billion damage points, hence being capable of destroying a Terran Battlecruiser ship in one shot.
  • The AMR Oppressor had a ridiculous upgrade - over 2 billion points in damage, which even allowed Vossk Battlecruisers and Terran Carriers to be destroyed! Primary weapons do not work on capital ships once the hull reaches 99%, so a bomb had to be modified to suit.
  • The Khador Drive was hacked, and the charge time reduced to 1ms - instantly sending ships to their desired location.
  • Gunant's Drill was changed to 1000% handling and 1000% yield - one D-class asteroid gave over 300T of ore!
  • The Cyclotron Boost was changed to increase speed by 10,000% - capable of sending ships over 70km in a few seconds.
  • The Polytron Boost was changed to increase speed by 1,000,000% - capable of sending ships over 7500km in a few seconds.
    • The Polytron Boost was further changed to increase speed by 5,000,000%, with a boost duration of 5 minutes - this made it capable of sending ships over 255,000km overall.
  • Both the Pandora Leech and the Nirai SPP-M50 went through some crazy modifications - they could now reach up to 5260 ships as far as 911km away, and do the job at least 8x better than the vanilla equipment!


Downloads

An items.bin file can be found here, and includes most of the mentioned changes. These are compatible with all platforms with the exception of Android. Be sure to save your regular items.bin file before replacing anything! The download contains a backup of the GoF2 HD bin file.

A Modder for the items.bin file can be found  here . The program runs on Linux, Windows and Mac (iOS). There is a Readme which describes how to use the program, an info file which contains some version history and planned stuff and in the MacOS folder a MacOS.txt which tells you how to run the iOS-Version of the program. There is no need to install the program, its a ready-to-run-program.


Other types of stat mods

After the modders have dug into the items.bin file, they proceeded to rummage through the stations.bin file, where all the station statistics, coordinates, and tech level are indicated. What this meant was that they could change the tech level of stations to any value between zero and 2,147,483,647 (32-bit signed integer limit) to their hearts content, thus allowing stations that previously did not have high tech level equipment to be able to sell them.


Examples

  • Kaamo had its old Tech Level 1 changed to Tech Level 10. This in fact actually means nothing, but it just makes the station look better!


Modifying In-Game Text

Green: Text Red: String length
Modified example. (Note status modified as well)
  • Open main directory, open the corresponding .lang file (e.g. gb.lang for english) using hex editor. Remember to backup!!
  • Search for the text you are trying to replace (e.g. Scram Cannon). This can be anything from button text, to item descriptions, to full in-game dialogues.
  • Replace the text to anything you want.
  • The 2(?)-bytes before the text represents string length, change that to the new length of the text you just entered. Beware its in hex. Make sure you get this right else game will crash.
  • Now write your own fan-fiction or something...

File Swapping

Probably the easiest type of modding process. This involves copying your desired model (for example a Vossk Battleship), and pasting it to where the ship you'd like to be able to fly is located (a Rhino, for example). Then the desired model must be renamed to match the actual ship (so vossk_battleship_add.aem must be renamed to dropship_add.aem, or whatever the actual filenames are). Ideally you want to copy all the textures and engine models too, so it's as if you've completely replaced the Rhino model with the Vossk Battleship.

It should be noted that user Dj Puvlusha was the first person known to file swap, which is what lead to the world of GoF2 modding become what it is now. It all began with a screenshot of his modded Kammo station. Head to his profile to take a look!

Some very fun creations can be made from file swapping, as seen above.

Retexturing

Galaxy on Fire 2 textures have been very tough to work with. Initially, only one program besides Abyss Engine itself was able to read the proprietary .aei texture files (as well as .aem models - the ship models have been converted to .objs and can now be used anywhere. Download link below). 8100DSTAR has been in contact with the creator of the program, requesting a way for i3D to export .aei files. This has amazingly, been a success.


In even better news, it turns out the Russian GoF Modding community Catlabs created an .aei converter years ago, which has only recently been discovered again. This has FINALLY allowed for iOS files to be retextured - however the process isn't quite as simple as dragging and dropping. See below for details.

The retexturing process for each platform is as follows:

  • Import .aei into i3D * Export the texture table as .bmp
  • Edit that .bmp to your liking - recolouring, painting, whatever you want. Save that .bmp.
  • Use a .bmp > .dds converter to create the required .dds file * Use i3D's specialised .aei texture converter menu to convert the dds back into the .aei format. $20 works best.
  • Copy the new texture back into the correct directories - be sure to place the new textures in both the 'high' and 'low' folders, or else you'll end up with a dark texture! * Profit.

  • You need two more things for iOS texturing:
    • A copy of Galaxy on Fire 2: Full HD - you need Full HD textures initially. iOS textures will not convert properly. If you do not have access to these files, head over to our Discord server and ask there.
    • Download Catlabs' AEI Texture Converter in order to create the correct files for iOS - you can find the download below.
  • To begin, import your desired Full HD texture file into i3dConverter.
  • Go to 'Tools' > 'Export material table's textures to .bmp files...'
  • Open that new .bmp in Photoshop and edit how you like
  • Save that edited image as a .png.
  • Open the AEI Texture Converter and choose the 'Import' icon.
  • Navigate to the new .png file and import it
  • Choose the 'Save As' icon, and export the .aei file. Make sure the compression method is set to 'none'.
  • Drag the custom .aei file into /var/containers/Bundle/Application/BFDED857-CBD8-4905-A609-118B61AE9A3C [your numbers may vary]/Galaxy on Fire 2 HD.app/data/[whatever folder you need].
  • Restart the game. Done!

A method has been discovered to modify the .obb file of the Android Version of GOF2. File Size of GOF2 Android OBB: 1,011,128,870 bytes Warning: Modifying items.bin on Android will NOT CHANGE ANYTHING. That is due to the items.bin files present within the GOF2 APK itself.

  • Change the extension of the file from .obb to .zip/.rar, whichever you prefer.
  • Extract the entire file.
  • Make changes to whatever file you want to change.
    • It's advisable to just change the .bin files as changing textures might make compression a little difficult later.
  • Re-compress the entire file.
    • If your file is larger than 1,011,128,870 bytes, please improve the compression quality slightly so that the file size is slightly smaller than the value above.
  • When you're done, you may do the following steps in any order you wish. Note that your re-compressed file should not be smaller than 961MB to prevent the game from crashing.
    • Change the extension of the file from .zip/.rar to .obb.
    • Using a HEX Editor, add the missing number of bytes until it reaches 1,011,128,870 bytes
A Way has been discovered for modding apk-file its easier and will work with less problems, but you can only change the items.bin

What you need

  • Program for unpacking/repacking apk-files - e.g. Okteta for Linux
  • In the file you need to replace items.bin in the assets/bin and assets/data/bin folders
  • Repack the apk and install it on your Android device
  • The .obb download will start automatically and voila - the modded items.bin will be in use.

During testing, custom .aei files were used without i3D itself - a purple H'Soc was first to be tested. After this was proven a success, the feature was fully implemented into i3D for use. Unfortunately, currently i3D can only read Full HD textures, which cannot be placed in HD games. However in conjunction with Catlabs' program, iOS retexturing is now possible.

Downloads

  • i3DConverter - the tool to open the files. Costs $40 for the full version.
  • The AEI Texture Converter is proprietary software and for legal reasons cannot be shared here. Please join the Discord server and request access on the #modding channel.

Possibility

  • Currently HD on iOS and Full HD on macOS are easiest to modify - provided of course your iOS device is Jailbroken.
  • PC's file structure is vastly different from macOS, making it difficult to mod, ironically.
  • Only Full HD textures can be read and exported - however thankfully the models work cross-platform, so this is not a huge issue. Textures are not compatible.
  • It has been shown that importing custom .aem models is possible - but the tool is not publicly available. Yet. Stay tuned!


Please note: although sharing modified files is fun and harmless, the Galaxy on Fire Wiki does not condone piracy. Please pay for the full games and do not share entire game folders.

Tutorials

Some of the modifications listed in this article are currently limited to certain platforms.
Check the icons in the section titles to see which platforms they apply to:

πŸ’» Windows
🍎 Mac
πŸ“± iOS
πŸ€– Android

If you have any information that is not documented here, for example a new modification, or applying an existing one to a different platform, please document it here!

πŸ’» Unlocking The Valkyrie DLC Content For PC


The Phantom, Wraith, and Vol Noor ships are available in the PC version of GOF2.
A timeline of ships in GOF2 updates, By GeometryPrime

The Valkyrie and Supernova expansions were never released for the PC version of Galaxy on Fire 2. Sadly, without access to the source code, we do not anticipate that it will ever be possible to mount the DLCs on PC.

However, Russian modders SL-JAR and Cyrax_X (with help from users Smert124 and DexterDean94) discovered that the items and solar systems from the Valkyrie DLC are already present in the game files, and so they have created a patch to unlock them!

A demonstration of the mod can be seen here: https://youtu.be/m4Qq-fA9t38
For full details, including installation, please read the Steam article for the mod here: https://steamcommunity.com/sharedfiles/filedetails/?id=771089648
Update: Steam has regrettably removed this article. Instead, please use this archived copy of the article: https://archive.org/details/gof2fullhdvalkyriepatch

Occasionally, the Shima system may not appear after installation of the mod. Discord user krychoke has provided patched bin files to fix this issue:
Place these files in Galaxy On Fire 2 HDdatabin


πŸ’»πŸŽπŸ“±πŸ€–Backing Up And Restoring Saves


Your save files are stored in the following location. These can be copied elsewhere and then put back into place later, and will function again as normal. This is very useful when, for example, reinstalling your game, or loading someone else's save.

Platform Save Data Location
πŸ€–Android
Android/data/net.fishlabs.gof2hdallandroid2012/files
πŸ“±iOS πŸ’¬Missing - please fill this cell if you have informationπŸ’¬
πŸ’»PC
%USERPROFILE%\AppData\Roaming\Galaxy on Fire 2 Full HD
🍎macOS
Users/[user]/Library/Containers/Galaxy on Fire 2 Full HD/Data/Library/Galaxy on Fire 2 Full HD

πŸ€– Using Android Saves on Another Device


Android will lock game saves to the device on which they were created, using your device ID. This is normal for android games. Two workarounds have been developed for this:

  • Modders have removed the game's device ID check when loading a save. Full information, including installation, is available in the modding channels in the Kaamo Club discord server.
  • The Russian community have published a guide to changing the device ID on a save game. Click here to go to the thread on 4pda.to. This article is in Russian, so you should enable google translate on your browser.

πŸ€– Editing The OBB File On Android


The android version of Galaxy on Fire 2 is split in two:

  • The game code
  • The game assets (e.g models, textures, item definitions...)
A reskin of the Grphon ship by discord user aldy_weser, named "Galactic Empire"

The game assets are stored in a binary archive, called an OBB file. Editing this file is very simple:

  1. Open your files app, and go to internal storage.
  2. Go to Android/obb/net.fishlabs.gof2hdallandroid2012.
  3. You'll be editing the main.47947006.net.fishlabs.gof2hdallandroid2012.obb that's in this folder, so make a backup of this file in case something goes wrong.
  4. Move main.47947006.net.fishlabs.gof2hdallandroid2012.obb to your Downloads folder (not necessary if your phone is rooted), rename it to main.47947006.net.fishlabs.gof2hdallandroid2012.zip, and tap it to unarchive it.
  5. Once unarchived, you'll have a new main.47947006.net.fishlabs.gof2hdallandroid2012 folder containing the game's assets. Open main.47947006.net.fishlabs.gof2hdallandroid2012/47947_GOF2CONTENT_ETC, and make your modifications.
  6. Go back to the main.47947006.net.fishlabs.gof2hdallandroid2012 folder, and make a zip of your modified 47947_GOF2CONTENT_ETC folder, called main.47947006.net.fishlabs.gof2hdallandroid2012.zip. Zips can be made in a couple of ways, for example with the RAR app, or from the terminal, if that's your jam.
  7. Rename your zip to main.47947006.net.fishlabs.gof2hdallandroid2012.obb, and move it back into the Android/obb/net.fishlabs.gof2hdallandroid2012 folder, where you first found the original

The OBB file can be found in the following location:

Android/obb/main.47947006.net.fishlabs.gof2hdallandroid2012.obb

πŸ€– Unlocking The Game Binary Size


The game code, bundled into an APK, required the OBB file to be exactly 1,011,128,870 bytes in size. If we reduce the size of the obb, then we can make the OBB usable by appending zeros onto the end of the file until the required size is reached.
If we exceed the expected size while modifying the OBB file (for example by adding a higher resolution texture), then the game will delete the OBB file and download a new one.

Using the PC graphics on mobile - High GPU usage!


To overcome this, modders have removed the game's check for the size of the OBB file. Full information, including installation, is available in the modding channels in the Kaamo Club discord server.


πŸ€– Unlocking The Framerate Limiter


By default, the android build of GOF2 will limit your device's framerate to 30 frames per second (FPS). To overcome this, modders have raised the game's framerate limit to 120 FPS. Full information, including installation, is available in the modding channels in the Kaamo Club discord server.


πŸ€– Fixing Texture Clipping


Occasionally, a bug can occur causing certain textures to clip through one another. For the android build of GOF2, modders have been able to fix this bug. Full information, including installation, is available in the modding channels in the Kaamo Club discord server.


πŸ€–πŸ“± Changing The Size Of The UI


πŸ€– For android, the Russian community have added a new UI that appears on game launch, allowing the player to customise the scale of the GUI. Full information, including installation, is available in the modding channels in the Kaamo Club discord server.


πŸ€–πŸ“± Fixing UI Elements Overflowing The Screen


At higher resolutions, the mobile edition of GOF2 will switch from 'mobile' to 'tablet' mode. This means that the GUI can scale too high for devices with larger screens, causing buttons to appear off screen, or touch inputs to be registered incorrectly.

  • πŸ€– For the android build of GOF2, modders have worked around this bug by using the aforementioned UI resizing mod, with great success.
  • πŸ“± On iOS, open your device's settings app and change the display mode from normal to "zoomed". Many thanks to discord user svis for finding this fix.

πŸ’»πŸŽπŸ“±πŸ€– Modifying "bin" Files


A screenshot taken by Droid378, piloting the Millenium Falcon
4pda.to user Droid378 needed to modify ships.bin and weapons.bin to fly the Millenium Falcon, as well as the normal asset swaps

Galaxy on Fire 2 loads its definitions for all entities in the game from binary files of a proprietary format. Discord user Exilium#9943 has developed a custom hex editing tool for several of these types of files:

  • Ships.bin, containing all space ships in the game
  • Items.bin, containing all other items in the game
  • Stations.bin, describing all planets
  • Systems.bin, containing solar systems

To modify a file:

  1. Download the hex editor from the Tools section
  2. Make a backup of your bin file
  3. Load the file into the hex editor, and make your changes
  4. Save the new file, and place it in your game, replacing the original

The bin files can be found in the following location:

Platform Binary Files Location
πŸ“±iOS
/var/mobile/containers/bundle/Application/GOF2HD/data/bin
πŸ’»PC
C:\Program Files (x86)\Steam\steamapps\common\Galaxy On Fire 2 HD\data\bin
🍎macOS
Macintosh HD/Applications/Galaxy on Fire 2 Full HD.app/ Contents/Resources/data/bin

πŸ€– Modifying "bin" Files On Android


As mentioned in the 'Editing The OBB File On Android' section, GOF2 for android stores the game code in an APK file, and the game assets in an OBB file. The .bin files can be found in the OBB at: Android/obb/main.47947006.net.fishlabs.gof2hdallandroid2012.obb/47947_GOF2CONTENT_ETC/assets/data/bin However, the game will ignore bin files in the OBB. Instead, it uses internal .bin files, kept in the APK. This also appears to be the case for language files. So, to modify your bin files:

  1. Rename your existing APK from .apk to .zip, and tap it to unarchive it.
  2. Open the assets/data/bin folder.
  3. The bin files should be in this folder, make your changes here. If you do not find your bin files here, take the file from your OBB, or ask a member of the community to provide you with one.
  4. Re-zip your apk files, and rename the .zip to .apk.
  5. You should be able to install this APK, either as a new installation, or on top of your existing GOF2 installation, and android will treat it as if it were an update. This is preferable, because it should mean that you don't need to manually persist your saves to the new installation. Still, it is highly recommended that you back up your saves first, in case this goes wrong.

Should you need to extract bin files from your OBB, you can find them here:

Android/obb/main.47947006.net.fishlabs.gof2hdallandroid2012.obb/47947_GOF2CONTENT_ETC/assets/data/bin

See the Editing The OBB File On Android section for how to access and edit these files.

πŸ”§ Troubleshooting


If for some reason your modded .apk cannot be installed (i.e. there was an problem parsing the package, it appears the app has an invalid package, or app not installed) it might be due to the following reasons:

  • You didn't sign/zipalign the apk.
  • Something got corrupted when putting back the modded .bin files into the apk.


If so, you can try the following:


  1. Move your modded bin files and your apk to the root of your phone storage (or any folder of your liking)
    1. Alternatively, you can drag and drop the bin files into your apk from your PC using 7zip. If so, just download Apktool M and skip to the step 5
  2. Download and install Apktool M and Mixplorer (available in our Discord)
  3. Open Mixplorer and copy your bin files
  4. Go to your apk, tap on it, tap on 'Explore', navigate to the folder where you have to paste your bin files and paste them (delete any previous bin file with the same name before pasting your modded ones)
  5. Open Apktool M and tap on:
    1. 3 dots in the top right corner,
    2. 'Settings',
    3. 'Signature',
    4. 'Custom signature file',
    5. 'Create a key file'
  6. On Key Type, select PKCS12, and on Key Path set the folder where you want your signature file to be stored.
  7. Fill only the alias, keystore password, private keystore password and validity date input fields with anything you want. Once you're done, tap on 'Create and Use'.
    1. Note: once you create this, you won't need to create another signature key for when signing/zipaligning a future version of your modded apk
  8. Go back to the main menu and:
    1. find your modded apk,
    2. tap on it,
    3. choose <zipalign>,
    4. select custom signature file from the dropdown menu and,
    5. tap on 'select'.
  9. If successful, you should have a new apk with the '_aligned' text on its name.
  10. Install the apk. If you have a previous version installed, uninstall it first (otherwise it won't allow you to install the new apk).





πŸ’»πŸŽπŸ“±πŸ€–Modifying Item Stats


All of the stats and attributes for every item in the game, including their prices, can be found in Ships.bin and Items.bin.
To modify these, please see the 'Modifying "bin" Files' section.


πŸ€– Using The iOS Economy on Android


For the android version of GOF2, the price ranges of many items were changed significantly.
For example, the AB-1 "Retractor" tractor beam can be bought for 8,962 credits on iOS, at its worst price. In comparison, android users must pay a minimum of 149,438 credits to buy one.


By modifying the game's bin files, Discord user kiritojpk has created a patch for android GOF2 to instead use the iOS economy.
Full information on this patch, including installation, is available in the modding channels in the Kaamo Club discord server.
For information on how to perform item stats and price modifications yourself, see the 'Modifying Item Stats' section of this article.


πŸ’» Reshade/SweetFX


Reshade and SweetFX hook into the rendering pipeline to let you add your own post-processing to almost any game.

  1. Download and open the latest version of Reshade: https://reshade.me/
  2. Locate GOF2.exe. For example, if your steam library is located on your C drive:
    C:\Program Files (x86)\Steam\steamapps\common\Galaxy On Fire 2 HD\GOF2.exe
  3. Select DirectX 9 mode
  4. Choose your effects
  5. Launch the game through the GOF2 launcher
  6. Disable anti-aliasing in the graphics tab, and press Play
    This is required to enable depth-buffer access.
  7. Customise your effects from the Reshade UI that will appear. The default keybind for the Reshade UI is the 'Home' key.

To view other users' presets, check out the GOF2 SweetFX repository here: https://sfx.thelazy.net/games/game/1320/


COMING SOON

The following modifications have been shown to be possible, but the documentation is still being written. If you would like information on any of these, please ask in the Kaamo Club discord server.

// πŸ€– Fixing The Bounty Board Soft Lock



// πŸ’»πŸŽπŸ“±πŸ€– Swapping Models And Textures



// πŸ€– Fully Remastering The Mobile Edition



// πŸ’»πŸŽπŸ“±πŸ€– Using Java GOF2's Planet Skybox Sprites


AI-upscaled versions of the Java GOF2 skybox planet sprites. Mod: discord user kiritojpk

// πŸ’»πŸŽπŸ“±πŸ€– Swapping Game Audio



// πŸ’»πŸŽπŸ“±πŸ€– Editing Subtitles



// πŸ’»πŸŽπŸ“±πŸ€– Editing The Galactic Map


// πŸ’»πŸŽπŸ“±πŸ€– Moving Solar Systems



// πŸ’»πŸŽπŸ“±πŸ€– Moving Planets



// πŸ€– Adding New Solar Systems



// πŸ’»πŸŽπŸ“±πŸ€– Changing The Tech Levels Of Planets



// πŸ’»πŸŽπŸ“±πŸ€– Changing The Faction Of Planets



// πŸ’»πŸŽπŸ“±πŸ€– Changing The Security Levels Of Planets




// πŸ€– Modpacks


Android rebalance mod, Ban's mod, KiritoJPK's mod...


Tools

This section is still being written. In the mean time, please see the Downloads section of this article.

To be added:

Proprietary File Formats

This section is still being written. It contains our current knowledge of the binary structures of Abyss Engine proprietary file formats, and any known code libraries capable of interfacing with those formats. If you require any further information than what is so far present here, ask in the Kaamo Club discord server.

Language Files (.lang)


To find the lang files, go to the following directory from the root of your installation folder:
data/assets/main/lang


Abyss Engine lang files list all user-facing strings, in UTF-8 encoding.
Strings appear in sequence with no separators, but each string is prefixed by its length in bytes:

Lang string structure
Type [bytes] ushort [2] chars [variable]
Description string length string content
The string length prefix is big-endian.
Renaming the English language to "Pirate Speak" using PC hex editor application Hxd. A new string length of 000C is prepended, instead of 0007.


For example, the first three entries in the english language file (gb.lang) are: 8Language7Deutsch8EspaΓ±ol
The 'Γ±' character requires two bytes to be represented.

The string content of a lang file can be viewed and edited by any text editor, such as Notepad or Visual Studio Code. The string lengths however must be edited with a hex editor, such as HxD.


AEImage Textures (.aei)


A screenshot of AEI conversion program CatLabs AEIEditor
gof2_items.aei open in CatLabs AEIEditor

An AEI (Abyss Engine Image) is a little-endian canvas containing a single image, which is cordoned into multiple images using bounding boxes. To disambiguate, we will use the term "image" to refer to the entire image in the AEI file, and "texture" to refer to a single 'image' within a file, defined by a bounding box. Textures do not necessarily conform to a regular grid or size, they can even overlap.

The ETC1 compression format stores image content in BGR format, not RGB. I.e, colour channels are ordered as (blue, red, green). Other compression formats store the image content as RGB.

Textures within an AEI have coordinates and dimensions. Since the AEI is internally a single image, the textures are optionally compressed and/or mipmapped together, as a single image. An AEI can contain a set of simple, unclassified textures, and/or a set of "symbol" textures - textures that have a character attached to them, such as a letter in a font.

An AEI is composed of header metadata, texture content, and footer metadata:

High-level AEI structure
Header metadata

15 bytes

Image content

Variable length

Footer metadata

Variable length

AEI Header Metadata

The header contains basic information about the AEI file and its textures:

AEI header structure
Type [bytes] string [7] char [1] identifier [1] ushort [2] ushort [2] ushort [2] array of 4 x ushort [2] per texture uint [4] '
Description "AEimage" 00 separator Compression algorithm AEI width (px) AEI height (px) Number of textures Texture origins and dimensions Optional image length in bytes*

⚠ *The image length is not present for uncompressed images.

This is because each colour point is a single byte, and so the length is simply the number of colour points in the image.
AEIs have 4 colour channels (RGBA), so the image length is fixed at image width * image height * 4.

Compression Formats

The compression algorithm is an identifier hard-coded into the engine, from the enumeration:

Abyss Engine supported image compression algorithms
Algorithm Identifier Identifier (hex)
Unknown 0 00
Uncompressed (UI) 1 01
Uncompressed (cubemap) 194 C2
Uncompressed (cubemap, PC) 129 81
PowerVR Texture Compression (PVRTC) 2bpp +alpha 13 0D
PowerVR Texture Compression (PVRTC) 4bpp +alpha 16 10
ATI Texture Compression (ATC) 17 11
DirectX 1 (DXT1) 32 20
DirectX 3 (DXT3) 33 21
DirectX 5 (DXT5) 36 24
Ericsson Texture Compression 1 (ETC1) 64 40
Mipmapping Flag

To enable mipmapping, the second bit of the compression format identifier is set to 1.
For example, the DXT5 format's identifier is 00100100 (0x24). DXT5 with mipmapping is therefore 00100110 (0x26). Mipmapping cannot be enabled for uncompressed textures.

Texture Bounding Boxes

The positions and dimensions of all textures in the image are stored in a single block, as a series of 4-tuples:

AEI texture dimensions metadata - all fields are of type ushort (2 bytes)
Field X-coordinate Y-coordinate Width Height

There is no separation between fields or texture entries, they appear in series.

Image Content

The textures are internally represented as a single image.
All texture content is given as a single block.

Footer Metadata

The footer lists "symbol" information, and optionally the compression quality:

High-level AEI footer structure
Number of symbol groups

2 bytes

Symbol data

optional, variable

Compression quality

optional, 1 byte

The symbol data chunks symbols together into groups:

AEI symbol group structure
Number of symbols

2 bytes

Symbols

2 bytes * number of symbols

A screenshot of gof2_font_ar.aei open in CatLabs AEIEditor
A screenshot of gof2_font_ar.aei open in CatLabs AEIEditor

The symbols themselves are simply 2-byte UTF-16LE encoded characters, such as letters and numbers.

Finally, the compression quality is a single, optional byte, ranging from 1 to 3.
If the compression quality is omitted, then we assume maximum quality (3).

Image Types

Galaxy on Fire 2 identifies textures as either diffuse, or normal/specular, using a file name extension:

  • ..._diffuse.aei
  • ..._normal_specular.aei

AEIs without one of these extensions, for example the UI images in the data/textures folder, can be assumed to be of diffuse type.

Diffuse

Diffuse textures are as they appear, without further semantics.

Normal/Specular

A 'normal' texture records the direction that each pixel in the texture is facing in the model. This is used by Abyss Engine to give the visual illusion of depth, by simulating shadows of the "geometry", directly on the texture. Further reading on this concept is encouraged. A single normal point is a 3-dimensional vector:

  • vector magnitude in x-direction
  • vector magnitude in y-direction
  • vector magnitude in z-direction

A 'specular' texture represents the 'specularity' or 'shininess' of each pixel on the texture.
A single specular point is a single integer between 0 and 255, inclusive.

We have 4 datapoints to represent per pixel, and an AEI file has 4 colour channels (RGBA), and so Galaxy on Fire 2 stores both of an image's normal and specular textures in a single image;
The first 3 channels in an AEI represent the normal texture, and the final channel (alpha) represents the specular.

These can be separated relatively easily in an image manipulation program, such as GIMP.


COMING SOON

// AEMesh Models (.aem)


V4AEMesh

V5AEMesh


// Sound Files (.fsb)



// Object Definitions (.bin)


// Ships (ships.bin)


ships.bin contains a list of ships and their attributes. Each entry has the following format:

ships.bin entry format
Size (Bytes) Data Type Name Notes
4 Integer Ship ID
4 Integer Armour rating
4 Integer Cargo capacity
4 Integer Price
4 Integer Primary weapon count
4 Integer Secondary weapon count
4 Integer Turret count The game does not support more than 1 turret per ship
4 Integer Equipment slot count
4 Integer Handling
Notes
  • The ships with IDs 13, 14, and 15 are the Vossk freighter, Terran battlecruiser, and Nivelian freighter respectively.
  • All three of these have the exact same stats according to the file.
  • In order to play as these ships, new entries need to be added to [weapons*.bin](weapons.md).
  • Ship names can be found in the lang files starting at index 913.
  • There are 64 ships defined in this file.
  • This file is big-endian.

Information taken from here: https://github.com/Ravernstal/gof2-bin-info/blob/master/ships.md


// Collision Boxes


// Unknown (collision.bin)


// Unknown (collision_test.bin)


// Unknown (wreck_collisions.bin)



// Ship Weapon/Engine Positions (weapons*.bin)


weapons*.bin contains a list of primary, secondary, turret, and thruster positions per ship. Each entry has the following format:

weapons*.bin entry format
Size (Bytes) Data Type Name Notes
2 Integer Ship ID
2 Integer Number of positions
Variable Position

Each position has the following format:

Position entry format
Size (Bytes) Data Type Name Notes
2 Integer Position type 0x0 = primary weapon, 0x1 = secondary weapon, 0x2 = turret, 0x3 = engine
2 Integer X position
2 Integer Y position
2 Integer Z position

If the position type is 0x3 (an engine), then the following fields will also be included:

Additional engine data
Size (Bytes) Data Type Name Notes
4 Float Engine intensity (X) All three of these values control the size of the flame. Oddly, they are always equal and the game seems to use the lowest value of the three
4 Float Engine intensity (Y)
4 Float Engine intensity (Z)
Notes
  • There are 59 entries defined in this file.
  • This file is little-endian.

Information taken from here: https://github.com/Ravernstal/gof2-bin-info/blob/master/weapons.md


// Items (items.bin)


items.bin contains a list of items, their attributes, and their blueprint ingredients (if they are a blueprint item). Each entry consists of three lists. The first is a list of item IDs used to create this item from a blueprint (if this item is not a blueprint item, this list will be empty and the length will be zero). The second is a list of blueprint item counts, each corresponding to the item ID in the previous list (again, if this is not a blueprint item, this list will be empty). The final list is a list of key-value pairs where each key corresponds to an attribute ID, and the value is the value for that attribute. The format of each item entry is as follows:

items.bin entry format
Size (Bytes) Data Type Name Notes
4 Integer Number of blueprint item IDs (b)
4 x b Integer Blueprint item IDs
4 Integer Number of blueprint item counts (c)
4 x c Integer Blueprint item counts
4 Integer Number of attributes and values (a)
4 x a Integer Attribute ID / value (alternating) e.g. if this list had a length of 8, it would have 4 attributes and 4 corresponding values in the format avavavav

The known attributes IDs are as follows:

Item attributes
ID Name Notes
0 Index Item ID
1 Type
2 Sort
3 Tech level
4 Minimum price system ID System ID where the price is at its lowest
5 Maximum price system ID System ID where the price is at its highest
6 Occurence %
7 Minimum price
8 Maximum price
9 Damage (weapon)
10 EMP Damage (weapon)
11 Loading speed ms (weapon)
12 Shot lifetime ms (weapon)
13 Speed factor (weapon)
14 Magnitude m (secondary weapon)
15 Steerable? (secondary weapon) Value of 0x0 = false, 0x1 = true
16 Automatic? (turret) Value of 0x0 = false, 0x1 = true
17 Handling (turret)
18 Capacity (shield)
19 Loading speed ms (shield)
20 Armour (armour)
22 Effect % (compressor)
23 Automatic? (tractor beam) Value of 0x0 = false, 0x1 = true
24 Lock time ms (tractor beam)
25 Effect % (booster)
26 Loading speed ms (booster)
27 Duration ms (booster)
28 Effect % (thruster)
29 Lock time ms (scanner)
30 Show class A asteroids? (scanner) Value of 0x0 = false, 0x1 = true
31 Show cargo? (scanner) Value of 0x0 = false, 0x1 = true
32 Handing % (drill)
33 Yield % (drill)
34 Size (cabin)
35 Effect ms (cloak)
36 Loading speed ms (cloak)
37 Loading speed ms (Khador drive)
38 Energy consumption (cloak/Khador drive)
39 Fire rate % (weapon mod)
40 Damage % (weapon mod)
41 Effect ms (emergency system)
42 Effect ms (time extender)
43 Loading speed ms (time extender)
50 Magnitude (plasma collector)
52 Capacity (gamma shield)
53 Range (repair beam)
54 Effect (repair beam)
55 Count (repair beam)
56 Effect (ion missile)
57 Show info? (spectral filter) Value of 0x0 = false, 0x1 = true
58 Show on radar? (spectral filter) Value of 0x0 = false, 0x1 = true
59 Consumption (shield injector)
60 Vossk item? Value of 0x0 = false, 0x1 = true
Notes
  • Item names can be found in the lang files starting at index 1274.
  • There are 233 items defined in this file.
  • This file is big-endian.

Information taken from here: https://github.com/Ravernstal/gof2-bin-info/blob/master/items.md


// Planetary Systems (systems.bin)


systems.bin contains a list of solar systems in the game. Each entry has the following format:

systems.bin entry format
Size (Bytes) Data Type Name Notes
2 Integer Name length (n)
n String Name UTF-8 encoded
4 Integer Risk level 0x0 = dangerous, 0x1 = risky, 0x2 = average, 0x3 = secure
4 Boolean Unlocked at start Whether or not the system is visible at the start of the game. Either 0x0 or 0x1
4 Integer Faction 0x0 = Terran, 0x1 = Vossk, 0x2 = Nivelian, 0x3 = Midorian
4 Integer Map X coordinate
4 Integer Map Y coordinate
4 Integer Map Z coordinate
4 Integer Jumpgate station ID Station ID of the planet with a jumpgate, or 0xFFFFFFFF (-1) for systems without one e.g. Mido
4 Integer Star colour ID 0x0 = green, 0x9 = white
4 Integer Unknown array length (a) Always 0x3
4 x a Integer Unknown
4 Integer Number of planets/stations (p) No system in the game has more than 5 planets
4 x p Integer Station ID
4 Integer Number of linked systems (s)
4 x s Integer System ID Systems should be linked both ways
4 Integer Unknown array length (b) Always 0x3
4 x b Integer Unknown Always 0x0, then 0x1, then 0x2
Notes
  • There are 34 systems defined in this file.
  • This file is big-endian.

Information taken from here: https://github.com/Ravernstal/gof2-bin-info/blob/master/systems.md


// Space Stations (stations.bin)


stations.bin contains a list of planets/space stations in the game. Each entry has the following format:

stations.bin entry format
Size (Bytes) Data Type Name Notes
2 Integer Name length (n)
n String Name UTF-8 encoded
4 Integer Station ID
4 Integer System ID
4 Integer Tech level 1-10
4 Integer Planet background ID
Notes
  • There are 135 stations defined in this file.
  • This file is big-endian.

Information taken from here: https://github.com/Ravernstal/gof2-bin-info/blob/master/stations.md


// NPC Names (names_<faction>[_0][_1][_m][_w].bin)


The names_*.bin files contain lists of names for people in space lounges. Each file has a 4 byte header which indicates the number of entries, and each entry has the following format:

names_*.bin entry format
Size (Bytes) Data Type Name Notes
2 Integer Name length (n)
n String Name UTF-8 encoded
Notes
  • These files are big-endian.

Information taken from here: https://github.com/Ravernstal/gof2-bin-info/blob/master/names.md


// News Items (ticker.bin)


ticker.bin contains a list of news ticker items. These appear at the bottom of the hangar screen, and can change depending on the current story mission. Each entry has the following format:

ticker.bin entry format
Size (Bytes) Data Type Name Notes
4 Boolean Unknown Either 0x0 or 0x1
4 Boolean Show in Terran systems Either 0x0 or 0x1
4 Boolean Show in Vossk systems Either 0x0 or 0x1
4 Boolean Show in Nivelian systems Either 0x0 or 0x1
4 Boolean Show in Midorian systems Either 0x0 or 0x1
4 Integer Start mission ID The ID of the first story mission that this news item will appear during
4 Integer End mission ID The ID of the last story mission that this news item will appear during
Notes
  • The text for each of these news items can be found in the lang files starting at index 3262. Text replacement strings can be found at preceding indexes.
  • There are 59 news items defined in this file.
  • This file is big-endian.

Information taken from here: https://github.com/Ravernstal/gof2-bin-info/blob/master/ticker.md


// Most Wanted (wanted.bin)


wanted.bin contains a list of most wanted characters. Each entry has the following format:

wanted.bin entry format
Size (Bytes) Data Type Name Notes
2 Integer Name length (n)
n String Name UTF-8 encoded
4 Integer Most wanted ID
4 Integer Board faction 0x0 = Terran, 0x1 = Vossk, 0x2 = Nivelian, 0x3 = Midorian
4 Integer Race 0x0 = Terran, 0x1 = Vossk, 0x2 = Nivelian, 0x3 = Midorian
4 Integer Unknown Always 0x1
4 Integer Ship ID
4 Integer Weapon item ID
4 Integer HP
4 Integer Loot item ID
4 Integer Loot amount
4 Integer Reward Credits
4 Integer Number of bounties required
4 Integer Required mission ID
4 Integer Number of wingmen
4 Integer Number of image parts (n) Always 5
n Integer Image part ID
Notes
  • There are 25 entries defined in this file.
  • This file is big-endian.

Information taken from here: https://github.com/Ravernstal/gof2-bin-info/blob/master/wanted.md


// Agents (agents.bin)


agents.bin contains a list of agents (people who sell system coordinates, blueprints, and modifications in space lounges). Each entry has the following format:

agents.bin entry format
Size (Bytes) Data Type Name Notes
2 Integer Name length (n)
n String Name UTF-8 encoded
4 Integer Agent ID
4 Integer Station ID
4 Integer System ID
4 Integer Race 0x0 = Terran, 0x1 = Vossk, 0x2 = Nivelian, 0x3 = Midorian
4 Boolean Is male Either 0x0 or 0x1
4 Integer Sell system ID The system ID of the system being sold, or -1 if none. Each agent may only sell one type of item
4 Integer Sell blueprint ID The item ID of the blueprint being sold, or -1 if none
4 Integer Sell mod ID The modification ID of the mod being sold, or -1 if none
4 Integer Sell price
4 Integer Number of image parts (i) Always 5
i Integer Image part ID
Notes
  • There are 13 agents defined in this file.
  • These files are big-endian.

Information taken from here: https://github.com/Ravernstal/gof2-bin-info/blob/master/agents.md


// Unkown (shipparts.bin)



// Unkown (stationparts.bin)




Code Libraries

Language
Format Python
AEI AEPi (partial)
BIN (names) gofdetect (partial)
BIN (stations) gofdetect (partial)
BIN (systems) gofdetect (partial)