Dev Diary 8: Modding!

The new frontier… The perils of the unknown… The great difficulties and the great hope for the next generation? No, I’m not talking about colonizing Mars. I’m talking about the greatest technical risk we took on with Surviving Mars: building the game for modding support.
Haemimont Games has shipped a cool 15 games on various platforms, but not one of them has had official modding support. And modding was something Paradox wanted from the very beginning of the project. Games that welcome the players to join in the creation are loved more, played more, and live more, they said. What’s the point of partnering with a well-respected experienced publisher if you don’t heed what they say?

The bad news was that over the previous several games, the data loading process of our engine had been optimized in the opposite direction, to be as monolithic and economical as possible, to allow for minimal loading times. This had to be reversed, and many types of data can now be loaded in pieces, or late after the game has started, to allow for asset authoring and tested.

The good and much more important news was that our games are written in a mixture of two programming languages: C++ to handle the low-level stuff like graphics, audio and talking to the underlying hardware; Lua. Which allowed us to implement virtually everything you think of as “game”, from the simulation logic of the colonists on Mars to the user interface that allows the player to control them. And Lua is not only much easier for modders to learn – it’s also easy to be loaded from different places, even when the game is running. We knew that we needed to give modders this ultimate power, to modify and add new Lua code to the game.

The overarching goal of the mod support is, in the words of Alan Kay, simple things should be simple, and complex things should be possible. For the simple part, we identified a handful of small but impactful changes to the game that can be implemented by anyone who’s not afraid of their computer. Mission Logos, for example, let you leave your imprint on every building of your colony. You only need to supply a simple, transparent PNG file

[​IMG]

Mods are a popular way to allow user-provided translations of the game to new languages, and we’re glad to see only days after release several community-sourced localization efforts.

[​IMG]

Radio Stations let you bring your favorite music on Mars – and also your annoying DJ alter ego if you want.

[​IMG]

Once you’ve struggled through your first few colonies, you may want to guide other players into your playstyle. Your own Mission Sponsor or Commander profile is an excellent choice for that. You have at your disposal the same tools our designers had – and unlike them, you don’t need to concern yourself with silly notions like “realism” or “balance”.

[​IMG]

More complex mods can include 3D art assets to be used as buildings or decorations in the game. We chose the popular (and free!) Blender authoring tool and wrote our exporter for it – it is shipped with our modding tools. You can then add it to the game as a new variation of an existing building, inheriting the original building’s logic but modifying some parameters. Or you can implement an entirely new logic, such as the Cemetery provided as one of our sample mods, which serves as an eternal resting place for your deceased colonists and provides comfort and continuity to the living.

[​IMG]

Finally, for the ultimate power with the ultimate potential for head-scratching, long hours of debugging, and potential for greatness, we allow you to plug any Lua code into the game, modify its systems or even replace some of them. For example, normally a Surviving Mars playthrough starts with your rocket landing on a pristine corner of Mars; what about if you could encounter the remains of previous colonies that tried and failed on that very spot? Our sample mod Time Capsule changes the rules of the game to allow just that.

[​IMG]

We prepared extensive documentation to help you get started with modding the game, but as any programmer knows all too well, sometimes there’s no replacement for taking a look under the hood. This is why we will ship a significant chunk of Lua – virtually all the game code – as a reference to adventurous Lua modders.

The modding tools in Surviving Mars are just a starting point in our effort to support the modding community. From now on we’ll listen to feedback, improve things, write more documentation, provide more sample mods, and anxiously check your latest creations. Tell us what you want! Surprise us!

More info @ https://forum.paradoxplaza.com/forum/index.php?threads/dev-diary-8-modding-by-ivan-assen-ivanov-from-haemimont-games.1083114/

Leave a Reply