Different State file

Why is my state file different from the samples and other state files posted on the forum. Specifically the line.

“OpponentMap”:{“Ships”:[{“Destroyed”:false,“Placed”:true,“ShipType”:“Submarine”},{“Destroyed”:false,“Placed”:true,“ShipType”:“Destroyer”},{“Destroyed”:false,“Placed”:true,“ShipType”:“Battleship”},{“Destroyed”:false,“Placed”:true,“ShipType”:“Carrier”},{“Destroyed”:false,“Placed”:true,“ShipType”:“Cruiser”}]

mine reads

“OpponentMap”:{“Ships”:[{“Destroyed”:false,“ShipType”:4},{“Destroyed”:false,“ShipType”:3},{“Destroyed”:false,“ShipType”:0},{“Destroyed”:false,“ShipType”:1},{“Destroyed”:true,“ShipType”:2}]

Hey Twit

Have a look at this topic I think it might cover what you are looking at. The state file you are looking at might be from the game running in tournament mode.

If that doesn’t solve the problem though let us know and I will get one of the guys more familiar with the technical intricacies to have a look at the issue.

I’ve been following that thread too, and I’m even more confused now.

Looking at the file https://forum.entelect.co.za/uploads/db1882/original/1X/5e4e6ea870d1087019734a3dd4818cc3b68a299b.json posed by Wackymax the OpponentMap displays what ships have been destroyed, not where they are positioned and not Player1 and Player 2.

I was under the impression that the only difference in the “alternate” state file is that Player1 and Player2 is added for the GUI. As well as the current bug where PlayerMap = null and OpponentMap = null.

So I guess my question is… Should I be able to tell the type of ships that I have destroyed? Looking at the above mentioned file I would assume yes.

A fair question, let me get one of the guys familiar with the game rules and engine to respond and confirm. I might start throwing around bad information if I continue “helping” you haha.

Hi Twit,

There was a PR to update the json file to rather show the ship type string than the integer value it represents, you can have a look at the following PR on our github page to see what was changed, I hope this helps, please shout if it is still confusing or if I misunderstood the question.

There are two state.json files. There is one presented to the bots, that has the layout you are seeing and then there is another one that is stored after the round, which contains details for the GUI. You one that you showed is the one presented to the bots, so is the one you have to work with. Also, as Foamy mentioned, there has been a change done in the PR he listed, so for the next version of the game engine, the ShipType is going to change from an integer to a string in the json presented to the bots.

Great, thank you very much for your help guys. I thought I was losing my marbles. I’m not a C# guy… (anymore) have not touched any C in over 14 years. I guess I’ll wait for the new version and the executable before continuing my bot.