Re: Robocode Tank Royale - Python?

Sarb <[email protected]> Tue, 24 Sep 2024 19:52:23 -0700 (PDT)
Newsgroups gmane.comp.java.robocode
Message-ID <[email protected]>
------=_Part_301856_1211424343.1727232743910
Content-Type: multipart/alternative; 
	boundary="----=_Part_301857_849147095.1727232743910"

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

Thank you Flemming.
This looks very interesting! Let me read up.
Regards,
Sarb

On Tuesday 24 September 2024 at 09:24:59 UTC-7 fnl wrote:

> *Correction:*
> Jython <https://www.jython.org/> is a Python implementation for Java,=20
> which can be used for the the existing Java Bot API=20
> <https://robocode-dev.github.io/tank-royale/api/java/dev/robocode/tankroy=
ale/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/gam=
e/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/gam=
e
>>
>> 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=20
>> have Jython <https://www.jython.org/>, which is a Python implementation=
=20
>> for the existing Java Bot AP=20
>> <https://robocode-dev.github.io/tank-royale/api/java/dev/robocode/tankro=
yale/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.Tank=
Royale.BotApi.html>
>> .
>>
>> I you want to do a real Python API that are similar to the existing one,=
=20
>> I 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 Pyt=
hon=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/fd3b4c04-71d5-40df-bcf5-ae9d47b4aa06n%40googlegroups.com.

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

Thank you Flemming.<div>This looks very interesting! Let me read up.</div><=
div>Regards,</div><div>Sarb<br /><br /></div><div class=3D"gmail_quote"><di=
v dir=3D"auto" class=3D"gmail_attr">On Tuesday 24 September 2024 at 09:24:5=
9 UTC-7 fnl wrote:<br/></div><blockquote class=3D"gmail_quote" style=3D"mar=
gin: 0 0 0 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: =
1ex;"><b>Correction:</b><br><a href=3D"https://www.jython.org/" rel=3D"nofo=
llow" style=3D"color:rgb(26,115,232)" target=3D"_blank" data-saferedirectur=
l=3D"https://www.google.com/url?hl=3Den-GB&amp;q=3Dhttps://www.jython.org/&=
amp;source=3Dgmail&amp;ust=3D1727319077403000&amp;usg=3DAOvVaw1k83KVaASEemb=
hImGE_Y5m">Jython</a>=C2=A0is a Python implementation for Java, which can b=
e used for the=C2=A0the existing=C2=A0<a href=3D"https://robocode-dev.githu=
b.io/tank-royale/api/java/dev/robocode/tankroyale/botapi/package-summary.ht=
ml" rel=3D"nofollow" style=3D"color:rgb(26,115,232)" target=3D"_blank" data=
-saferedirecturl=3D"https://www.google.com/url?hl=3Den-GB&amp;q=3Dhttps://r=
obocode-dev.github.io/tank-royale/api/java/dev/robocode/tankroyale/botapi/p=
ackage-summary.html&amp;source=3Dgmail&amp;ust=3D1727319077403000&amp;usg=
=3DAOvVaw0mEWPGXQvEW6cuaORpInP6">Java Bot API</a>=C2=A0for Robocode Tank Ro=
yale.<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><bloc=
kquote class=3D"gmail_quote" style=3D"margin:0 0 0 0.8ex;border-left:1px so=
lid rgb(204,204,204);padding-left:1ex">Hi Sarb,<br><br>Currently, there are=
 two official bot APIs for Robocode Tank Royale:<br><br><b>Java platform:</=
b>=C2=A0<a href=3D"https://github.com/robocode-dev/tank-royale/tree/main/bo=
t-api/java" rel=3D"nofollow" target=3D"_blank" data-saferedirecturl=3D"http=
s://www.google.com/url?hl=3Den-GB&amp;q=3Dhttps://github.com/robocode-dev/t=
ank-royale/tree/main/bot-api/java&amp;source=3Dgmail&amp;ust=3D172731907740=
3000&amp;usg=3DAOvVaw0Sz5AyUJHTllN5s4_y6gmA">https://github.com/robocode-de=
v/tank-royale/tree/main/bot-api/java</a><br><b>.Net platform</b>:=C2=A0<a h=
ref=3D"https://github.com/robocode-dev/tank-royale/tree/main/bot-api/dotnet=
" rel=3D"nofollow" target=3D"_blank" data-saferedirecturl=3D"https://www.go=
ogle.com/url?hl=3Den-GB&amp;q=3Dhttps://github.com/robocode-dev/tank-royale=
/tree/main/bot-api/dotnet&amp;source=3Dgmail&amp;ust=3D1727319077403000&amp=
;usg=3DAOvVaw015If6C9itkGsTCtQRHiAU">https://github.com/robocode-dev/tank-r=
oyale/tree/main/bot-api/dotnet</a><br><br>And at some point I will introduc=
e 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 t=
hat are made very similar on purpose. Meaning that your Python API would ha=
ve same classes and methods, but in Python style of course.<br>2) Create yo=
ur own version and just use communicate with the server in a more &quot;raw=
&quot; fashion by communicating over a WebSocket.<br><br>If you choose opti=
on 2, you need to send and receive messages using the <b>protocol </b>descr=
ibed here:<br><a href=3D"https://github.com/robocode-dev/tank-royale/blob/m=
ain/schema/schemas/game/README.md" rel=3D"nofollow" target=3D"_blank" data-=
saferedirecturl=3D"https://www.google.com/url?hl=3Den-GB&amp;q=3Dhttps://gi=
thub.com/robocode-dev/tank-royale/blob/main/schema/schemas/game/README.md&a=
mp;source=3Dgmail&amp;ust=3D1727319077403000&amp;usg=3DAOvVaw0oS-lOq2FpMuoc=
yLWq0coW">https://github.com/robocode-dev/tank-royale/blob/main/schema/sche=
mas/game/README.md</a><br><br>And the <b>schemas </b>(message formats) are =
available here (In <a href=3D"https://json-schema.org/specification" rel=3D=
"nofollow" target=3D"_blank" data-saferedirecturl=3D"https://www.google.com=
/url?hl=3Den-GB&amp;q=3Dhttps://json-schema.org/specification&amp;source=3D=
gmail&amp;ust=3D1727319077403000&amp;usg=3DAOvVaw1xP7FtnCF4lKPU8kdVIwPI">Js=
onSchema </a>format)<br><a href=3D"https://github.com/robocode-dev/tank-roy=
ale/tree/main/schema/schemas/game" rel=3D"nofollow" target=3D"_blank" data-=
saferedirecturl=3D"https://www.google.com/url?hl=3Den-GB&amp;q=3Dhttps://gi=
thub.com/robocode-dev/tank-royale/tree/main/schema/schemas/game&amp;source=
=3Dgmail&amp;ust=3D1727319077403000&amp;usg=3DAOvVaw3FsBpQi_19nk0ANKkvHH09"=
>https://github.com/robocode-dev/tank-royale/tree/main/schema/schemas/game<=
/a><br><br>If you choose option 1, you should create something similar to <=
b>BaseBot </b>as a first step (like I did), which handles the basic communi=
cation between a bot and the server.<br>Later you can create a <b>Bot </b>w=
ith more advanced methods as step 2.<br><br>Also note that you could use th=
e existing APIs as is. For example, we have <a href=3D"https://www.jython.o=
rg/" rel=3D"nofollow" target=3D"_blank" data-saferedirecturl=3D"https://www=
.google.com/url?hl=3Den-GB&amp;q=3Dhttps://www.jython.org/&amp;source=3Dgma=
il&amp;ust=3D1727319077403000&amp;usg=3DAOvVaw1k83KVaASEembhImGE_Y5m">Jytho=
n</a>, which is a Python implementation for the existing=C2=A0<a href=3D"ht=
tps://robocode-dev.github.io/tank-royale/api/java/dev/robocode/tankroyale/b=
otapi/package-summary.html" rel=3D"nofollow" target=3D"_blank" data-safered=
irecturl=3D"https://www.google.com/url?hl=3Den-GB&amp;q=3Dhttps://robocode-=
dev.github.io/tank-royale/api/java/dev/robocode/tankroyale/botapi/package-s=
ummary.html&amp;source=3Dgmail&amp;ust=3D1727319077403000&amp;usg=3DAOvVaw0=
mEWPGXQvEW6cuaORpInP6">Java Bot AP</a>I.<div>And you could use <a href=3D"h=
ttps://pythonnet.github.io/" rel=3D"nofollow" target=3D"_blank" data-safere=
directurl=3D"https://www.google.com/url?hl=3Den-GB&amp;q=3Dhttps://pythonne=
t.github.io/&amp;source=3Dgmail&amp;ust=3D1727319077403000&amp;usg=3DAOvVaw=
0HnrAjB9JpCXagfhJVXKtS">Python.Net</a> for with the existing<a href=3D"http=
s://robocode-dev.github.io/tank-royale/api/dotnet/api/Robocode.TankRoyale.B=
otApi.html" rel=3D"nofollow" target=3D"_blank" data-saferedirecturl=3D"http=
s://www.google.com/url?hl=3Den-GB&amp;q=3Dhttps://robocode-dev.github.io/ta=
nk-royale/api/dotnet/api/Robocode.TankRoyale.BotApi.html&amp;source=3Dgmail=
&amp;ust=3D1727319077404000&amp;usg=3DAOvVaw06ypTSr8yWmb5ChI0B8j0E"> .Net B=
ot API</a>.<br><br>I you want to do a real Python API that are similar to t=
he existing one, I will be happy to assist you. =F0=9F=91=8D<br>I guess mos=
t code from the existing platforms can be translated without a big hassle f=
or Python. I did the same for Java to .Net, and I will do it again later fo=
r 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 d=
en 24. september 2024 kl. 18.00.54 UTC+2 skrev Sarb:<br></div><blockquote c=
lass=3D"gmail_quote" style=3D"margin:0 0 0 0.8ex;border-left:1px solid rgb(=
204,204,204);padding-left:1ex">Apologies if this question has already been =
asked.<div><br></div><div>I am interested in developing bots in Python. It =
appears this may be possible with Robocode Tank Royale. How would I go abou=
t building a Python bot API? Any pointers or guidance would be greatly appr=
eciated.<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" =
data-saferedirecturl=3D"https://www.google.com/url?hl=3Den-GB&amp;q=3Dhttps=
://robocode-dev.github.io/tank-royale/&amp;source=3Dgmail&amp;ust=3D1727319=
077404000&amp;usg=3DAOvVaw2EZp9NBvc0OrGV82a_RtcU">https://robocode-dev.gith=
ub.io/tank-royale/</a><br></li></ol></div></div></blockquote></div></blockq=
uote></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/fd3b4c04-71d5-40df-bcf5-ae9d47b4aa06n%40googlegroups.co=
m?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.com/d/msgid=
/robocode/fd3b4c04-71d5-40df-bcf5-ae9d47b4aa06n%40googlegroups.com</a>.<br =
/>

------=_Part_301857_849147095.1727232743910--

------=_Part_301856_1211424343.1727232743910--