Modding Tool [1.1.0 Released!] (Full Version)

All Forums >> [New Releases from Matrix Games] >> Distant Worlds Series >> Design and Modding


Sabranan -> Modding Tool [1.1.0 Released!] (2/24/2016 6:42:58 PM)


This tool is designed to be used with Distant Worlds: Universe. It will not work with any older expansions or plain DW. It "may" work with older versions of Universe, but I'd recommend just using the latest which is

I am in no way affiliated with Code Force or Matrix Games, this tool is entirely a personal project.

Editing Capabilities:

It can edit most of the files you would want to change if you were making your own mod. This includes the ďrootĒ files in a mod folder which are:

about.txt, components.txt, facilities.txt, fighters.txt, governmentBiases.txt, governments.txt, plagues.txt, raceBiases.txt, raceFamilies.txt, raceFamilyBiases.txt, research.txt and resources.txt.

The only current limitation in editing the above files is the index of each project cannot be changed. This will likely be enabled in a future update.

It can also edit all files in the races, policies, dialog, characters and designTemplates subfolders.

There are certain files it does not edit:

agentNames.txt, characterNames.txt, colonyNames.txt, designNames.txt, designs.txt, GameText.txt, shipNames.txt, systemNames.txt and systems.txt.

The reason for excluding the above is that editing those files doesn't require the user to reference anything outside of the line they're editing, so there's no advantage to doing it in a form as opposed to a standard text editor.

It doesn't edit the help files, because there's plenty of MHTML editors out there that can do it far better than I could program a tool to.

It doesn't edit pictures or sound files, again, there are far better programs for that kind of work. However, where pictures or sound files are referenced, it'll let you select which one to use and show you the picture or allow you to play the sound file. Upon outputting, itíll copy any picture or sound files youíve selected into your mod folder and rename them appropriately.


The tool works by loading all relevant files in your mod folder into the toolís memory. When you change anything in the tool, the change is not made directly to the files. Your files are only changed after clicking ďOutput to DiskĒ.

The first time you output changes, backups will be made of any changed files or subfolders. I still recommend that you make your own backup of your mod folder before editing it with my tool though.

From the main menu you can select the mod you want to work on, and what section you want to edit.


There are a few advantages to using a tool like this as opposed to text editing.

Firstly, it helps prevent simple mistakes like missing a semicolon or adding an extra space or comma. DW might still load in these cases, but can behave strangely due to a simple typo.

Mostly though, the tool helps by making it easier to know exactly what youíre editing. In the research.txt file youíd see something like this:


Most modders will remember off the top of their heads that the first value after the PROJECT ; is the project ID, and the next value is obviously the name of the project. But after that itís just numbers, requiring you to scroll up and reference the big block of text at the top of the file to find out what the next values mean (in this case theyíre the Tech Level, Row, Industry, category, Special Function Code and Base Cost Multiplier).

On the next line itís even worse, because the component IDís arenít stored in the research.txt file, so youíd have to go open the components.txt file to know what number to put in there. Then you have to look up the component type to even know what the other values represent.

Finally you have the parent line, which is relatively simple because it happens to be referring to the project before this one (Advanced Laser Focussing in this case).

By contrast, using this tool you can open up the research form from the main menu and select the project (you can also type the first few letters into the box to use the inbuilt search feature displayed) you want to edit. Iíll use the same project here as an example:


As you can see, everything is now not only labelled, but those numeric values that are a reference to something else (Industry, category, Special Function Code and Parent Project) are displayed by name. Theyíre all in drop down menus so you can easily set them without having to open up anything else.

Hitting the ďImprove ComponentsĒ button will open up a subform showing you this:


Basically a visual view of the component improvements line, showing you not only the name of the component (again, this can be changed by selecting the component from a drop down menu) but also what each of the values means.

Just a small example of how much easier the tool makes modding all the major elements of Distant Worlds.

Latest Version: attached!

Sabranan -> RE: Modding Tool (2/25/2016 3:38:45 AM)

Well it's been almost 9 hours since the initial release, time for a new update!

The Mod Editor can now write a research file. I've set it to forcibly make a backup first, because now it can write data it can (and quite probably will) foul up your mod. That said just using the default values it does write a file that actually works when used in game.

You might notice that even if you don't change anything, the file it outputs is a few KB's smaller than the original inputted file. This is because the program removes any tab characters in the file to make things a bit simpler.

Any value you change is applied internally immediately, the only things you can't change are the Project ID (because that would confuse the hell out the program) and you can't yet make a new project. Of course you can always just stick a new "PROJECT ; somenumber" line in the research file manually and then edit it with the program from there.

Your changes are not saved to the research file until you hit the button on the Main Menu that says "Output Changes to Disk". Until that point you're safe to make whatever changes you like, so don't press the button unless you're sure you haven't screwed up somewhere!

I've updated the OP with the latest version.

Sabranan -> RE: Modding Tool (2/29/2016 1:57:57 AM)

Now, I realise this game is not as popular as once it was. It's been almost 6 years since release after all, so I can totally understand a drop-off in how many people are playing and by extension, modding the game.

But nobody is interested? Really? Not that I'm doing it for the props or anything, but I must admit I expected someone to say "hey, this looks really promising!" or maybe "hey, your tool would look better in green" or even "hey, your tool sucks eggs and you are a tool!".

Just a little bit depressing that nobody can be bothered to say anything at all lol.

That said, here's version 3. The main menu now handles all file reading/writing (initially I had it so each form only dealt with its own data) so it's all in one place ready for combining information from different files later on. After choosing a mod folder you'll notice only two of the buttons become active, the Research button and the Racial Family Biases button.

These features work, both reading and writing. The Racial Family Biases is the new feature for version 3, and all those other buttons will become working as I release new versions.

Iíve updated the OP with the latest version.

Shogouki -> RE: Modding Tool (2/29/2016 3:42:56 AM)

Depending on how it works I might give it a shot. Though it would be a few weeks out before I could. And yeah, I do wish this game was still popular for modding. I would really love to see an expansive technology mod that primarily focuses on creating a balanced tech tree.

kbobbato -> RE: Modding Tool (2/29/2016 12:23:19 PM)

I think that this game still has a lot of people using it. Maybe these forums are not as active as they once were. But I downloaded version two yesterday....and am subscribed to this thread. I am currently working on a warhammer 40k mod. And am trying to stabilize someone elses 40k that has not been active in like a year. So this tool will come in handy. Recreating the research tree is a very tedious task. But if you take away some of that tedium that would be great. Thanks for taking the time to make this program, it is going to be very helpful to me in the near future.

Osito -> RE: Modding Tool (2/29/2016 4:47:15 PM)

The sub-forums for DW are often a little sluggish I'm afraid. To be honest I think most of the modding for DW:U has probably been done, and most people are just waiting (hoping) for DW2. Another problem is that you're not the first to try to work on this type of project, so we may be a little sceptical, and, sadly, some people are reluctant to run '.exe' files from the Internet.

A couple of years ago, a tool like this would have been really helpful to me, but if I'm honest I probably wouldn't use it now.

That's not to say it isn't a worthwhile project, and some, like dawnstorme, may still find it useful, so I certainly wish you luck with it.


Sabranan -> RE: Modding Tool (2/29/2016 6:56:16 PM)

Ah shucks thanks guys, thatís all I really wanted lol. I realise that this tool is unlikely to kickstart a new era of DW modding but primarily I started designing it for myself anyway, Iíd never done any sort of DW modding before and to a new modder the text files look awfully daunting because theyíre mostly just filled with numbers.

So I figured the process of coding for it would teach me a lot about how DW stores and parses data and itís definitively done that.

Then I realised actually this is a problem facing any modder, even experienced ones are not going to remember all the component numbers of the top of their heads. So if it ends up helping others too then thatís great.

Osito I have noticed the other main attempt at making a project like this, in fact that was one of my ďgo toĒ threads as a lurker. It looked gorgeous, but after the point where an alpha release was being talked about everything seemed to go wrong.

Iíd like to think mine is different even though itís in the early stages because Iím releasing once I get a new feature working right, so you can use it from day 1. The other project has been running for two years and as far as Iím aware nobody ever got to see it beyond screenshots (which looked awesome, but at the end of the day are just pictures). Of course from the sound of it real life has been doing what it does so while itís a shame itís understandable.

I do take your point about people maybe being unwilling to run exe files from the internet, especially from a new poster when an exe was their first upload lol. Iím not sure I can really get around that at least initially, but if a few longer term posters use it and confirm itís ok then maybe people will be more willing to give it a go.

Right now Iím working on the raceFamilies file, so I expect version 4 to be released in a few hours.

Sabranan -> RE: Modding Tool (2/29/2016 11:01:36 PM)

And we're done, version 4!

Retreat1970 -> RE: Modding Tool (3/1/2016 12:04:05 AM)

Thanks, I'll check it out.

Sabranan -> RE: Modding Tool (3/1/2016 5:21:13 AM)

Version 5 is up, it now has the Race Biases working. Also using the version system that Visual Studio provides, so this is 0.0.5. Once I have all the buttons working I'll move to 0.1.x, then 0.2.x etc as I look into the various subfolders. Once it's all working I'll release 1.0.0 and then up it from there as it becomes prettier, more efficient or with new features.

The Race Biases file was a bit more of a pain lol, the original file isn't well formatted. Some entries have spaces at the start, some comma-separated values have spaces and some don't...

It does mean that the actual output file is cleaner than the input one, which is nice.

Shogouki -> RE: Modding Tool (3/1/2016 6:01:56 AM)

Nicely done. I'm looking forward to trying this.

Sabranan -> RE: Modding Tool (3/1/2016 10:08:07 PM)

Ok, good news and bad news...

Bad news is any downloads prior to 0.0.6 aren't going to work. Turns out clickonce applications require deploy & manifest files to do anything much...

Good news is I think I've got the auto-update functionality working. So once you've downloaded 0.0.6 you "shouldn't" have to download new setup files. Just run the app and it'll auto update off my NAS.

Sabranan -> RE: Modding Tool (3/2/2016 3:14:10 AM)

A couple more buttons done and a new feature for 0.0.7!

Government Biases and Plagues are now working.

As a side note Plagues was a real pain, it's by far the biggest form so far with 14 values for each Plague and a potential for 50 different plagues. I may have to look at making the forms a bit more responsive, if you're viewing it on any resolution other than 1920x1080 it could be a pain. For now scroll bars will appear if there's things outside of the form so you'll at least be able to use it.

Not only that, but in the last value (the description) they use commas, and they're already being used as separators! That sure made for some fun coding around that.

The new feature is that it'll now store up to 10 mod folder paths in the registry, so you should only need to select your mod folder once. After that it'll appear in the list of recent folders for easy access.

If you're interested the values are stored under HKEY_CURRENT_USER\Software\Distant Worlds Mod Tool, this contains the app name and a list of mod paths.

If you've already installed 0.0.6, just run it and it should ask if you want to update.

Sabranan -> RE: Modding Tool (3/3/2016 4:59:36 AM)

Latest release includes some bugfixes on the last one, 0.0.7 wasnít saving changes properly to the Plagues data. Should be sorted now.

Version 0.0.8 includes the resources file, and I'm pretty happy with how this turned out. Potentially it was even bigger than the plagues one, what with its 10 basic values for 80 potential resources.

Then location information having 5 values each for each location.

The original resources text file never had more than 4 such groups of locations (which would have made 30 total fields per record all on its own), but nothing in the file or modding manual indicates it's limited to 4Ö

Iím not 100% sure itís right but Iíve limited it to 10. Iíve done that on the basis that a mineral only has 7 potential planet types + 1 asteroid to be on, while gases have 2 planet types + the 8 cloud types. I donít think you can put any given resource on more than 10 locations unless youíre mixing gases with minerals, which the modding guide tells you not to do.

I've gone with using a combo box to select the resource you want to change, it makes for much more pleasant viewing than the way the plagues file is currently implemented. Once they're all done I'll go back and make them all the same way for version 1.0.0.

For now, enjoy version 0.0.8!

Sabranan -> RE: Modding Tool (3/4/2016 6:00:54 AM)

0.0.9 is here, with the ability to edit the fighters file.

Nothing special to say about the fighters, but rather than waiting for 0.1.0 to address the plagues form I've just gone ahead and redone it now. While it did work it looked horrible even on a 1080 screen and took a while to load on my computer (with an SSD and i7 extreme processor). God only knows what it would have been like on something less powerful or with a 720p screen.

It now looks a hell of a lot more user-friendly, and loads instantly too.

This is my (rather basic) overview of what's happened so far and where I expect it to go:

0.0.0 Project Begins

0.0.1 Research File Read
0.0.2 Research File Write
0.0.3 Racial Family Biases
0.0.4 Racial Families
0.0.5 Racial Biases
0.0.6 Auto-Updates + Actually Works
0.0.7 Government Biases + Plagues + Remembers Mod Folders
0.0.8 Resources + Plagues Fix
0.0.9 Fighters + Plagues Redesign
*We're here now
0.0.10 About file
0.0.11 Governments
0.0.12 Facilities
0.0.13 Components

0.1.0 All root text files redesigned + working
0.2.0 Race Information Working
0.3.0 Policy Information Working
0.4.0 Dialogue form
0.5.0 Images linked in (pictureref fields should display image, select by file)
0.6.0 Sounds linked in (sound file fields should play sound, select by file)

0.7.0 Will leave this version up for a few weeks to request feedback to fix any bugs, implement any good suggestions etc.

1.0.0 Everything functional

I've learned/remembered a lot as I work through these forms, the newer code is a lot cleaner and easier to edit and the forms look much nicer, so the older stuff will get redesigned to my latest standard for 0.1.0 (with the obvious exception of plagues, just couldn't stand looking at that any more).

Sabranan -> RE: Modding Tool (3/4/2016 11:16:47 PM)

I've been on a roll recently, generating a lot of code automatically (thanks MS Excel) saving me a lot of time. Still a lot of work but I can now knock out a standard form in an hour as opposed to around 5 hours.

Thus, I'm a few versions ahead of where I expected to be today. I've just uploaded 0.0.13, meaning all the root forms are done! Next up will be redesigns of the forms, getting them all up to a decent standard for using. Not that's it's horrible now or anything, but it could be improved and some of the original code was not as clean and tidy as it could be. The whole program is starting to look a bit more professional though, which is nice.

So this would be a very good point to give me feedback on form layout and make requests in preparation for the 0.1.0 release!

Moddders, what would make the process easier for you? What fields do you tend to mod, how should they be grouped? Is it intuitive enough to use as soon as you open it (does it work at all? Nobody has told me!)?

Sabranan -> RE: Modding Tool (3/6/2016 4:03:48 AM)

I wanted to do a post on updates, since anyone running a version that has them enabled is probably getting the prompt to update quite often.

Whenever you run the tool, before the main form actually appears itíll look up my NAS and see if thereís any new updates. If the version on my NAS is higher than the one youíre currently running, itíll ask you if you want to update.

Each time I publish an update I have the option to set a minimum required version. As long as youíre running a version higher than this, itíll let you skip the update if you want. If not, it still wonít force you to update but it wonít let you run an earlier version either.

My plan at the moment is to only to set a minimum version when I hit key points, right now that means 0.1.0, 0.2.0 and 1.0.0.

Iíll make an exception to that rule if I fix a bug in a release that has the potential to corrupt any of your mod data. If that happens Iíll set the minimum required version to the one above the version with the bug.

At the time of writing this is set to 0.0.8, as that version fixed a serious problem with how it was writing the plague data (it was basically replacing the plague file with another one).

So you can rest assured that if the program is telling you that you have to update, thereís a good reason for that and you should do so.

Now, the versions number of the app actually has a forth number, the revision number. With the latest update this is shown in the app as well. I publish revisions at least once whenever Iím working on it, so you can potentially have several a day. Revisions will be simple bug fixes, redesign of a form or another small update of that nature.

Sabranan -> RE: Modding Tool (3/6/2016 3:07:55 PM)

The latest revision has an example of just how sexy this could end up being (just run the program and accept the update to have a looksie). If you load up a mod and enter the research form, Iíve done a proof of concept for the ďEnable ComponentsĒ and ďImprove ComponentsĒ sub forms.

Normally youíd look in the text file where youíd see a list of comma-separated Component IDís and that determines which components your research project will enable. Of course Component IDís are just numbers, so in order to know what research project youíre enabling you have to go open the components file and look it up.

With this tool you just select the component from a drop down list. That means you donít have to go looking anywhere else and youíre much less likely to make a mistake and input the wrong value because you can see the component name.

More importantly, when you select your component in the ďImprove ComponentsĒ sub form, all the labels update on the fly to tell what youíll actually be improving! That was a huge amount of work, but it should make things so much easier for actual modding.

Naturally it still outputs the correct simple numbers to the text file.

Shogouki -> RE: Modding Tool (3/9/2016 11:42:38 AM)

Looking good!

Sabranan -> RE: Modding Tool (3/9/2016 4:03:13 PM)

Thank you Shogouki!

If you (or anyone really) can confirm for me that the auto-update process is working thatíd be great. Itís all well and good that itís working for me but I have no real way to test that itís working outside of my own network.

If it is working (and youíve accepted the update) you should be running version 13 revision 11, and itíll tell you so in the about box on the bottom right of the main menu.

Right now Iím polishing up the forms for all the root files, research is pretty much done so Iím onto components. That looks like it could be a bit of a bugger, there are 66 component types and each of them could have up to 7 modifiers.

Might need a couple hours to knock that outÖ

Sabranan -> RE: Modding Tool (3/9/2016 7:02:37 PM)

Just published revision 12 with an updated components form. Itís looking pretty good now, should be much easier to mod a component off the form than it is to use the text file.

Sabranan -> RE: Modding Tool (3/10/2016 11:27:48 AM)

And with revision 13 we have the facilities and resources (and locations subform) forms updated with drop down boxes and variable labels. Still got fighters, plagues, race families and governments left to do.

Those forms only have a couple boxes to do and are nowhere near as complex as some of the ones involving variable labels. As a tool for modding the root files in a mod folder it's looking pretty damn sweet now.

Once that's done it just needs some testing and debugging and then I'll be at 0.1.0!

Sabranan -> RE: Modding Tool (3/10/2016 5:35:58 PM)

And I'm there, 0.1.0 is out!

Due to the number of bugfixes in it and the fact that itís the first update with all the root stuff working as I want it to I've flagged it as an obligatory update, which should mean it'll just download when you run a previous version. I've updated the attachment in the OP as well if for some reason it's not working (incidentally, I kept getting "file is too large" errors doing that, the limit is apparently 9999kb and the file is only 251kb, weird).

It's now in a decent state if you want to edit the root files. I think I've got everything working as it should but as always, watch for bugs and please let me know if you come across anything.

Next up will be the races subfolder, which I've no doubt will be a mighty big job since each file holds 130 variables and there doesn't seem to be a limit on how many races you can have!

Iíll be releasing revisions as optional updates as I get bits of that working. Unless the program ends up doing something tragic along the way the next obligatory update will be 0.2.0. By that point all the subfolders should be working along with some sort of nice interface for the various picture and sound references used in the forms.

Shogouki -> RE: Modding Tool (3/11/2016 6:04:17 AM)

I just wanted to say thanks for doing this, I'm definitely looking forward to trying this out.

Sabranan -> RE: Modding Tool (3/20/2016 10:36:37 PM)

Revision 4 of 0.1.0 now reads the races subfolder and displays it a bit more pleasantly. There's still more to do with the races form though:

The names need to be a bit more user friendly (and in some cases, fit in the labels).
Some fields need changing to drop-down boxes or check-boxes.
Needs to be able to output changes to the folder.

In the meantime, feel confident that progress is being made!

Hattori Hanzo -> RE: Modding Tool (3/21/2016 3:30:41 PM)

hello Sabranan, first of all my compliments for your DW Modding Tool release !!! [&o]

now my usal "noob" question: I read all the posts but I'm still feeling a bit confused..

I'm not sure of having understand at which revision we are now: 12, 13 or 4.. ??? [&:]

and if the current version is still read-only or if we have now the ability to make saves with it.

Sabranan -> RE: Modding Tool (3/22/2016 4:44:13 AM)

Hi Hattori!

The revision number resets back to 0 with each new build.

I only publish revisions so you can see how a new form is coming along, the program will ask if you want to update to them but you don't have to. Whenever I update the OP it'll be for a new build, which means a new working form.

Right now all the "root" forms (so research, components, resources etc) are done, you can read and save your changes to these files.

At the moment I'm working on the Races subfolder, you can't yet save changes to the race files in there.

Hattori Hanzo -> RE: Modding Tool (3/22/2016 3:35:51 PM)

thank you Sabranan for your concise, clear and comprehensive explanation:

exactly what I need to adventure myself in the unexplored dungeons of modding.. [:D]

Sabranan -> RE: Modding Tool (3/25/2016 5:42:37 AM)

4 revisions and over 1,000 lines of code later and we're looking at revision 8 of 0.1.0, which reads the races info in a pretty satisfying way. Still some work to do here.

There's a few fields (the disallowed components, disallowed governments and the 3 research project order fields) that can have multiple ID's on them so I need to find a way to allow handle that and it's not yet ready to output the races data to actual files.

That said, I don't really foresee any real problems with the output, it'll just take a while to code. If I can solve the first issue too then all that's left is to pretty up the form a bit and we'll be on 0.1.1!

Sabranan -> RE: Modding Tool (3/28/2016 3:05:01 AM)

Revision 9 is published, this contains my solution to the previously mentioned problem. Basically those 5 fields that can contain several id's work by adding items the user selects into a list box. When you select an item from the drop down box it'll add it to the list box, allowing you to see at a glance what components or governments are in the field. Adding the same item again will delete it from the list box.

That might sound confusing, but hopefully it'll be fairly self explanatory when you guys run the program.

I've come up with something a bit sexy for the research project order fields, you'll note the 3 small buttons next to the boxes. V makes the list visible, U moves an item in the list up and D moves it down. That should allow users to easily add, remove and manipulate items in those lists.

Still doesn't output to the disk, that'll be up next in revision 10.

Page: [1] 2 3 4 5   next >   >>

Valid CSS!

Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI