HomeWildfire Games

[PetraAI] - Use enum-like variables instead of magic values. -- [1]
AuditedrP26029

Description

[PetraAI] - Use enum-like variables instead of magic values. -- [1]

Improved readability. Easier find-and-replace.

This commit is focused on:

  • BaseManager
  • AttackPlan
  • GarrisonManager

Patch by: @JCWasmx86
Differential revision: https://code.wildfiregames.com/D4334
Refs. #6256
Comments by: @Silier, @Stan

Event Timeline

nwtour raised a concern with this commit.Dec 7 2021, 2:34 PM
nwtour added a subscriber: nwtour.

Comit changes Petra's behavior a lot. Instead of attacking, the AI is constantly looking for places on the map for new Civic Centers

Map: Random Volcanic Lands
5 players. 4 petras balanced normal difficulty level
100 population limit, resources "Very High"
We start the game, set the speed to x2 and just wait end of game

On the graph, the time to destruction (it is also the first attack) before and after commit

40 minutes without attacks is very boring

This commit now has outstanding concerns.Dec 7 2021, 2:34 PM
Silier raised a concern with this commit.Dec 7 2021, 3:56 PM
Silier added inline comments.
/ps/trunk/binaries/data/mods/public/simulation/ai/petra/attackManager.js
354

TYPE_HUGE_ATTACK does not exist in attackmanager

Silier accepted this commit.Dec 9 2021, 7:02 AM

Ping @nwtour is it solved for you?

nwtour accepted this commit.Dec 10 2021, 12:51 PM
All concerns with this commit have now been addressed.Dec 10 2021, 12:51 PM