4 ms·
Ask HN: How to make a game that will be easy for others to mod?
I want to develop a game and make it a hassle free experience for other developers to make mods for it.
However, I don't want to open source my game because I would like to sell it.
My idea was to create a kind of API that others could hook into to add and modify content in the game. The idea would be similar to a frontend using a REST API to interact with the backend.
I wonder if there are best practices when it comes to making your game modable. How is it usually done by professionnal game devs?
- yuppie_scum 5y agoLook at what Doom and Quake did before they were open sourced. I think the keys there were releasing the data formats, open sourcing dev tools, and permitting mods to be loaded easily. Also engaging with the community helped.
- captaindiego 5y agoEmbedding a Lua (or similar) interpreter is a somewhat common method in the games world. This allows modders and develipers to easily add scripts which can use APIs exposed to Lua.
- nassimsoftware 5y agoI'm curious to know why lua would be good compared to python for this purpose?
- Jensson 5y agoLua is made to be embedded into another program and makes that easy, python is not. Python is for writing glue code, Lua is for writing code to be glued together.
- nassimsoftware 5y agoOh I see, thanks for the explanation!
- iamevn 5y agohere's a good post on the topic (from 5 years ago but things haven't changed too much afaik) https://eev.ee/blog/2016/04/30/embedding-lua-vs-python/ https://eev.ee/blog/2016/04/30/embedding-lua-vs-python/
- h2odragon 5y agoObserve Factorio and do what they do, as far as you can. Expose everything to Lua that you can, document well, if you can cultivate a community then it can guide you.
- Pozzuh 5y agoYou could consider making only the game's code open source, keeping its assets proprietary. That way you are still able to sell the game normally.
- nassimsoftware 5y agoThis seems like a good idea but how would you prevent reskins?
- maxilevi 5y agoMake the core content of your game a mod itself. That kind of design will ensure your API is always up to date with the game.
- nassimsoftware 5y agoThat's a good idea thanks.
- mbrodersen 5y agoYep that’s the best way to do it. Your game is just a mod on top of a runtime platform/engine.