AI: improved performance and fixed crashes on use cases with too much target options like "deals 5 damage divided as you choose" (related to #11285):

* added DebugUtil.AI_ENABLE_DEBUG_MODE for better IDE's debugging AI code;
 * it's a target amount optimizations;
 * it's use a grouping of possible targets due same static and dynamic stats (name, abilities, rules, damage, etc);
 * instead of going through all possible combinations, AI uses only meaningful targets from particular groups;
This commit is contained in:
Oleg Agafonov 2025-02-06 17:38:09 +04:00
parent b4fa6ace66
commit f17cbbe72b
9 changed files with 349 additions and 50 deletions

View file

@ -11,6 +11,12 @@ public class DebugUtil {
public static boolean NETWORK_SHOW_CLIENT_CALLBACK_MESSAGES_LOG = false; // show all callback messages (server commands)
// AI
// game simulations runs in multiple threads, if you stop code to debug then it will be terminated by timeout
// so AI debug mode will make single simulation thread without any timeouts
public static boolean AI_ENABLE_DEBUG_MODE = false;
public static boolean AI_SHOW_TARGET_OPTIMIZATION_LOGS = false; // works with target amount
// cards basic (card panels)
public static boolean GUI_CARD_DRAW_OUTER_BORDER = false;
public static boolean GUI_CARD_DRAW_INNER_BORDER = false;