Back in 2009 a friend and I were sat in the university library when we decided to give reverse engineering Dune 2000 a go, a classic RTS released by Westwood in the late 90s. I can’t remember why we decided to do it other than it seemed like a good idea at the time. Neither of us had experience reverse engineering binary files at that point, although as a teenager I had spent a fair amount of time in the Grand Theft Auto mod scene, mostly making missions, buildings and multiplayer scripts. My friend ended up not going further with the reverse engineering however I decided to continue with it. Little did I know the project I was embarking on.
We started by looking at the map files and tilesets that went with them. We quickly established the structure of the map files, starting fresh research that a couple of years later led to the first campaign map editor for Dune 2000 by Klofkac which extensively used the research by myself, Lewis and DaxxXyrax. I also looked at the tileset files, which were reasonably straight forward and ultimately led to a tool I developed which allowed tilesets to be exported and imported to and from PNGs that could be edited in Photoshop.
The vast majority of my research however went into the mission files. The community was hungry for new campaigns, for over a decade the only missions for Dune 2000 were the original three campaigns made by Westwood. Very little progress had been made modifying mission files in the community, people had realised that in the first mission they could modify the amount of money needed to win the mission and that it was possible to chance the diplomacies of sides (for example make sides enemies, allied or neutral). Almost entirely however, mission files were 68 thousand byte black boxes.
I spent the next two years reverse engineering the mission files. Detailed discussion of what that involved would probably be tedious to read and also I don’t think I can remember too much of it. So I’ll instead briefly discuss the biggest (solved) challenge of the mission files. Early on someone found that modifying certain bytes in certain mission files affected reinforcements. We knew from substituting mission files for each other that the mission specific logic was all contained in these files, but we had no idea how that logic was structured. Getting my head round how this logic was structured let alone the byte representation in the files took a very long time.
Unfortunately the way the actual logic is stored does not have strong indicators of repetition or patterns. However I did have a vague idea of the part of the file this logic was stored in and through perseverance and repeated testing of file modifications I eventually isolated the exact range of data and grouped the data into events and conditions. Each event had a type indicator and its own specific information, it also references conditions with boolean flags to flip the value of the condition. Conditions themselves are similar in that they have a condition type and their own data. For example a reinforcement event would store the side it belonged to and what it contained and then link to a time based condition so that the reinforcement would occur after a specified time. Fully specifying the conditions and events took a fair amount of time (and there are still a couple of unknowns). Once this was complete however I had enough pieces to finish the mission editing tool.
After over two years of research, head scratching and tool writing I released the Dune 2000 Mission Editor along with initiating the research that allowed a campaign map editor to be created. Between these two tools it was possible for the first time in the history of Dune 2000 for modders to create new missions for the game. I also created a new string table editor, tile set editor, sound effect packing tool, as well as partially complete UI layout and resource file editors. Working with CCHyper I also released a patch for Dune 2000 making it possible to play as the sides in the game other than the three playable sides that shipped with the game (such as smugglers, mercenaries, Fremen, Corrino). As all of the editor and mod releases were on the forums and quickly slipped down the topics to be hidden I created a dedicated website to host both the toolkit of mod tools I had created as well as modifications made with the tools by the modding community.
Reverse engineering Dune 2000 was a long process and I have learned a great deal during the time I spent doing it. While for most the time I was working for alone, I am extremely grateful for the times other modders got involved and made progress. There are now a number of new missions and campaigns released by the community and seeing these mods created feels extremely rewarding after spending a long period of time trying to get meaning out of a screen full of hexadecimal numbers. I recently announced that I was leaving the Dune 2000 modding scene, my original goal was to facilitate new campaigns to be created by modders. With this goal complete I feel it’s a good time to stop.
I will continue to administrate the D2K+ website and add any new mods or tools that other people create and would like listed. As always I’ll read the forums and I’ll be excited to see what developments are made, this is the end of my involvement in modding Dune, but as the blog post title alludes there’s plenty more life left in the mod scene.