Making a game that is easily moddable / easy to create DLC for

Godot Version

Godot 4

Question

Hello people!
So I am working on a roguelite vampire survivors inspired game with procedural dungeon generation and Cod Zombies-like Easter Egg quests and perks.

I wanna make this game easily moddable, I wanna insert items / characters / whatever in custom groups or classes that my game can recognize, so that users can create custom things and insert them there so that the game is able to recognize them. (I’m basing myself a lot on Minecraft s system where things are suddivided and classified that way so modders can easily create custom items and entities)

But I’m TOTALLY LOST, it’s not something I have any idea how to do and since I just started developing the project I should get this working before proceed with other things.

So I was hoping that someone would give me a general idea on how to structure this or redirect me to some video or something to guide me.

I’m sorry if I am being dumb or not clear but I don’t have much experience in programming (even though I already programmed some small games already) and English is not my native language, I understand it fluently but I sometimes mess up words or phrases.

2 Likes

You’re not being dumb at all—this is a great question and you’re asking it at the right time, early in development.

Maybe this can give an idea? Im looking for just the right tutorial or source.


Core Idea for Moddability in Godot 4

In short, you want to:

  1. Define a system for loading content (items, characters, etc.) from external files.

  2. Let users create those files using templates or structured formats (like .gd, .json, or .tscn).

  3. Register new content at runtime so your game recognizes it.


  1. Use Custom Classes + Inheritance

You can create base classes that mods extend. Example:

BaseItem.gd

extends Resource
class_name BaseItem

@export var item_id: String
@export var name: String
@export var description: String
@export var rarity: String
@export var icon: Texture2D

Modders can create new items like this:

SwordOfFire.gd

extends BaseItem

@export var damage: int = 25
@export var burn_duration: float = 2.5

Or as .tres files using that class.

  1. Load Mod Folders Dynamically

Put all mods in a res://mods/ folder. Then scan and load them on startup.

func load_mods():
var dir = DirAccess.open(“res://mods”)
if dir:
for file_name in dir.get_files():
if file_name.ends_with(“.tres”) or file_name.ends_with(“.tscn”):
var resource = load(“res://mods/” + file_name)
if resource is BaseItem:
item_database[resource.item_id] = resource

Now all items are recognized and stored in a global item_database.


  1. Organize Content by Tags or Categories

Give each item a tag or category (like “weapon”, “perk”, “passive”) so you can group them, similar to Minecraft’s item groups.

@export var categories: Array[String] = [“weapon”, “magic”]


  1. Optional: JSON for Lightweight Mods

If you want non-programmer modders to contribute, you can also allow .json files like:

{
“item_id”: “ice_sword”,
“name”: “Sword of Ice”,
“damage”: 18,
“categories”: [“weapon”, “ice”]
}

Then parse the JSON and turn it into a BaseItem instance in your loader.


Extra Tips:

Use class_name to give items meaningful types.

Keep a global registry for items, characters, perks, etc.

Offer example mod folders so users can follow the format.

Consider using Godot’s FileAccess and DirAccess to read mod folders safely.

3 Likes

Thanks! I’ll have a look and see how I can make this work, the part about json for lightweight mods it’s great, I was already thinking about that.
By the way I’ll probably use .tscn as format for the mods (json excluded) since it will be easy to integrate into Godot. Have no idea how I’ll make that work assets wise though.
Since I’m a beginner it will be a tedious task, but I’m sure I’m gonna be able to make this game incredible.
Thanks again!

2 Likes

Please take the previous poster’s answer with a grain of salt. It seems like they just pasted in an answer they got from a generative AI. You should read this page in the docs instead.

There’s a bunch of things I think the previous poster got wrong, one of them is that FileAccess and DirAccess can’t read mod folders safely. They have no methods to prevent you from running malicious code in your mod folder. Neither does ResourceLoader or load(), it’s something you’ll have to implement yourself or look into a plugin that loads things safely.

5 Likes

I agree that the first reply looks AI generated. Shame. But there are some pointers.

I entertained the idea of a moddable game a while back and I have some tips!

  • You were right to disregard JSON. Godot’s serialization system works great for data. And also - you want scripts. Programming new custom logic is the true power of mods, not just supplying new structured items.
  • Look into the user:// folder prefix in Godot. I believe it would be easiest to put the mods there.
  • Take inspiration from the way Godot editor handles plugins! Since the editor is a game, plugins are pretty much mods! Their API and principles are useful. (Things like strucured folder and the .cfg file to kick off the main plugin .gd file)

Good luck!

3 Likes

That’s a shame, just realised, I was busy and had read it very approximately.
Thanks for the docs page!

1 Like

Oh cool! Thanks for the tips, I didn’t ever think to look at the engine and plugins that way, thanks.

1 Like