Page 1 of 1

[Tutorial] Edit Designs.dat so that AI use custom ship designs.

Posted: Fri Mar 02, 2018 10:00 pm
by DeadFire13
Preface: I'm no coder or anything. I just played around with a hex editor until I figured how to add ships.

For some reason, the modified Designs.dat of Fusion_power didn't work for me. I followed the instructions exactly, but after every battle, the Designs.dat file would reset, making it useless for me. Also, several people have noted that they didn't want Fusion's own custom ships in the file. So I'll be showing how you can add your own.

There is one restriction to my method though: I don't know how to increase the size of the file and thus the maximum number of entries. If you change the file size, it will not work anymore.

You cannot replace any of the default ships, so all you can do is replace the Separators with the ships you want because I don't know how to increase the file size.


1) Find a hex editor. I used HxD hex editor.

2) Have a clean, unmodified Designs.dat file and back it up somewhere, for 'safety' reasons.

3) Open up your game, and make/import the designs you want to have the AI use. As far as I know, there are absolutely no limits on what you can do with your ships. I use the Ship Editor utility somewhere in this forum to give my ships higher than the allowed amount of modules and it works fine. You can have the ships restricted to any factions, as I personally have my custom ships to fly with only my faction, Straylians.

4) Rename and backup this modified Designs.dat file. I just renamed mine to Designs_custom.dat.

5) Open up an expendable copy of the custom file on the Hex editor. Now to edit!

6) Find your ship in the hex editor. You can search it by name or description in HxD using Ctrl-F.


What I highlighted is where the entry begins. I believe the 01 indicates a new entry.


The entry naturally ends where the next entry begins. Copy the entry (I just used Ctrl-C). This contains everything pertaining to the design.

7) Find one of the 'blanks' between default ships. You can open Critical Mass and Design Ships to orient yourself within the hex editor. When you find it, highlight the entry to be replaced.


The 02 in the 5th space indicates a 'blank' entry, I think. Previously I was just copying everything from the description of one entry up the description of the next, but it resulted in the entry not working as seen in Design Ships in the game. I noticed for the 'blanks', it said 02 and for ships, it had 00. So this needs to be 00, but you already have that when you copied your custom ships design so don't worry about it.


As before, highlight to the end of the 'blank' entry. The size of the highlight (which is the size of the entry) should end up being the same size as what you copied before. So just paste (Ctrl-V)! Done!

If it says that the file size will change, you highlighted too much or too little when copying your designs or replacing the 'blank'. Go back to the beginning and try again.

Just keep replacing the 'blanks' with whatever designs want to add.

When done, save the file. Make sure it's named Designs.dat and put in the main directory.

Note, when you look at the ships in Designs Ships, they will be where the separators used to be. This looks weird. You can rearrange everything in the hex editor, but I'm too lazy for that.


Re: [Tutorial] Edit Designs.dat so that AI use custom ship designs.

Posted: Sat Nov 03, 2018 11:28 pm
by OllyG

Thanks for posting this.

I was very excited to see this, but I tried following your instructions precisely and it didn't work for me. The separators in the design screen are unchanged. I've checked I put the modified designs file in the Critical Mass folder, and that there are no 'separators' you can find in a search in a hex editor.

Any idea what I might have missed/done wrong?

What version of Critical Mass were you able to make the modification on?

Thanks if you can help.


Re: [Tutorial] Edit Designs.dat so that AI use custom ship designs.

Posted: Sat Mar 02, 2019 2:44 am
by DeadFire13
If you're on 4.0h, it won't say Separator but the way is still exactly the same... That's pretty obvious from a coding perspective, because the ships list is still the same and the Separator still exists which occupies a blank entry. The data is not encrypted, the descriptions and names of everything else is still there.

For example, if you look for 'Scout', go back a little (past its description) until you see the 01 in the beginning (sometimes it's in the middle) of a line, which indicates the beginning of its entry. Starting from there going back, is the entry for the Separator. You can drag and scroll up until you find the top of the Separator entry (it says 'spaceship'), with a 01 as the beginning of it's entry a little before/above the description.

In HxD, you'll see the one before Scout (and after Wormhole) from line 24120 to 25120. Locating other Separators is just finding the entries between any other two, for example between Super Watcher and Drone.

edit: Goddammit. I downloaded the demo to help you out and it deleted my save. I had over 2000 credits earned on that save...


I've literally just done it in a few minutes on the demo current version, so I don't know what to tell you.

I've changed my board settings so now I should be able to be contacted through email. You can speak to me further and maybe I can help.

Re: [Tutorial] Edit Designs.dat so that AI use custom ship designs.

Posted: Thu May 16, 2019 8:12 pm
by Fusion_power
Interesting hack. I'll have to look at the designs.dat file and see what it needs to be compatible.

Re: [Tutorial] Edit Designs.dat so that AI use custom ship designs.

Posted: Wed Nov 20, 2019 3:40 pm
by OllyG

I've only just spotted DeadFire13's post back in March (must have forgotten to put thread notifications on). Thank you so much for trying to work out why I couldn't get it to work, and sorry you lost your very successful game in the process.

I will have another go at some point soon and hopefully it will work, as I've rediscovered my Critical Mass addiction recently...


Re: [Tutorial] Edit Designs.dat so that AI use custom ship designs.

Posted: Wed Nov 20, 2019 4:03 pm
by OllyG
This time, I have a more fundamental problem. When I open a copy of designs.dat in HxD, now my custom ships don't even appear, even though they are definitely there in the game! I am baffled...

Re: [Tutorial] Edit Designs.dat so that AI use custom ship designs.

Posted: Sun Mar 29, 2020 9:50 pm
by DeadFire13
I've had some more free time due to the Covid-19 novel coronavirus so I thought I'd make this video. I didn't have a decent microphone nor any experience in streaming or recording back then, but now I do, so here you go.

Video Tutorial. Game Version is 4.0h

OllyG, I highly suspect that you're getting your files mixed up. Pay good attention to the order that you're going in and the files that you're manipulating. Every time you press OK in the 'Design Ships' window, Designs.dat updates. If you're doing things one-at-a-time, and your file size isn't changing, all that should be happening is the replacement of Separator entries with the Custom Ship data.

Within Critical Mass, the 'Design Ships' window only updates when you 'open' it. If you modify the file (using a Hex Editor) while the window is open, you won't be seeing any changes. When you close the 'Design Ships' window, the game will overwrite the file with whatever was in the 'Design Ships' window (such as any changes in your custom ships in the Custom tab). The data within Designs.dat is only initially read by whatever Hex Editor, whenever you open it. If you changed the file through the game's 'Design Ships' window, it won't show in the Hex Editor. When you save the file, only then will it overwrite the old file with whatever changes you enacted in the Hex Editor.

For the non-tech-savvy people:

You don't have to start with a clean Designs.dat file. You have the backup as a safety to start again with.

The 'finished' file should be called Designs.dat.

If you want to remove one of your custom ships from the AI-usable list, copy over the ship data with the data from a 'Separator'.

You can add or remove whatever custom ships from the Custom Tab, and it shouldn't affect anything in the 'Ships' Tab.

Literally, you just want the ships of interest in the Custom Tab so that the data is stored on Designs.dat when you close the 'Design Ships' window (thus overwriting Designs.dat). Then you paste the data over the Separator(s) in a Hex Editor and Save to overwrite. Then open the 'Design Ships' window to see what you've done. After this point, you can do whatever in the Custom Tab at will.

Re: [Tutorial] Edit Designs.dat so that AI use custom ship designs.

Posted: Sun Mar 29, 2020 11:03 pm
by OllyG
Thanks for this.

I wasn't editing the .dat file with Critical Mass open, and was trying to be as methodical as I possibly could be, following your instructions to the letter.

I will try again when I'm back on Critical Mass using your video.