matterickson / UTO

MIT License
1 stars 0 forks source link

How to make a game moddable? #6

Open matterickson opened 3 years ago

matterickson commented 3 years ago

This issue will be used to discuss what is needed to make this game moddable, what features should be moddable, and how to do it properly.

matterickson commented 3 years ago

Some quick links to start the discussion off: https://www.reddit.com/r/gamedev/comments/15qbip/how_to_make_your_game_moddable/ https://www.reddit.com/r/gamedev/comments/15rq5o/how_to_make_your_game_moddable_lets_get_more/ https://www.reddit.com/r/gamedev/comments/z20j6/what_would_you_like_to_see_in_a_mod_system/

matterickson commented 3 years ago

A good rule of thumb is to use externally linked, non compiled files to define game elements, behavior, and environments. An extreme example is a full scripting interface.

As we are using lua, a non-compiled scripting language, this seems like the ideal situation for a moddable game. It looks like PhysicsFS might be able to handle the 'installation' of mods easily but more research will be done on PhysicsFS in #3

matterickson commented 3 years ago

There are a lot of people pointing out the importance of something like a map editor that users can use to make their own maps for our game (we just have to follow the same file format the editor uses). One guy recommended Tiled, https://www.mapeditor.org/

Since we're thinking it will likely be procedurally generated I don't think this comment really applies but I thought I would add it here anyway for any discussion.

matterickson commented 3 years ago

Have dynamic asset loading that allows people to add to your asset and class paths by just adding folders and files to a predefined location (eg: an Addons folder). And let those files take precedence over the loading of the core game files.

Another good point from another redditor. It will be important to have a 'mods' folder the mods can go into. They will need to overwrite our existing files if they follow the same name, for full customizability for the modder.

matterickson commented 3 years ago

Document the limitations of your game. For instance: "Don't attempt to load textures larger than 4096x4096, because it crashes the texture loading."

We should define a list of properties we want moddable, and properties we don't. Then we could impose limits on those if we want, or just let modders do what they want and if it doesn't work that's on them.

VinceyBoi2 commented 3 years ago

Might need to consider how much 'heavy lifting' we are willing to do for mods, e.g. catching errors in their code to prevent crashes etc.

Been using Tiled myself for a while now and it's a really good tool to get started with if you're using premade elements in your game. However, Tiled also comes with a lot of other fluff that can make navigating the exported files a bit of a hassle. As you said though, since we're going for procedural generation it might not be necessary to use anyway.

I think going for a 'recommended' list of properties to change might be the easiest way forward. That way we can put in some error catching on the recommended stuff, and anything not in the list is fair game but error prevention is the modders responsibility at that point.

matterickson commented 3 years ago

Great points Vince, heavy lifting as you worded it is something we will likely want to implement to a certain extent. Maybe we can discuss some 'obvious' properties here like gravity, speed, max speed, etc, make a some-what complete list then create a new ticket to finalize the list of 'Features' we want to develop.