Radar data not serialising correctly

Hey :wave:

I have tweaked the settings in appsettings.Development.json to try working with radar. What I get in the radarData field is unexpected:

"radarData":"CyFi.Physics.Utils.Movements+RangeData"

I have checked this using the reference PythonBot. Sample debug log:

2023-06-05 21:22:09,237 - SignalRCoreClient - DEBUG - Raw message incomming: 
2023-06-05 21:22:09,237 - SignalRCoreClient - DEBUG - {"type":1,"target":"ReceiveBotState","arguments":[{"currentLevel":0,"currentState":"Idle","connectionId":"3RMwdKyt0ZBmfpuh8ASkaA","collected":1,"elapsedTime":"-738675:19:21:54.9632586","gameTick":45,"heroWindow":[[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0],[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0],[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],[1,1,1,1,1,1,1,1,0,0,1,0,0,0,1,1,1,1,1,1,1,1],[1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1],[1,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,1,1,1,1,1],[1,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,1,1,1,1,1],[1,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,1,1,1,1,1],[1,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,5,5,5,5,5,5,5,5,5,5,5,5,5],[1,0,0,0,0,0,0,0,0,5,5,5,5,5,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,4,0,2,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,3,0,2,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0]],"x":23,"y":20,"radarData":"CyFi.Physics.Utils.Movements+RangeData"}]}

EDIT: I think this PR should fix it: Convert BotStateDTO.RadarData to a 2D array of ints by torazem · Pull Request #9 · EntelectChallenge/2023-Cy-Fi · GitHub
I’ve tried to match the format stated in GAMERULES.md, though it might be clearer to separate this into their own fields, e.g. radarDirection and radarDistance.

2 Likes

Hi @torazem :slight_smile: I have raised this with the team and we will get back to you as soon as possible.

1 Like

Hey @torazem thanks for the catch we’ll have a look at your PR :raised_hands:

1 Like

It looks like this is fixed in release 2023.2.2 :sparkles: thank you!

1 Like