Re: Robocode Tank Royale - Python?

Sarb <[email protected]> Mon, 30 Sep 2024 14:47:28 -0700 (PDT)
Newsgroups gmane.comp.java.robocode
Message-ID <[email protected]>
------=_Part_51084_193665766.1727732848165
Content-Type: multipart/alternative; 
	boundary="----=_Part_51085_1286867240.1727732848165"

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

Thank you Davide.
Sarb

On Sunday 29 September 2024 at 01:48:34 UTC-7 Davide Cappellini wrote:

> Hi Sarb
>
> If you are interest in taking the longer path, building your own API in=
=20
> python, I wrote a specific page for your case:=20
> https://github.com/robocode-dev/tank-royale/wiki/Tutorial-on-writing-a-Bo=
t-API-for-Tank-Royale
>
> Il giorno mercoled=C3=AC 25 settembre 2024 alle 20:01:50 UTC+2 Sarb ha sc=
ritto:
>
>> 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/tankr=
oyale/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 class=
es=20
>>>> and methods, but in Python style of course.
>>>> 2) Create your own version and just use communicate with the server in=
=20
>>>> a more "raw" fashion by communicating over a WebSocket.
>>>>
>>>> If you choose option 2, you need to send and receive messages using th=
e *protocol=20
>>>> *described here:
>>>>
>>>> https://github.com/robocode-dev/tank-royale/blob/main/schema/schemas/g=
ame/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/g=
ame
>>>>
>>>> If you choose option 1, you should create something similar to *BaseBo=
t=20
>>>> *as a first step (like I did), which handles the basic communication=
=20
>>>> between a 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=20
>>>> implementation for the existing Java Bot AP=20
>>>> <https://robocode-dev.github.io/tank-royale/api/java/dev/robocode/tank=
royale/botapi/package-summary.html>
>>>> I.
>>>> And you could use Python.Net <https://pythonnet.github.io/> for with=
=20
>>>> the existing .Net Bot API=20
>>>> <https://robocode-dev.github.io/tank-royale/api/dotnet/api/Robocode.Ta=
nkRoyale.BotApi.html>
>>>> .
>>>>
>>>> I you want to do a real Python API that are similar to the existing=20
>>>> one, I will be happy to assist you. =F0=9F=91=8D
>>>> I guess most code from the existing platforms can be translated withou=
t=20
>>>> a big hassle for Python. I did the same for Java to .Net, and I will d=
o 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 P=
ython=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/7904456d-41b5-4ff3-be2b-765fce8eaed5n%40googlegroups.com.

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

Thank you Davide.<br />Sarb<br /><br /><div class=3D"gmail_quote"><div dir=
=3D"auto" class=3D"gmail_attr">On Sunday 29 September 2024 at 01:48:34 UTC-=
7 Davide Cappellini wrote:<br/></div><blockquote class=3D"gmail_quote" styl=
e=3D"margin: 0 0 0 0.8ex; border-left: 1px solid rgb(204, 204, 204); paddin=
g-left: 1ex;">Hi Sarb<div><br></div><div>If you are interest in taking the =
longer path, building your own API in python, I wrote a specific page for y=
our case:=C2=A0<a href=3D"https://github.com/robocode-dev/tank-royale/wiki/=
Tutorial-on-writing-a-Bot-API-for-Tank-Royale" target=3D"_blank" rel=3D"nof=
ollow" data-saferedirecturl=3D"https://www.google.com/url?hl=3Den-GB&amp;q=
=3Dhttps://github.com/robocode-dev/tank-royale/wiki/Tutorial-on-writing-a-B=
ot-API-for-Tank-Royale&amp;source=3Dgmail&amp;ust=3D1727819206214000&amp;us=
g=3DAOvVaw2iTVY4raGxfBDZNXfZbEK_">https://github.com/robocode-dev/tank-roya=
le/wiki/Tutorial-on-writing-a-Bot-API-for-Tank-Royale</a><br><br></div><div=
 class=3D"gmail_quote"><div dir=3D"auto" class=3D"gmail_attr">Il giorno mer=
coled=C3=AC 25 settembre 2024 alle 20:01:50 UTC+2 Sarb ha scritto:<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">Thank you Flemming.<div>This l=
ooks very interesting! Let me read up.</div><div>Regards,</div><div>Sarb<br=
><br></div><div class=3D"gmail_quote"><div dir=3D"auto" class=3D"gmail_attr=
">On Tuesday 24 September 2024 at 09:24:59 UTC-7 fnl wrote:<br></div><block=
quote class=3D"gmail_quote" style=3D"margin:0 0 0 0.8ex;border-left:1px sol=
id rgb(204,204,204);padding-left:1ex"><b>Correction:</b><br><a href=3D"http=
s://www.jython.org/" rel=3D"nofollow" style=3D"color:rgb(26,115,232)" targe=
t=3D"_blank" data-saferedirecturl=3D"https://www.google.com/url?hl=3Den-GB&=
amp;q=3Dhttps://www.jython.org/&amp;source=3Dgmail&amp;ust=3D17278192062150=
00&amp;usg=3DAOvVaw1e4nYFHQ_JKMRyPJ8Z_ZG0">Jython</a>=C2=A0is a Python impl=
ementation for Java, which can be used for the=C2=A0the existing=C2=A0<a hr=
ef=3D"https://robocode-dev.github.io/tank-royale/api/java/dev/robocode/tank=
royale/botapi/package-summary.html" 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://robocode-dev.github.io/tank-royale/api/java/=
dev/robocode/tankroyale/botapi/package-summary.html&amp;source=3Dgmail&amp;=
ust=3D1727819206215000&amp;usg=3DAOvVaw3LGWKPeeHQvs_9Fx0UE-mX">Java Bot API=
</a>=C2=A0for Robocode 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 Sa=
rb,<br><br>Currently, there are two official bot APIs for Robocode Tank Roy=
ale:<br><br><b>Java platform:</b>=C2=A0<a href=3D"https://github.com/roboco=
de-dev/tank-royale/tree/main/bot-api/java" rel=3D"nofollow" target=3D"_blan=
k" data-saferedirecturl=3D"https://www.google.com/url?hl=3Den-GB&amp;q=3Dht=
tps://github.com/robocode-dev/tank-royale/tree/main/bot-api/java&amp;source=
=3Dgmail&amp;ust=3D1727819206215000&amp;usg=3DAOvVaw1_FphOEbLf31lE4eeEdIC6"=
>https://github.com/robocode-dev/tank-royale/tree/main/bot-api/java</a><br>=
<b>.Net platform</b>:=C2=A0<a href=3D"https://github.com/robocode-dev/tank-=
royale/tree/main/bot-api/dotnet" rel=3D"nofollow" target=3D"_blank" data-sa=
feredirecturl=3D"https://www.google.com/url?hl=3Den-GB&amp;q=3Dhttps://gith=
ub.com/robocode-dev/tank-royale/tree/main/bot-api/dotnet&amp;source=3Dgmail=
&amp;ust=3D1727819206215000&amp;usg=3DAOvVaw2PJZ6_EEibJ7wdVaIGkmZL">https:/=
/github.com/robocode-dev/tank-royale/tree/main/bot-api/dotnet</a><br><br>An=
d 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) Create an API ver=
y similar to the current APIs that are made very similar on purpose. Meanin=
g that your Python API would have same classes and methods, but in Python s=
tyle of course.<br>2) Create your own version and just use communicate with=
 the server in a more &quot;raw&quot; fashion by communicating over a WebSo=
cket.<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" rel=3D"no=
follow" target=3D"_blank" data-saferedirecturl=3D"https://www.google.com/ur=
l?hl=3Den-GB&amp;q=3Dhttps://github.com/robocode-dev/tank-royale/blob/main/=
schema/schemas/game/README.md&amp;source=3Dgmail&amp;ust=3D1727819206215000=
&amp;usg=3DAOvVaw2i8nJMkUiMv25pSOUw-7FM">https://github.com/robocode-dev/ta=
nk-royale/blob/main/schema/schemas/game/README.md</a><br><br>And the <b>sch=
emas </b>(message formats) are available here (In <a href=3D"https://json-s=
chema.org/specification" rel=3D"nofollow" target=3D"_blank" data-saferedire=
cturl=3D"https://www.google.com/url?hl=3Den-GB&amp;q=3Dhttps://json-schema.=
org/specification&amp;source=3Dgmail&amp;ust=3D1727819206215000&amp;usg=3DA=
OvVaw17MgvwTVr_JdXcQ2m8WZ40">JsonSchema </a>format)<br><a href=3D"https://g=
ithub.com/robocode-dev/tank-royale/tree/main/schema/schemas/game" rel=3D"no=
follow" target=3D"_blank" data-saferedirecturl=3D"https://www.google.com/ur=
l?hl=3Den-GB&amp;q=3Dhttps://github.com/robocode-dev/tank-royale/tree/main/=
schema/schemas/game&amp;source=3Dgmail&amp;ust=3D1727819206215000&amp;usg=
=3DAOvVaw0aBWy5RO3VxIw7lArBgkjw">https://github.com/robocode-dev/tank-royal=
e/tree/main/schema/schemas/game</a><br><br>If you choose option 1, you shou=
ld create something similar to <b>BaseBot </b>as a first step (like I did),=
 which handles the basic communication between a bot and the server.<br>Lat=
er you can create a <b>Bot </b>with more advanced methods as step 2.<br><br=
>Also note that you could use the existing APIs as is. For example, we have=
 <a href=3D"https://www.jython.org/" rel=3D"nofollow" target=3D"_blank" dat=
a-saferedirecturl=3D"https://www.google.com/url?hl=3Den-GB&amp;q=3Dhttps://=
www.jython.org/&amp;source=3Dgmail&amp;ust=3D1727819206215000&amp;usg=3DAOv=
Vaw1e4nYFHQ_JKMRyPJ8Z_ZG0">Jython</a>, which is a Python implementation for=
 the existing=C2=A0<a href=3D"https://robocode-dev.github.io/tank-royale/ap=
i/java/dev/robocode/tankroyale/botapi/package-summary.html" 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/api/java/dev/ro=
bocode/tankroyale/botapi/package-summary.html&amp;source=3Dgmail&amp;ust=3D=
1727819206215000&amp;usg=3DAOvVaw3LGWKPeeHQvs_9Fx0UE-mX">Java Bot AP</a>I.<=
div>And you could use <a href=3D"https://pythonnet.github.io/" rel=3D"nofol=
low" target=3D"_blank" data-saferedirecturl=3D"https://www.google.com/url?h=
l=3Den-GB&amp;q=3Dhttps://pythonnet.github.io/&amp;source=3Dgmail&amp;ust=
=3D1727819206215000&amp;usg=3DAOvVaw2X5Sin5yWQsSW1ibLqaRB7">Python.Net</a> =
for with the existing<a href=3D"https://robocode-dev.github.io/tank-royale/=
api/dotnet/api/Robocode.TankRoyale.BotApi.html" 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/api/dotnet/api/Robocode.TankR=
oyale.BotApi.html&amp;source=3Dgmail&amp;ust=3D1727819206215000&amp;usg=3DA=
OvVaw2PbEKxTm8F5MJ5mCAA_3mN"> .Net Bot API</a>.<br><br>I you want to do a r=
eal Python API that are similar to the existing one, I will be happy to ass=
ist you. =F0=9F=91=8D<br>I guess most code from the existing platforms 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_quote"><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);padding-left:1ex">Apologie=
s if this question has already been asked.<div><br></div><div>I am interest=
ed in developing bots in Python. It appears this may be possible with Roboc=
ode Tank Royale. How would I go about building a Python bot API? Any pointe=
rs or guidance would be greatly appreciated.<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.goo=
gle.com/url?hl=3Den-GB&amp;q=3Dhttps://robocode-dev.github.io/tank-royale/&=
amp;source=3Dgmail&amp;ust=3D1727819206215000&amp;usg=3DAOvVaw0zFUDL7kZdBSf=
GjXFz92b0">https://robocode-dev.github.io/tank-royale/</a><br></li></ol></d=
iv></div></blockquote></div></blockquote></div></blockquote></div></blockqu=
ote></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/7904456d-41b5-4ff3-be2b-765fce8eaed5n%40googlegroups.co=
m?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.com/d/msgid=
/robocode/7904456d-41b5-4ff3-be2b-765fce8eaed5n%40googlegroups.com</a>.<br =
/>

------=_Part_51085_1286867240.1727732848165--

------=_Part_51084_193665766.1727732848165--