robocode-dev / tank-royale

Git repository for Robocode Tank Royale
Apache License 2.0
122 stars 23 forks source link

Bring original robocode bots to new platform #12

Open bumfo opened 2 years ago

bumfo commented 2 years ago

I quite like the new and modularized design, where bot creation is no longer limited by JVM. One can write e.g. a Python bot, finally, and even take advantage of GPUs. Imagine a whole new level of robocode competition!

Anyway we have a lot of ancient bots in original robocode, no longer updated by their authors. Yet their strategy is sophisticated, and is still inspiring new authors. Theoretically one can simply write a bridge, translate math coordinates, since the rest of game physics is mostly equivalent. However, such a bridge is error-prune, and may get out of maintenance, which creates fragmentation to the community.

If there were an officially supported bridge, it will be much easier to go with the new platform, with the benefit of the existing community and bots, out of the box. And I'm glad to help if there are already some plans ;)

flemming-n-larsen commented 2 years ago

Pavel Savara has already brought this topic to my attention some time ago. 🙂

Being compatible with the original Robocode has not been the main driver for making this version/variant, but simply to make a better platform, and potentially drive it to something better in the future, which was not possible feasible when everything needed to run inside a JVM.

That said. The "only" thing that is needed to do a "bridge" for legacy Robocode robots would be to write a Robocode Robot API for it which simply communicates with the game over web socket. The Bot API for Java for Tank Royale can be used as inspiration for doing the same thing for "emulating" the Robocode Roboot API. 🙂 One disclaimer from my side is, that the legacy robots might behave differently when running in a new environent for Tank Royale, and e.g. nasty hacks or bad practise in the robots might give some trouble when trying to run those inside Tank Royale. But let us see, how it turns out.

With Tank Royale, anyone can do their own bot API or do simple communication directly using the protocol for Tank Royale. The provided APIs for Tank Royale can be seen as proof-of-concept for Tank Royale, and makes it much easier to get started with developing a bot for the JVM and .Net platforms. A web API will follow later.

I will certainly look into this a bit later to put some real effort into this, but first I need to stabilize Tank Royale and fix/change things that are not good enough when it is still in Alpha stage.

But after that, I propose a new project is created under robocode-dev here at GitHub to support legacy robots. And perhaps we could do another repository to create something much better than the current code base for RoboRumble/LiteRumble as well for Tank Royale? 🙂 I want to keep the Tank Royale repository clean to contain the "core" of the game. Then we can build stuff on top of that.

bumfo commented 2 years ago

@flemming-n-larsen

Glad to hear that! I quite agree with your plans, that the main repo should be clean and focus on the "core" part. And IMO a competitive bot should be robust enough to run in both platform, without ill-behaving.

Let me know once the bridge project is created. I could help with some code & testing ;)

flemming-n-larsen commented 2 years ago

@bumfo I will definitely let you know. 🙂

flemming-n-larsen commented 1 year ago

@bumfo I have been working on a Robocode bridge since April on and off. And even though it is early days for both Tank Royale and the bridge, I think it is about time to share the work so far.

I have created an independent repository for it here: Robocode API bridge for Tank Royale

I have put in some README.md files that explain how it works, and you should (hopefully🙏) be able to try this out on some legacy bots.

I do recommend that you make a copy of the robots in another folder to experiment with the bridging. 😉

I did try this out on a big pile of robot archives. Some are working just fine. Some will not start due to class loading issues etc. And others have some issues during the battles etc.

The is a discussion forum for the Robocode API bridge here.

Perhaps we could create an archive containing as many legacy robots, as we can gather, and add those somewhere as well for testing?

bumfo commented 1 year ago

Perhaps we could create an archive containing as many legacy robots, as we can gather, and add those somewhere as well for testing?

Definitely agree with that. I'll have a check and probably create some test set for the bridge. We can also use LiteRumble scores to ensure no big functionality loss, and hopefully create some automatic facility to fix the incompatible ones.

flemming-n-larsen commented 1 year ago

It would be really great to have LiteRumble to compare scores to spot if a bot is not behaving as expected. But I wonder if we need to create something like the LiteRumble for Tank Royale in order to run both new and legacy bots on LiteRumble, as the current LiteRumble is running on the legacy platform.

bumfo commented 1 year ago

It would be really great to have LiteRumble to compare scores to spot if a bot is not behaving as expected. But I wonder if we need to create something like the LiteRumble for Tank Royale in order to run both new and legacy bots on LiteRumble, as the current LiteRumble is running on the legacy platform.

That's not a big problem, LiteRumble is merely a server, we can have special competitions created on LiteRumble for Tank Royale.

And we don't need to run all the pairings of LiteRumble, only a small portion of it should be sufficient for testing purpose, therefore all testing could be done locally, taking only a few days.