Skip to content

Creating Enemies Categories

Cromha edited this page Apr 24, 2024 · 9 revisions

Introduction

An enemy category or list is a dictionary of enemy ids pools that're used in map points (and other places) to make enemies spawns. Enemies categories are found in the lists.yaml file. So, an enemy category definition has only 2 attributes: an id and a list of strings that are the enemies ids. Here's an hint: you can add more of an enemy type than another, so you can choose the enemy type percentage rate.

Explanation

In every enemy list, you find different entries, which're pools, that afterwards randomly pick enemies from itself. The game engine will go through every pools one by one, and run a random percentage calculation, until one of the pools get chosen. Once a pool's chosen, the game engine randomly determine how many enemies there'll be, following on the enemies rate dictionary. After that, it'll look through the enemies spawns dictionary and run a random percentage calculate, to determine if the current enemy should be picked up, until there're enough enemies.

An example of an enemy category definition:

desert raids:
  South Pillagers:
    name: "You find a group of South Pillagers on your way!"
    chance: .65
    enemies rate:
      easy: {"min": 1, "max": 2}
      normal: {"min": 1, "max": 4}
      hard: {"min": 2, "max": 4}
    enemies spawns:
      South Pillager: 1
  Mumakil:
    name: "You find a Mumakil on your way!"
    chance: .15
    enemies rate:
      easy: {"min": 2, "max": 2}
      normal: {"min": 2, "max": 2}
      hard: {"min": 2, "max": 4}
    enemies spawns:
      Mumakil: 1
      South Pillager: 1
  Desert Troll:
    name: "You find a Desert Troll on your way!"
    chance: .2
    enemies rate:
      easy: {"min": 1, "max": 1}
      normal: {"min": 1, "max": 1}
      hard: {"min": 1, "max": 2}
    enemies spawns:
      Desert Troll: 1

# South Pillagers pool rate: 12/20
# Mumakil pool rate: 3/20
# Desert Troll pool rate: 4/20

And the syntax:

<enemy list id>:
  <entry id>:
    name: <text shown(str)>
    chance: <percentage(float)>
    enemies rate:
      easy: {"min": <min spawn number(int)>, "max": <max spawn number(int)>}
      normal: {"min": <min spawn number(int)>, "max": <max spawn number(int)>}
      hard: {"min": <min spawn number(int)>, "max": <max spawn number(int)>}
    enemies spawns:
      <enemy id>: <spawning chance(float)>
  • <enemy list id> // this is the id of your list.
    • <entry id> // this is the id of one of your entry. Also called pools, you can have as many as you want.
      • name // this is the text message that'll be shown when summoning this enemy.
      • chance // the percentage of chance this pool has to be chosen.
      • enemies rate
        • easy
          • min // the minimum number of enemies to spawn on easy difficulty mode.
          • max // the maximum number of enemies to spawn on easy difficulty mode.
        • normal
          • min // the minimum number of enemies to spawn on normal difficulty mode.
          • max // the maximum number of enemies to spawn on normal difficulty mode.
        • hard
          • min // the minimum number of enemies to spawn on hard difficulty mode.
          • max // the maximum number of enemies to spawn on hard difficulty mode.
      • enemies spawns
        • <enemy id> // the id of this key should be the id of the enemy. The value of this key should be the percentage chance of spawn of this pool entry.
Clone this wiki locally