You are viewing a potentially older version of this package. View all versions.
Index154-SpawnConfig-1.2.2 icon

SpawnConfig

Configure enemy spawning with custom groups, weights and more

Date uploaded 2 weeks ago
Version 1.2.2
Download link Index154-SpawnConfig-1.2.2.zip
Downloads 4016
Dependency string Index154-SpawnConfig-1.2.2

This mod requires the following mods to function

BepInEx-BepInExPack-5.4.2100 icon
BepInEx-BepInExPack

BepInEx pack for Mono Unity games. Preconfigured and ready to use.

Preferred version: 5.4.2100
Zehs-REPOLib-2.1.0 icon
Zehs-REPOLib

Library for adding content to R.E.P.O.

Preferred version: 2.1.0

README

SpawnConfig

This mod allows you to change several things about the enemy spawning behavior in the game. It is intended to be used for modpack balance fine-tuning. Only the host needs to have it installed. Small warning: Taking advantage of this mod requires you to have a basic understanding of json file syntax. In return it offers a very high degree of configurability!

Here's a list of what's made possible by the mod:

  • You can modify or remove the vanilla enemy groups and add your own custom groups
  • Support for custom enemies added by other mods!
  • You can change how many enemy groups spawn based on the level. You can also add multiple possible group count configurations for the same level for some randomness / variety
  • You can assign weights to fine-tune how likely each enemy group is to appear
  • You can control whether a group should only be able to appear before a certain level or after a certain level
  • You can make a group only spawnable if the host player has played more than a certain number of runs
  • A group can be set to not allow any other groups to spawn if it happens to be selected. Use this if you crafted something truly devious and grand
  • You can add extra variety to a group by configuring a chance for it to sometimes be bigger or smaller by a configurable range
  • There is a global setting in the mod that lets you disable enemy spawning entirely

Getting started

  1. These important files and folders will be generated in your BepInEx config folder after launching the game:

    • Index154.SpawnConfig.cfg => The global config of the mod which is comparatively simple. Contains descriptions for each available setting. Please take a look at it!
    • Subfolder SpawnConfig:
      • SpawnGroups.json => Edit this file to modify, add and remove enemy groups
      • SpawnGroups-Explained.json => This file contains information about the properties of SpawnGroups.json and how they work. Please check it out to learn more about the rules the other file has to follow!
      • GroupsPerLevel.json => Edit this file to change how many enemy groups spawn per level
      • GroupsPerLevel-Explained.json => Contains corresponding explanations for the contents of GroupsPerLevel.json! You should read it!
      • Subfolder Defaults:
        • SpawnGroups-Readonly.json => This file just exists as a reference and is not meant to be edited! It contains the configs for all groups the game has loaded before your custom config was applied. So the enemy groups added by other mods will be found in here as well. The file is overwritten on every game launch
        • GroupsPerLevel-Readonly.json => This file just exists as a reference and is not meant to be edited! It contains the vanilla groups per level configs. The file is overwritten on every game launch
  2. Make your edits in the files SpawnConfig\SpawnGroups.json and SpawnConfig\GroupsPerLevel.json. Just read the explanations and follow the example of the vanilla entries and you'll be fine. Or replace the file with one made by somebody else if you want! Changes will take effect only after restarting the game

  3. Have fun!

(optional) Keep reading for further details.

Known incompatibilities

  • SpawnConfigPlus by onecoolsnowmanMods
  • TierSpawnConfig by Dev1A3
  • MoneyBag Valuable by Oooppp (no clue why this one is problematic. I tried to contact the creator but have not received a reply)
  • Most likely any other mod that makes major changes to how enemy spawning works in the game

Enemy names

You need to know the internal name of an enemy in order to be able to add it to the spawnObjects list of a group in your SpawnGroups config. The names in your config need to be exact matches, otherwise it will not work!

The names of all enemies, including modded ones, will be logged to the console when you start the game. Here's a list of the vanilla enemy names.

  • Enemy - Head = Headman
  • Enemy - Robe = Grim reaper
  • Enemy - Hunter = Huntsman
  • Enemy - Runner = Reaper / Scarecrow-looking guy
  • Enemy - Beamer = Laser clown
  • Enemy - Slow Walker = Trudge
  • Enemy - Animal = Animal
  • Enemy - Bowtie = Fat guy
  • Enemy - Floater = Mentalist / Alien
  • Enemy - Hidden = Invisible man
  • Enemy - Tumbler = Frog chef
  • Enemy - Upscream = Small crawling head
  • Enemy - Valuable Thrower = Rugrat / Baby
  • Enemy - Ceiling Eye = Peeper
  • Enemy - Duck = Duck
  • Enemy - Slow Mouth = Spewer / Puke thing
  • Enemy - Thin Man = Shadow child
  • Enemy - Bang = Exploding skull
  • Enemy - Gnome = Gnome

If a group contains an invalid enemy name then you will see a corresponding error in the log when you launch the game. A group containing an invalid enemy name will be ignored entirely by default. You can change a setting in the global config file to make it so all invalid enemies will simply be removed from the group if you prefer. In that case the group will still be able to spawn as long as it contains at least one valid enemy.

For mod developers

  • As long as you register your custom enemies properly with REPOLib they will be supported by SpawnConfig
  • SpawnConfig FULLY replaces the functions AmountSetup() and PickEnemies() in EnemyDirector.cs!

What else?

Here's a video for a quick and simplified overview of how enemy spawning works in REPO: https://www.youtube.com/watch?v=Yx-PW4qYEHY

CHANGELOG

1.2.1 / 1.2.2

  • Fixed small mistake in the Thunderstore description where I copied some text and forgot to change it

1.2.0

  • You can now configure how many enemy groups of each tier will spawn on each level! Finally! The relevant files for this are GroupsPerLevel.json and GroupsPerLevel-Explained.json which will be generated after launching the game once
  • Also added a new global config setting Group count multiplier
  • Updated the Thunderstore description to mention the new functionality and info about the new config files for it (also added a list of incompatible mods and changed a few minor things)
  • alterAmount logic will no longer make sure that there is at least one enemy left in a group
  • The option Re-add missing groups is now disabled by default
  • "Director" enemy objects will no longer show up in any of the logs
  • Changed the names of the files in the defaults folder

1.1.4

  • Fixed the mod for REPO v0.2.0
  • Added REPOLib as a dependency and implemented a possible fix for custom enemies sometimes not being detected due to load order. Thanks to onecoolsnowman for the original implementation in his fork

1.1.3

  • Hotfix for minLevel and maxLevel values getting reset on every game launch after the first one
  • Expanded some explanations in the SpawnGroups-Explained.json file that is generated when you launch the game

1.1.2

  • Tiny hotfix for random range max being inclusive now
  • Removed link to python script from the description due to being outdated

1.1.1

  • Fixed inaccurate / confusing levelsCompletedCondition logic. The values in the config now have new names and actually behave as you would expect them to behave (they were previously off-by-one). Your old values should be migrated automatically upon launching the game. They will not be changed. Still, I recommend making a backup of your config to be on the safe side. If some of your groups are intended to behave the same as in vanilla then I also suggest you compare the new min and max level conditions from your config to the ones in the SpawnGroups.json in the "Defaults" folder
  • Fixed several incorrect default group weights: The vanilla tier 3 groups with multiple enemies in them (for example "Enemy Group - 4 Ceiling Eyes") are actually much rarer than the "regular" tier 3 single-monster groups in vanilla. I've adjusted the default weights for these groups to 1.5 (previously 100) to reflect the actual vanilla spawn chances. Yes, you read that right, they're about 67 times rarer. If you have an old config file containing these groups with their previous default weights of 100 then these will NOT automatically be adjusted! You have to change the weights manually if you want them to have their vanilla spawn chances! Launch the game once and then check the SpawnGroups.json in the "Defaults" folder for reference
  • As a side-effect of the above change the difficulty weights for the groups are now floating point numbers so you can make your weights a bit more precise if you want

1.1.0

  • Added new config "Repeat spawn weight multiplier" which reduces the chance of getting the same enemy group multiple times on one level. Default value is 0.5, meaning a group will become half as likely to be selected after having already been selected once
  • Added new config "Ignore groups with invalid spawnObjects" - If true, groups containing any invalid enemy objects will be ignored completely and cannot spawn. If false, only the invalid objects will be ignored and the group can still spawn with its remaining enemies. Default value is true (same behavior as before)
  • Updated the ThunderStore mod description with some new info

1.0.3

  • Fixed alterAmountChance fields not being included in the config file

1.0.2

  • Fixed alterAmountMax not being selectable by the randomization, whoops (off-by-one error)
  • Prevented NullPointerExceptions for when there is no enemy group available for a difficulty tier at all
  • Added Discord links to README

1.0.1

  • Fixed description formatting

1.0.0

  • First release!