merovingien / AIWar

Create your Artificial Intelligence to win the war
GNU General Public License v3.0
4 stars 2 forks source link

Bug in "win" detection betwin mero and foo #18

Closed leguims closed 11 years ago

leguims commented 11 years ago

When lauching this game : ./AIWar --blue FOO --red mero --map maps/map_test.xml

FOO wins often but in fact, it does not.

merovingien commented 11 years ago

Could you please send me FOO and mero scripts (by mail) ? Or explain what you mean by "FOO wins often but in fact, it does not." ? Does this mean that the the two bases are still alive when the game stops ?

Thank for your help !

leguims commented 11 years ago

FRA : Ce que je veux dire, c'est que le jeu detecte une victoire de FOO alors qu'il n'y a pas de victoire. Désolé, mais j'avais du mal à l'exprimer en anglais. :)

merovingien commented 11 years ago

This probably happens because the mero's script raises an exception, so FOO wins.

I will add a test and a special return code to differentiate a real victory and a defeat because of an error in a script.

leguims commented 11 years ago

Good idea. Maybe this special code could be the same than "error" for config file.

merovingien commented 11 years ago

The "bug" was caused by an error in the mero script.

To detect errors in player's script, the program now return special return codes:

So this issue is fixed in commit 3e75a5a