Modding replace faction

From Wildermyth Wiki

This page walks through the process of replacing all the monsters in a faction. The focus is on getting something simple which you can see in the game, and adding more details later. The description and screenshots are current as of July 2020, early access version 0.23+148 Triss Thornfire.

Main concept

Today, modders cannot add factions. The game is hard-coded with five factions. But, you can replace all the monsters in a faction and change the name. Why would you do this, instead of just adding new monsters without factions? Because of calamities. In other games, you can make a large "family" of monsters with stronger and stronger abilities, and use an "encounter table" that maps the party's power level against the monster types. So, low level parties will encounter easy monsters and high level parties will encounter hard monsters. In Wildermyth, for the most part, low and high level parties encounter the same monsters; but calamities make the monsters stronger or add special effects. Hopefully, this makes encounters interesting for parties of all levels automatically.

If you want to add one monster for one event, you can do that, but you can't really tune it to be an interesting encounter for both a low level party and high level party. It's better to redefine a faction, and use the calamity system to make the monsters stronger as the party grows stronger.

Here are the steps to replacing a faction.

  1. Add monsters. The basics of adding monsters are described in this tutorial: Adding a monster. Most factions have 5-9 different monsters.
  2. Change the faction name. This has some limitations; As of today, your name won't show up everywhere, and there are some images you can't change.
  3. Update the calamities.
  4. Add the "tracks" for generating monsters.

Change the faction name

The file assets/text/dynamic/dynamic.properties contains the faction name. Change this to override the name in most places. For example, to rename Drauven as Bandits:

drauven.singular=Bandit
drauven.plural=Bandits
drauven.name=Bandits

Currently there are at least two places this change won't affect. When you create a campaign using your modified faction, you will often "lock" the campaign to one enemy; for example, the builtin campaign "Enduring War" locks the main enemy to Morthagi. In the "new story" dialog field for "main enemy", the old name like Drauven will still appear. Also, in the page which displays calamities, there is currently no way to change the small image that appears at the top of the column, circled in red below. All the bandit calamities will still appear under the header which is an image of a drauven.

MonsterReplaceCalamity.png

Update the calamities

All of the calamities are listed in the file assets/data/calamity/calamities.json. Today, there is no way to "merge" calamities between different mods. So, if it happens that two mods change this file, the file from the mod with higher priority will take effect, and the other files with this name will be ignored. The file contains all the calamities, one after the other, for all the factions. Each calamity looks like this:

{
	"weight": 0.35,
	"card": {
		"id": "buff_yab_dagger_GAINS_armor",
		"category": "buffMonster",
		"flavor": "drauven",
		"monsterIds": [ "yab_dagger" ],
		"aspects": [ "calamityBuffMonster_armor" ]
	}
}

The key is to find all the calamities in the file where "flavor" matches the faction you are replacing, which may be scattered around in the existing file. As you will see, there are 3 basic types: GAINS_armor, GAINS_health, GAINS_damage; GAINS_range is no longer used and always has "weight:0" to prevent it from appearing. There are also several faction specific types, like GAIN_imposeConcuss and GAINS_imposeMindworm. Later, you could add your own aspects as described elsewhere on the wiki.

For now, add the three basic calamities for each of your monster types. It may be easier to do this using cut and paste in a text editor.

If you accidentally leave some monsterIds which refer to the monsters you removed, then the player may see these calamity cards appear, even though the monsters they refer to will never appear.

Add tracks

The tracks section is similar to the "encounter table" you may find in other games. The related file is: assets/data/generation/monsterDecks.json. As with the calamity file, only the file from the highest priority mod is currently used. Each of the five factions appears in its own "groupFlavor" section, and each monster has its own entry in the "tracks" section. Here is a section of the monsterDecks file for Gorgons.

"tracks": [
	{
		"name": "track_gorgon_deer",
		"advanceWeight": 1.4,
		"cards": [
			["gorgon_roe"],
			["gorgon_roe", "gorgon_roe"],
			["gorgon_roe", "gorgon_roe", "gorgon_roe"]
		]
	},
	{
		"name": "track_gorgon_raccoon",
		"cards": [
			["gorgon_coon"],
			["gorgon_coon", "gorgon_coon"]
		]
	},
	{
		"name": "track_gorgon_bear",
		"onlyIfFlavorHasCards": 4,
		"cards": [
			["gorgon_gheist"]
		]
	}
]



Seeing the effect in game

  1. If you haven't already done so, enable developer mode. (Save and exit before doing this.) In file explorer, create an empty file under steam\steamapps\common\Wildermyth called devmode.txt.
  2. Choose tools from the game main menu, then select combat lab. This will give you a chessboard-like battle map with a few characters and monsters already spawned.
  3. In the "Generate a unit" dropdown at the left, choose "Davea's monster" and then click Side A. Your monster should appear: