Enemy Classification and Restriction on Specific Waves

That’s impressively close :+1: .

What follows is a technical explanation of what goes on behind the scenes.

Each enemy instance can be one of 3 categories: barrier, poultry, or miniboss (this is decided programmatically for each wave, the random generator doesn’t come into play at this stage). Each category is divided into tiers (what @Sammarald calls “classification” above). Some enemy types are shared between categories (e.g. UFOs can appear either in the “poultry” or in the “miniboss” category).

For a given difficulty, each tier has a specific probability (weight) of being selected with respect to other tiers. After the tier is randomly selected, an enemy type within that tier is also randomly selected. Each enemy type also has an assigned weight (when I “prevent cowards from spawning”, what I’m really doing is setting their weight to zero). In a similar way, entire tiers can be excluded (or amplified) on a per-wave basis.

Example: This is the graph for the poultry category. X axis is difficulty (the lighter part is 0%-100%, graph goes up to 150% or so), Y is the relative frequency (appearance probability) of each tier. Tier colors are: red=chicks, yellow=chickens, green=metals, aquamarine=elites, cyan=saucers, blue=minibosses.

image

You can see that for 0% difficulty, only enemies from the “chick” tier can ever be selected, whereas for a 140% mission, only “metals” or above.

28 Likes