Re: Robocode Tank Royale - Python?

fnl <[email protected]> Tue, 24 Sep 2024 09:22:21 -0700 (PDT)
Newsgroups gmane.comp.java.robocode
Message-ID <[email protected]>
------=_Part_193130_1747776617.1727194941970
Content-Type: multipart/alternative; 
	boundary="----=_Part_193131_543341686.1727194941970"

------=_Part_193131_543341686.1727194941970
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Hi Sarb,

Currently, there are two official bot APIs for Robocode Tank Royale:

*Java platform:*
 https://github.com/robocode-dev/tank-royale/tree/main/bot-api/java
*.Net platform*
: 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 *pr=
otocol=20
*described here:
https://github.com/robocode-dev/tank-royale/blob/main/schema/schemas/game/R=
EADME.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 have=
=20
Jython <https://www.jython.org/>, which is a Python implementation for the=
=20
existing Java Bot AP=20
<https://robocode-dev.github.io/tank-royale/api/java/dev/robocode/tankroyal=
e/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.TankRoy=
ale.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 Pytho=
n=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/9f33c957-cbdc-4cf0-99b4-fff5674054b6n%40googlegroups.com.

------=_Part_193131_543341686.1727194941970
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Hi Sarb,<br /><br />Currently, there are two official bot APIs for Robocode=
 Tank Royale:<br /><br /><b>Java platform:</b>=C2=A0https://github.com/robo=
code-dev/tank-royale/tree/main/bot-api/java<br /><b>.Net platform</b>:=C2=
=A0https://github.com/robocode-dev/tank-royale/tree/main/bot-api/dotnet<br =
/><br />And at some point 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) C=
reate 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 course.<br />2) Create your own version and just us=
e 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 recei=
ve messages using the <b>protocol </b>described here:<br />https://github.c=
om/robocode-dev/tank-royale/blob/main/schema/schemas/game/README.md<br /><b=
r />And the <b>schemas </b>(message formats) are available here (In <a href=
=3D"https://json-schema.org/specification">JsonSchema </a>format)<br />http=
s://github.com/robocode-dev/tank-royale/tree/main/schema/schemas/game<br />=
<br />If you choose option 1, you should create something similar to <b>Bas=
eBot </b>as a first step (like I did), which handles the basic communicatio=
n 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 could use t=
he existing APIs as is. For example, we have <a href=3D"https://www.jython.=
org/">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/t=
ankroyale/botapi/package-summary.html">Java Bot AP</a>I.<div>And you could =
use <a href=3D"https://pythonnet.github.io/">Python.Net</a> for with the ex=
isting<a href=3D"https://robocode-dev.github.io/tank-royale/api/dotnet/api/=
Robocode.TankRoyale.BotApi.html"> .Net Bot API</a>.<br /><br />I you want t=
o do a real Python API that are similar to the existing one, I will be happ=
y to assist you. =F0=9F=91=8D<br />I guess most code from the existing plat=
forms can be translated without a big hassle for 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_qu=
ote"><div dir=3D"auto" class=3D"gmail_attr">tirsdag den 24. september 2024 =
kl. 18.00.54 UTC+2 skrev Sarb:<br/></div><blockquote class=3D"gmail_quote" =
style=3D"margin: 0 0 0 0.8ex; border-left: 1px solid rgb(204, 204, 204); pa=
dding-left: 1ex;">Apologies if this question has already been asked.<div><b=
r></div><div>I am interested in developing bots in Python. It appears 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 appreciated.<div>=
<br></div><div><i>Refs</i>:</div><div><ol><li><a href=3D"https://robocode-d=
ev.github.io/tank-royale/" target=3D"_blank" rel=3D"nofollow" data-saferedi=
recturl=3D"https://www.google.com/url?hl=3Dda&amp;q=3Dhttps://robocode-dev.=
github.io/tank-royale/&amp;source=3Dgmail&amp;ust=3D1727280071789000&amp;us=
g=3DAOvVaw0luVYjkynGbXj9ic1RUDN2">https://robocode-dev.github.io/tank-royal=
e/</a><br></li></ol></div></div></blockquote></div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;Robocode&quot; 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/9f33c957-cbdc-4cf0-99b4-fff5674054b6n%40googlegroups.co=
m?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.com/d/msgid=
/robocode/9f33c957-cbdc-4cf0-99b4-fff5674054b6n%40googlegroups.com</a>.<br =
/>

------=_Part_193131_543341686.1727194941970--

------=_Part_193130_1747776617.1727194941970--