How could I implement the modder-friendly features listed below?

Godot Version

4.3 Linux

Question

Here is a list of modder-friendly features I’ve always wanted in games, typically those with RPG or strategy elements.

  1. Store most simple data tables (such as equipment data, ability data) in *.csv (text) files that are loaded and parsed when the game is started, and which are accessible by the player without anything more complex than a text editor, and make the game run without issue when these assets are modified.

    Here is an example of a data table, though I would rather do it with integers and plain English text separated by commas than hexadecimal:
    http://sf.data.project.tripod.com/item_data.txt

  2. Store visual assets (sprite sheets, 3D models, etc) in a place accessible to the player, and make the game run without issue when these assets are modified.

  3. Use midi for audio, and let the player modify everything about this while also storing it outside the engine & game logic.

  4. Design more complex features that are typically hard-coded (ability formulas, reaction abilities, passive effects) as a sort of Lego-style thing where all the possible effects are broken down into their smallest components, and then the logic of each formula/ability/effect is then stored as a data table (editable by the player) which is sort of interpreted to produce the desired effect.

  5. Develop a scripting system separate from Godot Scripts for events on the field, in battle, and on the world map, with which I can do things like implement shops, modify inventory, modify character data blocks, modify save data, and so on.

  6. Release a list of important/essential battle/menu /etc subroutine/function/method headers (function name, parameters, short description, list of other released functions called therein) and addresses of said functions in the compiled game, so that people who develop mod extensions to the subroutines aren’t screwed over by game updates like Skyrim modders usually are.

  7. Possibly develop a modding API.

  8. Somehow develop a coherent and comprehensive packaging system for mods that range from vanilla game with minor modifications to asset overhauls/replacements to entirely new campaigns.

I want to do all of this while also keeping my games closed source, and otherwise maximally protecting my code and IP.

I have 15 years of modding and romhacking experience, and about 3 years of college education in computer science. I’d say I’m a moderately skilled coder.

  1. I like JSONs more but I believe Godot will also be able to handle *.csv files although you have to rename the file to *.txt
    Here is a code snippet that you may want to test
extends Node
var example_dict = {}
func _ready():
	var file = FileAccess.open("res://some_json.txt", FileAccess.READ)
	while !file.eof_reached():
		var data_set = Array(file.get_csv_line())
		example_dict[example_dict.size()] = data_set
	file.close()
	print(example_dict)
  1. I really hope your game is only playable on Windows PCs or else it might get wonky and inconsistent. Every Godot game has a local userdata folder on the computer, accessible via this button here
    grafik
    You can also access this directory in code via user://
    In order for the game to run “without issue” with assets modified, you need to establish a code workflow which is capable of scanning files inside of the user:// folder, detect new files and then load the resources into the game. Of course it depends on the type of resources that you want to use. 3d blender models may be harsh on performance but this is something you need to test after establishing the workflow

  2. Godot has Midi players and also plugins in concern to midi playback. Your statement of “let the player modify everything about this” is very very broad and difficult to work with. You can alter the pitch, playback-speed, whether to play it forward or backward, set on loop or not, even splice the audio and cut off parts. If you want to save the altered midi, then you also need to design a system to save the file into your user:// folder, detect duplicate files, etc. Most likely you will be able to save it as an audiostream, but not a a .midi file.

  3. Sure, I wouldn’t think that would be impossible and mostly dependent on the ability of the game designer and engineer

  4. I am not quite sure what you mean with “scripting system”. Several plugins allow the structuring of visual scripting which allows for users to generate custom scripts that is decoupled from godot’s editor (especially for dialogue). I would not understand why anymore would want to modify the inventory or implement shops that way. At that point, it would be more convenient to establish a database that’s run inside or outside Godot and then access the Database to change inventory and player data information

  5. Godot is capable of automatic documentation of every class and system via comment structure which can then be manually compiled into lists. I am unfamiliar with Skyrim’s modding system but I believe Skyrim was engineering to be mod-friendly in comparison to other games.

  6. Can’t answer that

  7. This is all part of game vision design. For example, Age of Empires has a feature to load custom created campaigns just by dropping a folder into a specific place. Godot can do the same although it depends heavily on system’s design to make it possible.
    For example having an empty “campaign” folder which can have several campaigns inside. The game loops through all campaign folders and then lists them ingame.
    For ingame models, you could establish a naming system and the game by default uses the default models. If the same model_name exist in another folder (for example “mod_models”, that model will be applied instead of the default model. Of course this is easier for 2d games than 3d games. You need to design a system to convert a spritesheet or model into a file_resource that Godot can work with while also excluding incompatible files (maybe by checking the image-width and height to ensure the image can be used as a spritesheet).

Godot is capable of encoding and decoding, it also supports the use of security hashes. The inbuilt ZIPReader class can be extended to implement more custom considerations (like reading and evaluating metadata)

1 Like