PAYDAY 2: Commissioner Garret's Budget: design document:

Problem:

The current code for cop spawn waves is completely hardcoded and has no potential for combining custom cop mods, alongside being a complete pain in the ass to edit.

It also does not take into consideration anything like dead civs or hostages or any of that.

Goal:

Provide a simple to use easy method to implement custom cops without overriding other modders changes and allowing for more freeform wave designs that react

to how the heist is progressing.

Solution:

The solution is rather simple on paper. The cop spawning code will rely on a Budget, refreshed and determined at the end of each wave, and the start of the heist for the first wave.

There are 4 main define types here:

the LEVEL

the COP GROUP

the BUDGET STATUS

the DIFFICULTY

A LEVEL define exists in the code for each level. It loads if the current level is the same as its ID.

The LEVEL holds the following details:

Level ID: the ID that corresponds to this level define for the budget.

Base Budget: What is the default budget for this map for spawning cops?

Main Enemy: Either SWAT or Akan. COP GROUPS that do not have the same Enemy Group as the level's Main Enemy will not spawn.

Subgroups: Any COP GROUPS marked as a subgroup will only spawn if that subgroup is included in the level define, like Mendozas.

For Example:

Jewellery Store:

Level ID: "whatever_the_store_id_is"

Base Budget: 1000

Main Enemy: "swat"

Subgroups: nil

A COP GROUP define exists in the code for each group of cops that could spawn. It spawns and loads if the budget can afford it and all the criteria is met.

the COP GROUP holds the following details:

List Of Enemies: list of enemy ids to spawn

Cost: How much will be subtracted from the wave budget to spawn this cop group

Enemy Type: SWAT or Akan, or if its a subgroup, that subgroup, such as Mendoza.

Required Wave Multiplier: What is the required wave multiplier for us to spawn? If not defined, always potentially spawnable.

Required Difficulty: Same as above, but for difficulty. If not defined, always potentially spawnable.

Required Dead Civs: Only show up if X amount of civvies are dead.

Required Hostages: Only show up if Y amount of civvies are hostages.

For Example:

3 Blue SWATs and a Taser

List Of Enemies: list("id_for_bluswat",

"id_for_bluswat",

"id_for_bluswat",

"id_for_taser")

Cost: 125

Enemy Type: "swat"

Required Wave Multiplier: nil

Required Difficulty: nil

Required Dead Civs: nil

Required Hostages: nil

The DIFFICULTY define determines the difficulty's settings for how the budget should be impacted by stuff.

The DIFFICULTY contains these variables:

Name: Name of difficulty.

Wave Multiplier: How much should the wave multiplier go up by every wave? The base wave multiplier is 1.

Difficulty Multiplier: The base difficulty multiplier. Multiplied against the current budget each wave, with the result subtracted from the budget.

Custody Multiplier: How much should players being in Custody effect the budget? Multiplied against the current budget each wave, with the result subtracted from the budget.

Hostage Multiplier: How much should each Hostage effect the budget? Multiplied against the current budget each wave, with the result subtracted from the budget.

Dead Civ Multiplier: How much should each Dead Civ effect the budget? Multiplied against the current budget each wave, with the result subtracted from the budget.

EXAMPLE:

OVERKILL:

Name: Overkill

Wave Multiplier: 0.35

Difficulty Multiplier: 2.5

Custody Multiplier: 0.15

Hostage Multiplier: 0.2

Dead Civ Multiplier: 1.1

the BUDGET STATUS is the active status of the budget for the heist. It starts when the heist goes loud.

The BUDGET STATUS has these variables:

Current Budget: What's the current budget?

Current Wave: Whats the current wave?

Wave Multiplier: Whats the current wave multiplier? Starts at 1.

Current Difficulty: Whats the current difficulty?

Dead Civs: How many civs are dead?

Hostages: How many hostages are there?

Heisters In Custody: How many Heisters are in custody?

For counting the budget, the wave multipliers and difficulty mults. would be calculated first, and then the removal multipliers such as hostages and custody heisters calculated on the budget afterwards.