maxpumperla / betago

BetaGo: AlphaGo for the masses, live on GitHub.
http://maxpumperla.github.io/betago
MIT License
680 stars 162 forks source link

Fixed coordinate inversion & improved debugging #32

Closed rocketinventor closed 7 years ago

rocketinventor commented 7 years ago

Partially solves #27. Coordinates were being switched when they were sent to the server, then switched again. As a result, the coordinates recorded by the client did not match those logged by the server. This issue has now been resolved. Event logging has been drastically improved as well.

Both the client and the server now have an event log with the coordinates sent, and the coordinates received. For clarity, both the server and the client print out the information in the same format with clear labels explaining what is going on. Also, the client now logs errors that weren't getting logged before.

This should make solving similar issues much easier in the future.

macfergus commented 7 years ago

Wow, nice detective work! Thanks for the fix.

So, just to clarify: did you conclude that this was the cause of some of the consistency problems? Or just that the coordinate mismatch made debugging really hard.

cdmalon commented 7 years ago

@rocketinventor I think there's only one place where coordinates come into the server, and one place where they come out. With this pull request, you've swapped the coordinates on the way in and on the way out. The effect of this is just to make the server play a mirror image of the game it had been playing previously, so I don't see how this would fix something like #26.

rocketinventor commented 7 years ago

@cdmalon Yah, I kind of came to that realization :) This just makes it easier to debug. During my testing, it seemed as though a few problems went away but, it was probably just coincidental.