Hello there! My name is Flora Key, and I have been developing a couple of mods for the video game Cassette Beasts in private for almost a year(!) now. In that time, I've gained a lot of intimate knowledge about how both the game and Godot 3 itself functions, and I wish to spread what knowledge I've gained in a long, but hopefully simple-to-understand primer for those looking to get into modding for this wonderful game. :)
I'm also making this because as it stands right now, modding for the game is still in its early days. There is a lot of information out there about modding that is not widely known, incomplete, or even at times potentially harmful to the broader modding "scene" at large! This article seeks to provide tips and tricks for those seeking to implement mods for the game, for someone that may have the programming skill to understand some of Cassette Beasts' inner workings, but may still struggle to implement features into their mods.
Important
NOTE: This article is a work in progress, and will update with new tips as time continues. Check back in every once in a while for more information! :D
In the context of this article, redirection refers to the act of ''displacing a value or file referenced by the base game in favor of one present in one's own mod''. As of right now (the date I'm writing this being June 14th, 2025), many mods continue to use redirection (in the form of Resource.take_over_path()
or the official system of using the "Modified Files" section of the metadata.tres
file of the mod) in order to implement various features into the game. However, redirection is harmful to mod compatibility, and creates a kind of issue known as a race condition.
A race condition is a situation in programming where the order of inputs or order of execution impacts the result of the task at hand. This often occurs in the context of parallel programming (i.e. for programs that utilize more than one thread, but can happen in a non-parallel context with modding! For example, if two mods were to use Resource.take_over_path()
to redirect the file at res://data/battle_moves/trick.tres
to one that includes their custom status effects alongside the defaults, only one mod's status effects would be included in the pool of status effects for Trick. The version of the file that gets loaded is determined by the last instruction given to change it, disregarding any other mods that wish to redirect the file. For more critical resources, scenes, or scripts, this might genuinely render the other mod completely broken, and may require one party to act defensively to avoid having their mod fail to work correctly (which is still at the cost of other mods)!
Note
When it is at all possible, prefer alternatives to redirecting. If you cannot avoid redirecting a value or file, make the surface area of your redirections as small as possible, and try your best to make sure that you can recover in the event the file no longer points to your mod.
Alternatives to file-level redirection include, but are not limited to:
- If it is information that does not need to be accessed by the main game, consider creating a custom parameter within the resource or keeping the information within the source code of your mod—this allows the information to be exclusive to your mod without having to save it persistently!
- If you have to change something that is accessed by the game, prefer to do so at a parameter level (i.e. an individual variable being redirected or mutated), rather than a file level.
- If the value is an array or dictionary, you are also able to simply append to it with no cost! This works well for things like pools of resources like the kind seen in the move definitions for Trick and Treat.
- It is often the case that you can patch new behaviors into scripts to allow for content to be added in a mod-specific manner instead of changing the resources directly.
- However, if you decide to go down this route, make sure you are very careful. Because you are changing the internals of Cassette Beasts itself, you could potentially seriously break things in brand-new and unexpected ways!
- In general, you should never need to delete lines of a file's source code, so make sure there's not an additive method of avoiding other code in the file that you could utilize!