Modding Preferences


#1

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?


Modding 101: Interactables and Aspects
#2

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?


#3

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.


#4

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?


#5

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


#6

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


#7

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).


#8

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?


#9

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


#10

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!