That is correct yes, the state files are slightly different. The best way would probably be to just run the game engine and then kill it, odds are one of the bots did not process the round yet so the state file will still be there before the game engine could delete it.
Attached is an example for you to look at however.
basically the game engine runs, ship placement check.
however the state file generated for the bots still does not contain anything? getting null for both player and opponent.
is there a switch i need to enable on the engine?
During phase 1, the ship placing phase, there should be no information in the player’s map and opponent’s map file to assist you in placing your ships. Are they still null during phase 2?
Thanks for the update, I have read and experienced that the reference bot doesn’t always place it’s bot, I will have a look into that. I am glad you figured it out! Hope you are enjoying it and stay tuned for any changes.
I’m working in Java. My problem is closest to @MarkMyb’s. My GameState.PlayerMap and GameState.OpponentMap is always null, because the state.json file that’s passed in at the start of every turn, has these values set to null. If I change my GateState to include: public PlayerMap Player2Map; public OpponentMap Player1Map;
then these 2 fields are populated. I understand that Player*Map will be null in each round, and only populated at the end of the match, so I can’t use it at all.
Unfortunately I can’t decipher Mark’s fix If it’s a ‘json error’, and the json file is created externally, then what was the solution? My bot always used OpponentMap.Cells, but I don’t see how changing that would help if the json OpponentMap is always null.
Please help! Here is my state.json (10.7 KB) created in Phase 2 Round 5.
I use: Battleships.exe --pretty -b ../javaOP ../ME
In summary, why is my json PlayerMap and OpponentMap null?
So there are two state.json files with different content. This is confusing I know and we apologize for not making this better before the launch.
The first state.json file will be in the directory passed to your bot in it’s arguments {match}/{round}/{bot key}/state.json and it will have the PlayerMap and OpponentMap fields. The second file is the round directory {match}/{round}/state.json and that one will contain the Player1Map and Player2Map fields.
Ah! I see. Wow I thought I was going nuts there. No apology needed. The great support on this forum far outweighs these minor teething problems I’m having
I just had a peek in the folder I was suppose to be using, and that state file has the details I was expecting. Thank you so much.