magefree / magefree/mage

AI: Thinking too long with stupid stuff (Possibly not a bug)

Open
#14,121 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
2.4k
Forks
940
Avg merge
2d 12h
Merged PRs (30d)
160

Description

```WARN 2025-12-12 00:41:25,167 AI player thinks too long (report it to github): =>[GAME b4f85636-ec06-4265-adad-d953607e7ee4] ComputerPlayer6.addActionsTimed
WARN 2025-12-12 00:41:25,167 - player: Computer 4 =>[GAME b4f85636-ec06-4265-adad-d953607e7ee4] ComputerPlayer6.addActionsTimed
WARN 2025-12-12 00:41:25,167 - battlefield size: 51 =>[GAME b4f85636-ec06-4265-adad-d953607e7ee4] ComputerPlayer6.addActionsTimed
WARN 2025-12-12 00:41:25,167 - stack: 57 (top: stack ability (Afterlife 1 (When this creature dies, create a 1/1 white and black Spirit creat...) =>[GAME b4f85636-ec06-4265-adad-d953607e7ee4] ComputerPlayer6.addActionsTimed
WARN 2025-12-12 00:41:25,167 - game: !!!SIMULATION, AI!!! Commander Free For All; T37.M1; active: BlackWyvern; stack: 57 (top: stack ability (Afterlife 1 (When this creature dies, create a 1/1 white and black Spirit creat...) =>[GAME b4f85636-ec06-4265-adad-d953607e7ee4] ComputerPlayer6.addActionsTimed
WARN 2025-12-12 00:41:25,167 Possible freeze chain: =>[GAME b4f85636-ec06-4265-adad-d953607e7ee4] ComputerPlayer6.printFreezeNode
WARN 2025-12-12 00:41:25,167 - unknown use case (too many possible targets?) =>[GAME b4f85636-ec06-4265-adad-d953607e7ee4] ComputerPlayer6.printFreezeNode
WARN 2025-12-12 00:41:25,167 =>[GAME b4f85636-ec06-4265-adad-d953607e7ee4] ComputerPlayer6.addActionsTimed
WARN 2025-12-12 00:41:31,248 =>[GAME b4f85636-ec06-4265-adad-d953607e7ee4] ComputerPlayer6.addActionsTimed
WARN 2025-12-12 00:41:31,248 AI player thinks too long (report it to github): =>[GAME b4f85636-ec06-4265-adad-d953607e7ee4] ComputerPlayer6.addActionsTimed
WARN 2025-12-12 00:41:31,248 - player: Computer 3 =>[GAME b4f85636-ec06-4265-adad-d953607e7ee4] ComputerPlayer6.addActionsTimed
WARN 2025-12-12 00:41:31,248 - battlefield size: 52 =>[GAME b4f85636-ec06-4265-adad-d953607e7ee4] ComputerPlayer6.addActionsTimed
WARN 2025-12-12 00:41:31,248 - stack: 57 (top: stack ability (Whenever another creature you control enters, you may gain 1 life.)) =>[GAME b4f85636-ec06-4265-adad-d953607e7ee4] ComputerPlayer6.addActionsTimed
WARN 2025-12-12 00:41:31,248 - game: !!!SIMULATION, AI!!! Commander Free For All; T37.M1; active: BlackWyvern; stack: 57 (top: stack ability (Whenever another creature you control enters, you may gain 1 life.)) =>[GAME b4f85636-ec06-4265-adad-d953607e7ee4] ComputerPlayer6.addActionsTimed
WARN 2025-12-12 00:41:31,248 Possible freeze chain: =>[GAME b4f85636-ec06-4265-adad-d953607e7ee4] ComputerPlayer6.printFreezeNode
WARN 2025-12-12 00:41:31,248 - unknown use case (too many possible targets?) =>[GAME b4f85636-ec06-4265-adad-d953607e7ee4] ComputerPlayer6.printFreezeNode
WARN 2025-12-12 00:41:31,248 =>[GAME b4f85636-ec06-4265-adad-d953607e7ee4] ComputerPlayer6.addActionsTimed
```

Setup:
[[Afterlife Insurance]] + [[Nadier's Nightblade]] + [[Blood Artist]] + [[Relic Vial]] + [[Suture Priest]]

Cast:
[[Pitiless Carnage]] Targeting 13 tokens.

Result:
Needlessly long stack that also takes needlessly long to process, lol.

Possibly refers to:
Issue #9539 (Not dynlinking in case it's unrelated.)

Notes:
Uncertain if this is caused by too many targets, since these are all "all opponents", "target opponent", or just mandatory states. There's little 'targeting' to be done.

But this could just be me doing too many things at once because I'm an idiot and you're welcome to close/remove.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the ComputerPlayer6.addActionsTimed and ComputerPlayer6.printFreezeNode entry points named in the warning. Reproduce the listed Commander Free For All setup with the four cards and Pitiless Carnage targeting 13 tokens, then inspect the reported freeze chain and its possible-target handling. Done means determining the cause of the excessive processing and confirming that this scenario no longer takes needlessly long.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
ai, game-dev, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.