How are games made ‘moddable’ without revealing source code?

1.09K views

Do they just have a very abstract and capable API? some mods for some games can be pretty complex.

In: Technology

6 Answers

Anonymous 0 Comments

Having modded Factorio, Stellaris, and Space Engineers, I feel slightly qualified to attempt an answer.

For these three games, the actual game content is not part of the source code. Factorio, for instance, runs the base game as a mod, that you could disable. The game exe is the source code that grabs all files pertaining to the game, and loads them, and has very little of the game content within, only having the game engine to make the content all work together.

Moddability is also very different from game to game. For instance, Space Engineers allows mods to run actual code, C# I think, while blocks and items are defined using something else.

Factorio mods use Lua for everything, which means what the mod can do is only limited by what the devs allow.

Stellaris uses base text definitions and a simple base text scripting unique to Stellaris in particular. Even the other Paradox games don’t have all the same functions, or even have functions not available to Stellaris scripting.

There are advantages, and disadvantages, to each of these approaches. For instance, since Stellaris is so simple, it’s relatively easy for anyone to do something in it. However, documentation is specific to Stellaris only.

Factorio using Lua means you can use all that documentation, but Lua is a bit more complex, so some might be turned away.

Space Engineers is incredibly event moddable due to the choice of code directly run by the game. But is still limited by the API of what the devs allow modders access to.

You are viewing 1 out of 6 answers, click here to view all answers.