Modding Preferences

Making this thread especially for @intenscia and @nDoJoy to continue the conversation outside of the comments on that one post.

For Cantata, I’m really interested in trying to meet modders where they’re at, and not be too restrictive (or perscriptive) with how they go about modding the game.

I can say right now this is how basic things break down w/r/t modding:

In Game Only:

  • Actually “building” the map - ie. placing terrains, units, etc. and exporting a .cscenario file

Possible to be out of game:

  • Creating new Interactables
  • Creating new Terrains

The final result of most of these is basically just a .json file and a .png (scenario files don’t have a .png), so people could easily crack open a scenario file and edit it. I’m working on my end to make sure I basically validate any scenarios that have been added to the mod directory, to make sure they work in the game. I can think of a few ways that you could break the loading, but what that mostly would result in is a map that doesn’t look right so I don’t think people will necessarily do this.

That said, to your question from here, right now mods will have a single directory structure that sits inside Unity’s “StreamingAssets” folder. This is directly accessible by all users on all platforms, so you could easily place mods together.

I’m very interested in the idea of atomic modding, and Cantata supports that to a degree. Nothing yet about one terrain from one mod makes it incompatible with a terrain from another mod, nor are two interactables necessarily incompatible. This means that a given scenario can hold terrains and interactables from different mods together.

I have a bigger idea about a “Ruleset”, which basically acts as a whitelist for Interactables and Terrains, that way modders (and me) are able to enforce a degree of constancy in the game.

What do you both think about that? What kind of interface for modding would you want to see in a game? Is it better to have open file formats, or should files be binary instead?

Managing mod compatibility is hard, a bad JSON file isn’t anything to worry about, it will happen. It’s nowhere near as bad as older games which have executable mods.

The goal is to be able to support total conversions (i.e. mods that change maps, have new interactables and terrains). That’s pretty easy as i’m assuming you mostly have that. Going a step further and having atomic mods (i.e. the ability to mix and match different mods together is the dream). Most games unofficially support that, just no guarantees about what will happen. I’ve spoken to the creator of that atomic modding github repo should you want to talk to them.

Rulesets are required if your game is balanced, multiplayer and things will get out of whack without them. Otherwise guidelines are better and just let modders get creative.

Open file formats would be nice, but if it restricts the power of mods then consider binary, that’s a design decision based on flexibility, performance i’m assuming?

1 Like

Hahah, from the perspective of a player, I want it all; from the eyes of a dev, sounds like a headache.

If the mod formats are binary, that would seem to necessitate an in-game or standalone editor. If they were .json players could use whatever text editor they want. The latter seems a lot simpler, but what happens when players start changing their local mods and want to hop into an online game together? That’s my only concern with a .json format. Overall I would prefer it to binaries.

1 Like

I definitey lean as well to open formats - right now everything is JSON but saved as a .cscenario file. You can just open the file in a text editor and pretty easily see what’s going on.

I think in terms of online play, and the way it’s currently implemented, you can think of it like Civilization’s multiplayer implementation mixed a bit with how Starcraft 2 or Warcraft 3 handle online play. Basically every multiplayer match has a host, and that host would choose the Ruleset players play under. Any players that don’t have that ruleset download it from somewhere like mod.io before joining, and then the game ensures everyone is in sync.

I can see issues where like a player modifies a downloaded ruleset locally, then lobby players download a version that is the same in the ways that matter, ie. Name and Unique ID or something, but the lobby players ruleset is different. Maybe lobby hosts need to validate against an existing ruleset? @intenscia is there a way you can do that with mod.io? Basically a validation call?

I also don’t know what exactly to do with a player who wants to host a lobby for a map they just made but haven’t uploaded the mod to a repo at all yet. Maybe I’m hosting a map it always gets uploaded and tagged with their steamid?

You can attach hashes to mod files, and validate the hash / checksum. The game could still be modified to post a fake checksum, but it’s decently strong

1 Like

@intenscia That’s a great idea. Would the has be baked into the mod itself it sent along with it to a server?

you could check the mod files md5, you could bake a checksum + salt into the files metadata. Lot of ways to do it, i’d pick which is easiest for you to do. The metadata side is more work because you have to control the mod submission flow (to include the metadata), or you would have to write a post processor when a file is submitted to add the metadata after the fact (which means your modders could still use our online form to submit mods).

The md5 sounds like a possibly better option, just because I think any text baked into the mod file itself could be edited. So I’m thinking it’s something where, if you’re playing online, you ensure the mod’s MD5 matches one on the server, and then any other players in a lobby download the matching ruleset. If it doesn’t match, maybe you can’t use it for multiplayer? You have to upload you map maybe? That doesn’t seem like too crazy of a restriction?

You can build anti-cheat systems forever, it’s like playing whack a mole. Usually a simple deterrent like this is enough. The point at which cheating becomes a problem is the point at which your game is huge and highly competitive, so i’d expect you have the resources to better tackle the issue then anyhow. So the MD5 approach is probably the most efficient for now

Yeah I think from where I’m at, I’m less concerned with cheating and more at a place of just making sure two people are playing on the same map haha. So yeah, MD5 seems like the best option!

So, I just went back and re-read the Modding 101 blog post. I really hope a basic modloader makes it into the next version of the alpha. Even if you can only do it by editing .json files and have to reboot the game, it would be worth it to start seeing what can be done.

I also think that this aspiration near the end:

What I’d really like to do is make a hosted website dedicated to creating/sharing all things related to Cantata modding (beyond just Interactables), so that people can “mod” the game from only a web browser and not even need the game itself to make buildings/units/terrains/etc, but all things in time.

sounds perfect for mod.io. And with only ten games on the service as of yet, they would probably be able to work really closely with the team getting it up and running.

Also, I hope there will be no/very few limits on what aspects can combine, e.g. CanSupply and CanMove together could be a mobile re-supply unit to overcome holes in your supply lines (maybe the cost is very high and they’re lost if you move out of range), or CanLoadUnload along with CanSpawn for drone carrier-spawner type units.

What I’m saying is, even if some combinations don’t make it into the main campaign/unit balance, I hope they are all possible through mods.

Also, will we be able to implement patterned movements, like how CanAttack can define firing patterns? For instance chess-piece movements? I just implemented a basic Knight L-jump in A*, had to code all eight possible patterns (from starting square) but that’s not too much to ask from a dedicated modder…

1 Like

I really hope a basic modloader makes it into the next version of the alpha

That’s definitely the hope! Even outside of things like “modding”, this enables some outside collaborators I’m working with like @Maren to easily test new theories about units. Right now I have to essentially tweak on my end and then rebuild the entire game. Adding in “mods” here means that it has positive upstream implications and allows the Cantata team to just work better together!

sounds perfect for mod.io

That’s definitely the hope/idea. Ideally though mod.io is the repo for mods, but the mod builder (like in the screenshot in Random Dev Nuggets) would have the ability to actually upload mods to mod.io. Then as a user you can browse mod.io for mods (or also browse in-game).

I hope there will be no/very few limits on what aspects can combine

Right now there’s no limits! The only thing that is required is that if a unit CanSupply, it has to also have the CanBeSupplied aspect, but that’s it (and sensible imo)! I’ve definitely tried some moving + supply lines things, but there are some circumstances around that I need to plan for to make it more robust, as right now combining those two things kind of breaks things :slight_smile:

even if some combinations don’t make it into the main campaign/unit balance, I hope they are all possible through mods

That’s definitely the intention! I suspect we’ll only use a subset of combinations that makes sense for Cantata, but that shouldn’t prohibit people from doing other crazier things as well! I’ve thought of crazy mods and can’t wait to also just be the user of the system as well to make weird stuff.

Will we be able to implement patterned movements?

I never actually considered this! Right now it’s just movement ranges, but I could see putting something like this in the game if people in the mod community really wanted it!