- Home /
How easy would mod compatibility be?
I have had an idea on the back of my head for a while that involves letting the user create mods and importing them into games. I have heard that mods with Unity games are a pain. My idea involves importing scripts, models, audio, and textures. Would this be possible at all? If so, what is the easiest way of doing this?
Also: Is it possible to get it working with steam workshop?
Answer by HenryStrattonFW · Apr 24, 2015 at 09:43 AM
Unsure about any Steam Workshop integration. But there is no reason you couldn't provide mod support for a game, you just have to design it with that sort of dynamic content loading in mind. To cover all the asset types you may need, AssetBundles are a great way to get things like models, audio, and textures into your game (textures can also just be loaded on the fly but I'm not aware of if this is possible with audio or meshes).
As for scripts, A common approach would be to integrate something like LUA into your project, this allows mods to be write scripts in an language that is processed at runtime, you just have to write the rest of your game to setup how and what those user scripts can do (what /how variables can be set, how that data is then used by the game etc). There are some assets on the asset store for LUA integration, although I've not used any of them myself. https://www.assetstore.unity3d.com/en/#!/search/LUA
Sorry for not going into detail on how some of this can be achieved, but it is possible.
Lua integration and AssetBundles seems like the best way so far. Thanks!
Answer by Fappp · Apr 24, 2015 at 10:29 AM
It's managble. But requires a lot of work. For starters 3D models, what you have to translate:
Vertice index ( geometry )
materials ( shading )
mapping coordinates for textures
All of this in a file format easy to read and load in Unity ( xml? )
I would suggest diving into WebGL. Link With early versions of three.js basically everything had to implemented through code. This leads to a much better understanding what the engine actually does when putting things on the screen. It's a in depth question you're asking here, and it requires a LOT of research and a huge amount of skills imho.
Probably the easiest route to take is creating modding tools with saving abilities right from within the Unity Editor. Like a model editor or texture painter. Or write a editor extension so other user can mod your game with the Unity editor itself.
When I think about it... The unity editor is actually a modding tool for the Unity engine...
Your answer