Commit graph

1612 commits

Author SHA1 Message Date
Oleg Agafonov
384ce67cc3 refactor: improved search in stack 2025-08-10 02:07:15 +04:00
Oleg Agafonov
c7a485b728 reworked AI, targeting and targets logic:
- refactor: simplified target implementation from a dozen canTarget, canChoose and possibleTargets methods to canTarget/possibleTargets only (part of #13638, #13766);
- refactor: fixed wrong target implementations in many cards (example: TargetCardInHand for opponent's hand, close #6210);
- AI: now human, AI and test players -- all use possibleTargets logic in most use cases instead filters or custom validation;
- AI: improved AI sims support for multiple targets abilities;
- AI: improved AI stability, freezes and targets errors in some use cases;
2025-08-04 23:56:23 +04:00
Oleg Agafonov
e866707912 test framework improves:
- now game logs will show stack ability on push and on resolve (before any choices);
- now game logs will show used choices made by cast/activate, setChoice, setMode and addTarget commands (not work for AI tests, part of #13832);
- improved choice logic for modes and yes/not dialogs (now it's use a more strictly checks, use TestPlayer.MODE_SKIP to stop mode selection);
- improved error logs and testable dialogs menu in cheat mode;
2025-08-04 23:53:16 +04:00
theelk801
94b71e4c67 update duel commander ban list 2025-07-28 14:35:11 -04:00
theelk801
3a92da6f67 update duel commander ban list 2025-07-23 14:42:06 -04:00
theelk801
8bb1f40bf7 update canadian highlander point list 2025-07-19 08:41:49 -04:00
theelk801
ccaeabaeba update commander rules to allow vehicles and spacecraft with P/T 2025-07-08 17:27:05 -04:00
Oleg Agafonov
6384816489 AI: added detail logs on too long thinks (show battlefield/stack stats, abilities activation chain on AI freezes, part of #10154, #13766) 2025-07-05 20:33:25 +04:00
ReSech
0cee5127dc
deck: added Freeform Unlimited deck type to play games with any cards amount (#13815) 2025-07-02 07:21:25 +04:00
theelk801
08c2fcf82a update historic ban list 2025-06-30 11:09:03 -04:00
theelk801
043be12aff update standard ban list 2025-06-30 11:08:48 -04:00
Oleg Agafonov
450f7bd907 AI: fixed game freeze on free cast of multiple cards (part of #13638, #13766);
refactor: fixed that TargetCard doesn't work with Zone.ALL;
2025-06-29 15:24:27 +04:00
Oleg Agafonov
dfb84b09f3 server: improved performance and stability with broken AI and human games, e.g. less memory leaks and out of memory errors with AI (related to #11285, #5023); 2025-06-29 01:01:34 +04:00
Oleg Agafonov
c3a0c731d6 AI, tests: added stability tests to make sure AI simulations can process errors and freezes (part of #13638, #13766); 2025-06-28 22:51:34 +04:00
Oleg Agafonov
135c594de1 AI, refactor: removed outdated and unused code like simple priority and combat implementation, simple combat damage calculator, etc (part of #13638, #13766) 2025-06-27 16:37:07 +04:00
Oleg Agafonov
f3e18e245f AI: improved target amount targeting (part of #13638, #13766):
- refactor: migrated AI's target amount code to shared selection logic;
- ai: fixed game freezes on some use cases;
- tests: added AI's testable dialogs for target amount;
- tests: improved load tests result table, added game cycles stats;
- Dwarven Catapult - fixed game error on usage;
2025-06-27 01:11:10 +04:00
theelk801
3b0a7f5d6f remove outdated standard bans 2025-06-20 09:55:10 -04:00
Oleg Agafonov
ffe902d25e
AI: purged whole targeting code and replaced with simple and shared logic (part of #13638) (#13766)
- refactor: removed outdated/unused code from AI, battlefield score, targeting, etc;
- ai: removed all targeting and filters related logic from ComputerPlayer;
- ai: improved targeting with shared and simple logic due effect's outcome and possible targets priority;
- ai: improved get amount selection (now AI will not choose big and useless values);
- ai: improved spell selection on free cast (now AI will try to cast spells with valid targets only);
- tests: improved result table with first bad dialog info for fast access (part of #13638);
2025-06-18 21:03:58 +04:00
Oleg Agafonov
d893d52190 tests: improved testable dialogs (added source code ref in result table for better IDE navigation, part of #13643, #13638); 2025-06-15 14:08:43 +04:00
Oleg Agafonov
6ad2cdaa78 AI: improved stability:
- fixed game errors with source related filters (related to #13713);
- fixed game freeze in hand's cards selection (related to #13290);
- fixed game freeze in target amount selection with X=0 (related to #13290);
2025-06-14 16:03:44 +04:00
Oleg Agafonov
b8a8d92b14 deck: updated The Paper Cube, fixed legacy/vintage (part of #13705) 2025-06-01 00:06:18 +04:00
Oleg Agafonov
eba4d0276d deck: updated Legacy Cube to latest version, removed outdated cubes, improved last update info (part of #13705) 2025-05-31 23:11:44 +04:00
Oleg Agafonov
3d45a24959
Draft Cubes rework (better cube from deck, dynamic data, better errors processing, actual MTGO Vintage Cube) (#13705)
- GUI, table: added dynamic data support for Cube Types (no more depends on server's config names, part of #12050);
- server: replace multiple MTGO Vintage Cubes by single cube, updated to April 2025 (part of #12050);
- server: fixed table freeze on starting error (related to #11285);
- GUI, table: added better support of Cube From Deck (client/server side errors, additional info about loaded cards, etc);
2025-05-31 20:15:31 +04:00
Oleg Agafonov
ef4431e7f2 merge fix 2025-05-24 20:12:53 +04:00
Oleg Agafonov
f3ba897536 gui, deck: reworked edh power level (close #5361, close #11732, related to #13341):
* added power level info in deck validation panel;
* added detail calculation info (hint with cards and their power levels);
* fixed that deck's edh power level ignore individual card's levels and used only commanders;
* removed outdated deck restrictions by commander colors;
* now players can really limit allowed decks by edh power level;
2025-05-24 19:53:37 +04:00
Oleg Agafonov
3f1a02aa03 GUI, deck: improved invalid deck information (added more details in wrong commander color); 2025-05-24 00:21:23 +04:00
Oleg Agafonov
e320bf241c GUI, game: added source info in "choose number/amount" dialogs, added auto-choose for single possible value (part of #13638); 2025-05-17 21:18:45 +04:00
Oleg Agafonov
66db821437 refactor: combined announceX methods in one, improved X message and selection for AI (part of #10330) 2025-05-16 19:34:57 +04:00
Oleg Agafonov
133e4fe425
other: reworked target selection: (#13638)
- WIP: AI and multi targets, human and X=0 use cases, human and impossible targets use cases;
- improved stability and shared logic (related to #13606, #11134, #11666, continue from a53eb66b58, close #13617, close #13613);
- improved test logs and debug info to show more target info on errors;
- improved test framework to support multiple addTarget calls;
- improved test framework to find bad commands order for targets (related to #11666);
- fixed game freezes on auto-choice usages with disconnected or under control players (related to #11285);
- gui, game: fixed that player doesn't mark avatar as selected/green in "up to" targeting;
- gui, game: fixed small font in some popup messages on big screens (related to #969);
- gui, game: added min targets info for target selection dialog;
- for devs: added new cheat option to call and test any game dialog (define own dialogs, targets, etc in HumanDialogsTester);
- for devs: now tests require complete an any or up to target selection by addTarget + TestPlayer.TARGET_SKIP or setChoice + TestPlayer.CHOICE_SKIP (if not all max/possible targets used);
- for devs: added detail targets info for activate/trigger/cast, can be useful to debug unit tests, auto-choose or AI (see DebugUtil.GAME_SHOW_CHOOSE_TARGET_LOGS)
2025-05-16 13:55:54 +04:00
Oleg Agafonov
a53eb66b58 other: reworked target selection (now it use same logic and methods in all places), fixed AI and selection freezes in some use cases (related to #13606, #11285) 2025-05-07 17:34:36 +04:00
Oleg Agafonov
00dc6f4742 refactor: removed useless getNumberOfTargets from Target (replaced with getMinNumberOfTargets) 2025-05-07 02:55:02 +04:00
PurpleCrowbar
36196742ad Update EDH bans 2025-04-22 19:47:11 +01:00
Oleg Agafonov
f83c2bea4b merge fix 2025-04-19 17:48:27 +04:00
Oleg Agafonov
3dc606501d AI: improved stability and bug fixes (related to #13290):
- bug's reason: wrong usage of canTarget, add/addTarget, getOpponents, etc;
- fixed that it can target dead players in some use cases (close #13507);
- fixed that it wrongly choose targets in bad/good effects in some use cases;
- fixed that it can't find valid targets in some use cases;
- fixed game freezes and errors with some cards;
2025-04-19 07:04:55 +04:00
Oleg Agafonov
b915c6590b AI: fixed game freeze with yes/no combat triggers (related to #13290); 2025-04-19 04:10:55 +04:00
Oleg Agafonov
b819545744 bump version 2025-04-11 17:50:12 +04:00
Oleg Agafonov
0a1bf47434 AI: fixed game freeze on cards with combat triggers (close #13342) 2025-04-09 02:21:29 +04:00
Oleg Agafonov
bae3089abb Reworked cost adjuster logic for better support of X and cost modification effects:
Improves:
* refactor: split CostAdjuster logic in multiple parts - prepare X, prepare cost, increase cost, reduce cost;
* refactor: improved VariableManaCost to support min/max values, playable and AI calculations, test framework;
* refactor: improved EarlyTargetCost to support mana costs too (related to #13023);
* refactor: migrated some cards with CostAdjuster and X to EarlyTargetCost (Knollspine Invocation, etc - related to #13023);
* refactor: added shared code for "As an additional cost to cast this spell, discard X creature cards";
* refactor: added shared code for "X is the converted mana cost of the exiled card";
* tests: added dozens tests with cost adjusters;

Bug fixes:
* game: fixed that some cards with CostAdjuster ignore min/max limits for X (allow to choose any X, example: Scorched Earth, Open The Way);
* game: fixed that some cards ask to announce already defined X values (example: Bargaining Table);
* game: fixed that some cards with CostAdjuster do not support combo with other cost modification effects;
* game, gui: fixed missing game logs about predefined X values;
* game, gui: fixed wrong X icon for predefined X values;

Test framework:
* test framework: added X min/max check for wrong values;
* test framework: added X min/max info in miss X value announce;
* test framework: added check to find duplicated effect bugs (see assertNoDuplicatedEffects);

Cards:
* Open The Way - fixed that it allow to choose any X without limits (close #12810);
* Unbound Flourishing - improved combo support for activated abilities with predefined X mana costs like Bargaining Table;
2025-04-08 22:39:10 +04:00
jmlundeen
63781e9ca1 Missed some references to instanceof AdventureCard
replaced with CardWithSpellOption
2025-04-08 09:49:08 -05:00
PurpleCrowbar
dfb6896453
Skip prompting player with no blockers to select blockers (#13496)
* Don't prompt creatureless player to select blockers

* Move getting possible blockers back to while loop

* Several preferences text improvements, always skip select blockers prompt if no blockers
2025-04-03 18:34:04 +01:00
theelk801
f2ea83f73b update ban lists 2025-03-31 16:16:40 -04:00
ssk97
969ffa1c98
FDN New Combat Rules (#13279)
* Remove all combat ordering code

* Use MultiAmount division for damage

* Remove damage selection division skipping in tests

* Fix Banding, Multi-block, add tests

* Fix test

* Fix random iteration order, fix new tests

* Add more info to choose dialog, make MultiAmountType class instead of enum

* Don't prompt for trample damage assignment if none possible

* Mark "Assign default damage" on tests, minor other test improvements
2025-03-30 14:42:05 -07:00
theelk801
769097cfa3 fix error 2025-03-28 15:20:41 -04:00
spjspj
a3592ad391
Update edh power level calculations
Update the edh power level calculators with the game changers and latest salty EDHREC cards (2024)
2025-03-29 02:02:50 +11:00
Asa Reynolds
a20e304234
gui: fixed typo in mana pool dialog (#13391) 2025-02-26 10:39:40 +04:00
Oleg Agafonov
07f68fbf38 server: fixed error on server startup from a launcher (temporary fix, #13315); 2025-02-08 21:41:43 +04:00
Oleg Agafonov
f17cbbe72b 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;
2025-02-06 17:40:22 +04:00
Oleg Agafonov
b4fa6ace66 AI: reworked blockers selections:
* now computer will use simplified 1 vs 1 combat damage simulations to choose better blockers (due better game score after combat);
* it's not a full combat simulation, but support many things like non-stack abilities, damage replacement effects and SBA -- much better than older PT compare (related to #13290);
* now AI correctly use a blockers with deathtouth, indestructible, first/double strike and other abilities;
* chump blocks also supported (chump logic implemented before in 92b7ed8efc, related to #4485);
2025-02-06 07:03:16 +04:00
Oleg Agafonov
7d229e511c tests: added AI performance tests to reproduce bad use cases with too much possible targets 2025-02-05 13:12:22 +04:00
Oleg Agafonov
b62ac065c1 AI: improved performance in tournament games (now computer will play AI vs AI games at the same time); 2025-02-04 14:26:17 +04:00