Modding replace faction
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.
- Add monsters. The basics of adding monsters are described in this tutorial: Adding a monster. Most factions have 5-9 different monsters.
- 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.
- Update the calamities.
- 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.
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"]
]
}
]
There are several important points.
- Smaller monsters will eventually appear in packs. For example, the Roe will initially appear in groups of one, but later it may appear in groups of up to three. In game, you will see monster cards like "Gorgon Roe II", where the roman II means that two of these monsters appear at once; this corresponds to the second entry in the cards array which lists two. It is certainly possible to have different monster types in the same card entry. This could be a little confusing since only one image appears to the player.
- Some monsters are prevented from appearing early in the game, by the entry "onlyIfFlavorHasCards". For example, the bear will only appear, after the calamities column for this faction has at least four cards. Calamity cards are added at different points during the game, and sometimes subtracted in the chapter interval. This roughly measures your progress through the game. For monsters which can appear at the beginning, don't place any value; for more advanced monsters, use increasing numbers. It's unlikely that as many as 10 calamities will appear for the faction, so numbers in the range 4-8 are probably best.
- For the introductory mission, only the first two tracks can be selected. Place your most "introductory" monsters here. In addition to onlyIfFlavorHasCards, there are some rules in the game engine about introducing new monsters slowly.
Remove all the tracks for the old faction monsters, and add one track for each of your own monsters. You should decide which monsters should have "packs" by multiple card entries, and use onlyIfFlavorCards to roughly set the order in which monsters will be introduced.
For each track, you will also need to add a display name which appears as the title of the calamity card. You can set this in assets/text/dynamic/dynamic.properties:
yab_dagger.name=Brigand yab_dagger.blurb=All daggers, and all out of targets- until now. monsterCardName.track_yab_dagger=Brigand monsterCardBlurb.track_yab_dagger=All daggers, and all out of targets- until now.
The first two lines give the name and description of the monster; the second two lines give the name and description of the calamity card. I happen to have used the same text for both.
Seeing the effect in game
- 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.
- Start a new game, make sure that your faction is the "main enemy", and enable the cheats such as "objective cheat".
- In the introductory battle, exactly one monster drawn from your first two tracks should appear.
- Use the objective cheat to win the first battle; you can add more calamity cards using the cheat menu to make sure that your monster types are appropriate.