davewx7 / citadel

A turn based strategy game based on the Anura engine
Other
99 stars 25 forks source link

Assertion Failed in game_state.cfg, player.can_afford_with_target (during AI turn) #177

Open ghost opened 6 years ago

ghost commented 6 years ago

AI casting Pain on the Mercenary of the screenshot, failed assertion.

screenshot_20171214_181521

crash-20171214.zip

ghost commented 6 years ago

Version information: using the auto updating client, and the crash is tagged with the date.

ghost commented 6 years ago

Reading the debug information, looks like the target was Oldric, Lord of the Hold.

I could suspect of the AI opponent casting Pain at the end of its turn, while holding very little mana (as seen in the screenshot), to a Heroic Creature that have been recently graced with 3 Resistance.

Maybe Resistance has not been used a lot recently (at least not by me...) so I wouldn't be surprised if some border conditions are still not polished.

My next step would be to create a test case with Pain and Oldric, Lord of the Hold to try to confirm it bug. If so, later trying to fix it.

ghost commented 6 years ago

The game is preventing me to cast Pain on Oldric, Lord of the Hold with insufficient mana, at normal 1vsAI game.

Interestingly, when writing a playable test and forcing the AI opponent to confront Oldric, Lord of the Hold with only Pain cards; it would discard them instead of trying to kill the opponent Heroic Creature, when giving both players few (as in 0) mana resources; it would discard exactly two (tested by giving it 4 with the default configuration and by giving it 10 via Harvest hand increase using Villages) of them and save the others without using anyone, when giving both players large (as in 50 but I tested 500 too) mana resources.

While in playable test, I haven't made the AI using Pain on Oldric, Lord of the Hold. Not even having >50 or >>50 mana resource and ten (enough to kill Oldric, Lord of the Hold) Pain cards in hand (none from any shadow deck) and 1000000 life resource.

screen shot 2017-12-15 at 00 04 16

Note life resources with four digits render perfectly and so mana resources with three digits.

sapientN3T commented 6 years ago

I have confirmed that the AI is still ignoring resistance when deciding if it can afford to cast something. But it didnt give me an assert fail, it just went into negative mana:

2018-09-20 23_49_51-argentum age