magefree / magefree/mage

Null Ptr in MCTS game

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

Description

I enabled MCTS ai, got this stack trace:
1) start game
2) choose yourself to go first
3) play a land
4) press spacebar
5) while AI is thinking press F4

Game exception occurred: java.lang.NullPointerException
Server version: 1.4.42V6 (build: 2020-03-04 17:19)
mage.player.ai.ComputerPlayerMCTS.calculateActions(ComputerPlayerMCTS.java:98)
mage.player.ai.ComputerPlayerMCTS.getNextAction(ComputerPlayerMCTS.java:112)
mage.player.ai.ComputerPlayerMCTS.priority(ComputerPlayerMCTS.java:77)
mage.game.GameImpl.playPriority(GameImpl.java:1292)
mage.game.turn.Step.priority(Step.java:61)
mage.game.turn.Phase.playStep(Phase.java:184)
mage.game.turn.Phase.play(Phase.java:89)
mage.game.turn.Turn.play(Turn.java:126)
mage.game.GameImpl.playTurn(GameImpl.java:889)
mage.game.GameImpl.play(GameImpl.java:798)
mage.game.GameImpl.start(GameImpl.java:762)
mage.server.game.GameWorker.call(GameWorker.java:34)
java.util.concurrent.FutureTask.run(FutureTask.java:266)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
java.lang.Thread.run(Thread.java:748)

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with mage.player.ai.ComputerPlayerMCTS.java at lines 98, 112, and 77, then follow the priority call from mage.game.GameImpl. Reproduce the listed MCTS sequence, including pressing F4 while the AI is thinking. Done means the sequence no longer raises the reported NullPointerException.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
ai, game-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.