Re: Robocode Tank Royale - Python?
fnl <[email protected]> Tue, 24 Sep 2024 09:24:59 -0700 (PDT)
| Newsgroups | gmane.comp.java.robocode |
|---|---|
| Message-ID | <[email protected]> |
------=_Part_206452_1741923726.1727195099321 Content-Type: multipart/alternative; boundary="----=_Part_206453_166449582.1727195099321" ------=_Part_206453_166449582.1727195099321 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable *Correction:* Jython <https://www.jython.org/> is a Python implementation for Java, which= =20 can be used for the the existing Java Bot API=20 <https://robocode-dev.github.io/tank-royale/api/java/dev/robocode/tankroyal= e/botapi/package-summary.html> for=20 Robocode Tank Royale. tirsdag den 24. september 2024 kl. 18.22.22 UTC+2 skrev fnl: > Hi Sarb, > > Currently, there are two official bot APIs for Robocode Tank Royale: > > *Java platform:*=20 > https://github.com/robocode-dev/tank-royale/tree/main/bot-api/java > *.Net platform*:=20 > https://github.com/robocode-dev/tank-royale/tree/main/bot-api/dotnet > > And at some point I will introduce an API for web as well. > > If you want to build an API from scratch, you could choose to: > 1) Create an API very similar to the current APIs that are made very=20 > similar on purpose. Meaning that your Python API would have same classes= =20 > and methods, but in Python style of course. > 2) Create your own version and just use communicate with the server in a= =20 > more "raw" fashion by communicating over a WebSocket. > > If you choose option 2, you need to send and receive messages using the *= protocol=20 > *described here: > > https://github.com/robocode-dev/tank-royale/blob/main/schema/schemas/game= /README.md > > And the *schemas *(message formats) are available here (In JsonSchema=20 > <https://json-schema.org/specification>format) > https://github.com/robocode-dev/tank-royale/tree/main/schema/schemas/game > > If you choose option 1, you should create something similar to *BaseBot *= as=20 > a first step (like I did), which handles the basic communication between = a=20 > bot and the server. > Later you can create a *Bot *with more advanced methods as step 2. > > Also note that you could use the existing APIs as is. For example, we hav= e=20 > Jython <https://www.jython.org/>, which is a Python implementation for=20 > the existing Java Bot AP=20 > <https://robocode-dev.github.io/tank-royale/api/java/dev/robocode/tankroy= ale/botapi/package-summary.html> > I. > And you could use Python.Net <https://pythonnet.github.io/> for with the= =20 > existing .Net Bot API=20 > <https://robocode-dev.github.io/tank-royale/api/dotnet/api/Robocode.TankR= oyale.BotApi.html> > . > > I you want to do a real Python API that are similar to the existing one, = I=20 > will be happy to assist you. =F0=9F=91=8D > I guess most code from the existing platforms can be translated without a= =20 > big hassle for Python. I did the same for Java to .Net, and I will do it= =20 > again later for the coming web API. =F0=9F=98=8A > > Best regards, > - Flemming > tirsdag den 24. september 2024 kl. 18.00.54 UTC+2 skrev Sarb: > >> Apologies if this question has already been asked. >> >> I am interested in developing bots in Python. It appears this may be=20 >> possible with Robocode Tank Royale. How would I go about building a Pyth= on=20 >> bot API? Any pointers or guidance would be greatly appreciated. >> >> *Refs*: >> >> 1. https://robocode-dev.github.io/tank-royale/ >> =20 >> --=20 You received this message because you are subscribed to the Google Groups "= Robocode" group. To unsubscribe from this group and stop receiving emails from it, send an e= mail to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/= robocode/539f0328-8d81-422c-b30c-1cc9d5d6f9fan%40googlegroups.com. ------=_Part_206453_166449582.1727195099321 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <b>Correction:</b><br /><a href=3D"https://www.jython.org/" target=3D"_blan= k" rel=3D"nofollow" style=3D"color: rgb(26, 115, 232);">Jython</a>=C2=A0is = a Python implementation for Java, which can be used for the=C2=A0the existi= ng=C2=A0<a href=3D"https://robocode-dev.github.io/tank-royale/api/java/dev/= robocode/tankroyale/botapi/package-summary.html" target=3D"_blank" rel=3D"n= ofollow" style=3D"color: rgb(26, 115, 232);">Java Bot API</a>=C2=A0for Robo= code Tank Royale.<br /><div class=3D"gmail_quote"><div dir=3D"auto" class= =3D"gmail_attr">tirsdag den 24. september 2024 kl. 18.22.22 UTC+2 skrev fnl= :<br/></div><blockquote class=3D"gmail_quote" style=3D"margin: 0 0 0 0.8ex;= border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Hi Sarb,<br= ><br>Currently, there are two official bot APIs for Robocode Tank Royale:<b= r><br><b>Java platform:</b>=C2=A0<a href=3D"https://github.com/robocode-dev= /tank-royale/tree/main/bot-api/java" target=3D"_blank" rel=3D"nofollow" dat= a-saferedirecturl=3D"https://www.google.com/url?hl=3Dda&q=3Dhttps://git= hub.com/robocode-dev/tank-royale/tree/main/bot-api/java&source=3Dgmail&= amp;ust=3D1727281343266000&usg=3DAOvVaw38AlBnQPeaf1tEHsp07ypA">https://= github.com/robocode-dev/tank-royale/tree/main/bot-api/java</a><br><b>.Net p= latform</b>:=C2=A0<a href=3D"https://github.com/robocode-dev/tank-royale/tr= ee/main/bot-api/dotnet" target=3D"_blank" rel=3D"nofollow" data-saferedirec= turl=3D"https://www.google.com/url?hl=3Dda&q=3Dhttps://github.com/roboc= ode-dev/tank-royale/tree/main/bot-api/dotnet&source=3Dgmail&ust=3D1= 727281343266000&usg=3DAOvVaw1yy1SiMrU2je2dGVFMRXWR">https://github.com/= robocode-dev/tank-royale/tree/main/bot-api/dotnet</a><br><br>And at some po= int I will introduce an API for web as well.<br><br>If you want to build an= API from scratch, you could choose to:<br>1) Create an API very similar to= the current APIs that are made very similar on purpose. Meaning that your = Python API would have same classes and methods, but in Python style of cour= se.<br>2) Create your own version and just use communicate with the server = in a more "raw" fashion by communicating over a WebSocket.<br><br= >If you choose option 2, you need to send and receive messages using the <b= >protocol </b>described here:<br><a href=3D"https://github.com/robocode-dev= /tank-royale/blob/main/schema/schemas/game/README.md" target=3D"_blank" rel= =3D"nofollow" data-saferedirecturl=3D"https://www.google.com/url?hl=3Dda&am= p;q=3Dhttps://github.com/robocode-dev/tank-royale/blob/main/schema/schemas/= game/README.md&source=3Dgmail&ust=3D1727281343266000&usg=3DAOvV= aw3W_sWt8nLoAFf4xCsjnUrv">https://github.com/robocode-dev/tank-royale/blob/= main/schema/schemas/game/README.md</a><br><br>And the <b>schemas </b>(messa= ge formats) are available here (In <a href=3D"https://json-schema.org/speci= fication" target=3D"_blank" rel=3D"nofollow" data-saferedirecturl=3D"https:= //www.google.com/url?hl=3Dda&q=3Dhttps://json-schema.org/specification&= amp;source=3Dgmail&ust=3D1727281343266000&usg=3DAOvVaw2tjImbw1b7EkK= CDf-Wu6-q">JsonSchema </a>format)<br><a href=3D"https://github.com/robocode= -dev/tank-royale/tree/main/schema/schemas/game" target=3D"_blank" rel=3D"no= follow" data-saferedirecturl=3D"https://www.google.com/url?hl=3Dda&q=3D= https://github.com/robocode-dev/tank-royale/tree/main/schema/schemas/game&a= mp;source=3Dgmail&ust=3D1727281343266000&usg=3DAOvVaw28rQajixc59QCr= pEUEGqNK">https://github.com/robocode-dev/tank-royale/tree/main/schema/sche= mas/game</a><br><br>If you choose option 1, you should create something sim= ilar to <b>BaseBot </b>as a first step (like I did), which handles the basi= c communication between a bot and the server.<br>Later you can create a <b>= Bot </b>with more advanced methods as step 2.<br><br>Also note that you cou= ld use the existing APIs as is. For example, we have <a href=3D"https://www= .jython.org/" target=3D"_blank" rel=3D"nofollow" data-saferedirecturl=3D"ht= tps://www.google.com/url?hl=3Dda&q=3Dhttps://www.jython.org/&source= =3Dgmail&ust=3D1727281343266000&usg=3DAOvVaw01WOBlDlijhZSQudtd9014"= >Jython</a>, which is a Python implementation for the existing=C2=A0<a href= =3D"https://robocode-dev.github.io/tank-royale/api/java/dev/robocode/tankro= yale/botapi/package-summary.html" target=3D"_blank" rel=3D"nofollow" data-s= aferedirecturl=3D"https://www.google.com/url?hl=3Dda&q=3Dhttps://roboco= de-dev.github.io/tank-royale/api/java/dev/robocode/tankroyale/botapi/packag= e-summary.html&source=3Dgmail&ust=3D1727281343266000&usg=3DAOvV= aw0IcnpUEMid2u-eFPVpUNmR">Java Bot AP</a>I.<div>And you could use <a href= =3D"https://pythonnet.github.io/" target=3D"_blank" rel=3D"nofollow" data-s= aferedirecturl=3D"https://www.google.com/url?hl=3Dda&q=3Dhttps://python= net.github.io/&source=3Dgmail&ust=3D1727281343266000&usg=3DAOvV= aw2QFloYPcaf3t9KDONxC_IE">Python.Net</a> for with the existing<a href=3D"ht= tps://robocode-dev.github.io/tank-royale/api/dotnet/api/Robocode.TankRoyale= .BotApi.html" target=3D"_blank" rel=3D"nofollow" data-saferedirecturl=3D"ht= tps://www.google.com/url?hl=3Dda&q=3Dhttps://robocode-dev.github.io/tan= k-royale/api/dotnet/api/Robocode.TankRoyale.BotApi.html&source=3Dgmail&= amp;ust=3D1727281343266000&usg=3DAOvVaw0Evz8v5zPMF1mkROe7qvoo"> .Net Bo= t API</a>.<br><br>I you want to do a real Python API that are similar to th= e existing one, I will be happy to assist you. =F0=9F=91=8D<br>I guess most= code from the existing platforms can be translated without a big hassle fo= r Python. I did the same for Java to .Net, and I will do it again later for= the coming web API. =F0=9F=98=8A<br><br>Best regards,<br>- Flemming</div><= div class=3D"gmail_quote"><div dir=3D"auto" class=3D"gmail_attr">tirsdag de= n 24. september 2024 kl. 18.00.54 UTC+2 skrev Sarb:<br></div><blockquote cl= ass=3D"gmail_quote" style=3D"margin:0 0 0 0.8ex;border-left:1px solid rgb(2= 04,204,204);padding-left:1ex">Apologies if this question has already been a= sked.<div><br></div><div>I am interested in developing bots in Python. It a= ppears this may be possible with Robocode Tank Royale. How would I go about= building a Python bot API? Any pointers or guidance would be greatly appre= ciated.<div><br></div><div><i>Refs</i>:</div><div><ol><li><a href=3D"https:= //robocode-dev.github.io/tank-royale/" rel=3D"nofollow" target=3D"_blank" d= ata-saferedirecturl=3D"https://www.google.com/url?hl=3Dda&q=3Dhttps://r= obocode-dev.github.io/tank-royale/&source=3Dgmail&ust=3D17272813432= 66000&usg=3DAOvVaw1V6E5Vmu5GP8zhoFG2Ec8j">https://robocode-dev.github.i= o/tank-royale/</a><br></li></ol></div></div></blockquote></div></blockquote= ></div> <p></p> -- <br /> You received this message because you are subscribed to the Google Groups &= quot;Robocode" group.<br /> To unsubscribe from this group and stop receiving emails from it, send an e= mail to <a href=3D"mailto:[email protected]">robocode+u= [email protected]</a>.<br /> To view this discussion on the web visit <a href=3D"https://groups.google.c= om/d/msgid/robocode/539f0328-8d81-422c-b30c-1cc9d5d6f9fan%40googlegroups.co= m?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.com/d/msgid= /robocode/539f0328-8d81-422c-b30c-1cc9d5d6f9fan%40googlegroups.com</a>.<br = /> ------=_Part_206453_166449582.1727195099321-- ------=_Part_206452_1741923726.1727195099321--