-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrapped bot throws exception #1
Comments
I am happy to hear that you have had a lot of fun with Robocode! 😊 And thank you for both reporting the issue, and providing a lot of details for how to reproduce it, which is crucial for getting the issues fixed. It sounds like a generic bug with the bridge that needs to be fixed. Regarding not using event handler, and instead using the main loop and reading out events from there is a perfectly legal way to do it in Robocode. You can use the event handlers, if you want, or just extract the current events from the main method or any other method. I will have a look into this issue and see if I can fix it. 🙂 |
I have now fixed the issue in the (robocode-api) causing the issue you encountered. And the TankRoyaleRepro you provided seems to run fine with the fixed version. 👍 I have put the new robocode-api-0.2.0.jar for you here into a zip file (GitHub does not allow me to upload jar files directly) If you encounter more issues, if will be very happy if you raise more tickets about it so we can improve the bridge and be able to support as many legacy robots as possible. 😊 |
Thanks for getting to this so quickly! I can confirm the reproduction bot now runs correctly in the first round, and so do other bots based on the same framework. Unfortunately, they all stop working in the second round due to issues I suspect are related. The reproduction bot I included fails with the exception
Other bots fail with
I assume the thread running the bot for the first round keeps running even after it is complete. This seems to align with the infinite main-loop. Might it be necessary to throw some termination exception? I'll need to look into how that currently work. |
Let us continue on this thread with the second issue as well. 🙂 A |
Sure, if that works better for you I'm happy to continue here! I have been able to create a simple reproduction for the other exception
as well. Compared to the previous version, I have added basic linear targeting. You can find the source here and a packaged version I suspect that the actual implementation of linear targeting is irrelevant and the different error is simply caused by slightly different timing. |
I have already found several issues that I am trying to solve within the Bot APIs for Java and C#. The most critical one is the one you already mentioned, that it seems that old threads are not stopping in new rounds. And another where the bridged bots cannot be restarted as they disconnect from the WebSocket and exits. |
@Cu3PO42 |
I appreciate the update! I didn't mean to convey any urgency. Once you believe you have resolved the problems you are aware of, I'll resume testing! |
With Release 0.27.0 lots of bugs has been fixed. A lot of bugs has also been fixed with the Robocode Bridge. But some still remains. |
Thank you! I can confirm that the bots I tested are now working correctly :-) I also tested some bots from LiteRumble. DrussGT seems to work perfectly, but BeepBoop crashes immediately:
While the stack trace seems to indicate a problem with BeepBoop itself, it does work correctly in legacy Robocode. I'll see about conducting a more extensive test of all bots in the rumble soon. |
@Cu3PO42 Thank you for the confirmation. There are still some issues I currently hunt down. One of them is that the cannon seems to point in the wrong direction for some bots. So I do expect a bug somewhere in the bridge. But I have had a hard time spotting it. |
Hi! I'd like to start by thanking you for your continued work on Robocode. I've had a lot of fun with it for almost a decade now.
While evaluating the new Tank Royale platform, I attempted to port some legacy (non-publically-available) bots using the API bridge. They all trigger the same exception at runtime:
I have tried to create a minimal reproducing sample bot that triggers the behavior and am attaching a
packaged jar. You can find the source in this gist. The bot is expected to do nothing except maintain a radar lock in a 1v1, it neither moves nor fires.
The issue seems to stem from requesting the robot's event queue, but not to be related to ScannedRobotEvents specifically. In the "full framework", we handle all event types, but this does not seem to trigger any additional errors.
The reason for the admittedly somewhat odd event handling is that this is the above example is the result of taking a framework and stripping away everything that was not needed to trigger the exception. (Background Info: At my university, the stundents organize a one week introductory programming course for new students before actual classes start. We've found that event handlers were a difficult concept to grasp for many, so we wanted to move everything into the main loop and are storing events in a queue. It's been a few years since I wrote those abstractions, so I unfortunately do not recall why we have our own queue, but also reference
AdvancedRobot#getScannedRobotEvent
.)Everything works on legacy Robocode and I'm decently confident we're not violating any laws of Robocode, but I wouldn't guarantee it 100%. I have done my best to strip down everything that is not needed to reproduce the issue.
Thank you in advance for looking into this!
The text was updated successfully, but these errors were encountered: