en doc
This commit is contained in:
parent
3758ab5866
commit
aa35d1a2bb
|
@ -1,10 +1,10 @@
|
||||||
<h2>Fonctionnement des combats de Tron</h2>
|
<h2> How Tron Fights Works </h2>
|
||||||
<h3>Règles du jeu (hors specs techniques)</h3>
|
<h3> Game's rules (excluding technical specs) </h3>
|
||||||
<p>Chaque bot démarre depuis une case choisie au hasard par l'arène.</p>
|
<p> Each bot starts from a point randomly selected by the arena. </p>
|
||||||
<p>A chaque tour, il est demandé aux bots de grandir d'une case. Il peut choisir la direction. Sa queue s'allonge.</p>
|
<p> At each turn, bots are asked to grow one square. they can choose the direction.</p>
|
||||||
<p>Si un bot percute une case déjà prise par sa queue ou celle d'un autre, il perd.</p>
|
<p> If a bot strikes a cell already taken by its trail or that of another, it loses. </p>
|
||||||
<p>Ce n'est pas du tour par tour, les bots jouent simultanément, ils peuvent donc perdre en choisissant la même case de destination qu'un autre serpent</p>
|
<p> It is not turn-based, bots are playinig simultaneously, so they can lose by choosing the same destination cell as another snake.</p>
|
||||||
<p>Exemple:</p>
|
<p> Example: </p>
|
||||||
<table class="tabledoc">
|
<table class="tabledoc">
|
||||||
<tr><th>9</th><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
|
<tr><th>9</th><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
|
||||||
<tr><th>8</th><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
|
<tr><th>8</th><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
|
||||||
|
@ -17,7 +17,7 @@
|
||||||
<tr><th>1</th><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
|
<tr><th>1</th><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
|
||||||
<tr><th>0</th><th>1</th><th>2</th><th>3</th><th>4</th><th>5</th><th>6</th><th>7</th><th>8</th><th>9</th></tr>
|
<tr><th>0</th><th>1</th><th>2</th><th>3</th><th>4</th><th>5</th><th>6</th><th>7</th><th>8</th><th>9</th></tr>
|
||||||
</table>
|
</table>
|
||||||
<p>Si dans le même tour le serpent vert et le serpent rouge décident d'aller respectivement vers la gauche et vers la droite, ils vont se télescoper et perdre tous les deux.</p>
|
<p>If in the same turn the green snake and the red snake decide to go respectively to the left and to the right, they will telescope and both will lose.</p>
|
||||||
<table class="tabledoc">
|
<table class="tabledoc">
|
||||||
<tr><th>9</th><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
|
<tr><th>9</th><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
|
||||||
<tr><th>8</th><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
|
<tr><th>8</th><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
|
||||||
|
@ -30,96 +30,99 @@
|
||||||
<tr><th>1</th><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
|
<tr><th>1</th><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
|
||||||
<tr><th>0</th><th>1</th><th>2</th><th>3</th><th>4</th><th>5</th><th>6</th><th>7</th><th>8</th><th>9</th></tr>
|
<tr><th>0</th><th>1</th><th>2</th><th>3</th><th>4</th><th>5</th><th>6</th><th>7</th><th>8</th><th>9</th></tr>
|
||||||
</table>
|
</table>
|
||||||
<p>Lorsqu'un serpent meurt, (lorsqu'un bot perd) Sa queue est effacée et les cases prises par cette dernière deviennent libres pour les serpents encore en vie.</p>
|
<p>When a snake dies, (when a bot loses) its tail is erased and cells taken by it become free for snakes still alive.</p>
|
||||||
<p>Le jeu prend fin lorsqu'il reste moins de deux serpents.</p>
|
<p>The game ends when there are less than two snakes left</p>
|
||||||
<h3>La grille</h3>
|
<h3>Grid</h3>
|
||||||
<ul>
|
<ul>
|
||||||
<li>largeur: 1000 cases</li>
|
<li>width: 1000 cells</li>
|
||||||
<li>hauteur: 1000 cases</li>
|
<li>Height: 1000 cells</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<h3>Communications entre l'arène et les bots</h3>
|
<h3>Communications between the arena and the bots</h3>
|
||||||
<p>L'arène fait émet des requêtes http(s) à destination des bots.</p>
|
<p>The arena does send http (s) requests to the bots.</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li>Type: POST</li>
|
<li>Type: POST</li>
|
||||||
<li>informations: au format JSON dans le corps de la requetes</li>
|
<li>in JSON format inside the query's body</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<h3>Initialisation de la partie</h3>
|
<h3>Initialization of the game</h3>
|
||||||
<p>L'arène (ce site) envoie le message (exemple) suivant à votre bot:</p>
|
<p>The arena (this site) sends the following exemple message to your bot:</p>
|
||||||
<pre>
|
<pre>
|
||||||
{"game-id":"1679","action":"init","game":"tron","board":"","players":4,"player-index":2}
|
{"game-id":"1679","action":"init","game":"tron","board":"","players":4,"player-index":2}
|
||||||
</pre>
|
</pre>
|
||||||
<ul>
|
<ul>
|
||||||
<li><em>game-id</em> String Identifiant unique de la partie. Votre bot peut être emmené à jouer plusieurs parties en simultané. Si le fonctionnement de votre bot nécessite de suivre / conserver des valeurs entre deux tours de l'arène, cet identifiant vous sera utile.</li>
|
<li><em>game-id</em> String The unique identifier of the game. Your bot can be led to play several parts simultaneously. If the functioning of your bot requires to keep data between two turns of the arena, this identifier will be useful.</li>
|
||||||
<li><em>action</em> String, peut prendre les valeurs init ou play-turn, mais à cette étape, c'est init</li>
|
<li><em>action</em> String, can be "init" or "play-turn". For the current step, it's "init"</li>
|
||||||
<li><em>game</em> String, sera toujours "tron" ici. Peut vous servir si vous utilisez la même URL pour plusieurs bots.</li>
|
<li><em>game</em> String, Always "tron" here,can be usefull if you use the same URL to serve many bots</li>
|
||||||
<li><em>board</em> Sera vide à cette étape</li>
|
<li><em>board</em> Is empty at this step./li>
|
||||||
<li><em>players</em> Entier Vous indique le nombre de joueurs sur cette partie. Il est possible que votre bot "joue" plusieurs joueurs. Et si vous les faisiez collaborer en ce cas là?</li>
|
<li><em>players</em> Intreger indicating how many bots are playing this game.Your bot can "play" several players on the same game. What if you had them collaborate in that case?</li>
|
||||||
<li><em>player-index</em> Entier Le numéro de votre bot. Le premier bot a le numéro 0. Vous gardez le même numéro durant toute la partie, même si des joueurs sont déjà morts</li>
|
<li><em>player-index</em> Entier Your bot number. The first bot is player-index: 0. You'll keep the same number throughout the game, even if some others players are already dead.</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<p>Votre bot doit répondre par un tableau au format json, comme ceci:</p>
|
<p>Your bot must respond with an array in json format, like this:</p>
|
||||||
<pre>
|
<pre>
|
||||||
{"name":"botName"}
|
{"name":"botName"}
|
||||||
</pre>
|
</pre>
|
||||||
<p>L'arène ne vérifie pas actuellement cette réponse, l'étape d'init a été insérée pour assurer la compatibilité avec <a href="https://github.com/moul/bolosseum">Bolosseum</a>.
|
<p>
|
||||||
Si votre bot repond une page blanche à cette étape (action=init), ça marchera dans le cadre de botsarena.</p>
|
The arena does not currently verify this response, the init step has been inserted to ensure compatibility with Bolosseum. If your bot answers a blank page at this stage (action = init), it will work as part of botsarena.
|
||||||
|
</p>
|
||||||
|
|
||||||
<h3>Tours de jeu</h3>
|
<h3>Game's laps</h3>
|
||||||
<p>Exemple de message envoyé par l'arène au premier tour de jeu:</p>
|
<p>Exemple of arena's message send on the first lap:</p>
|
||||||
|
|
||||||
<p>Exemple de message envoyé par l'arène après quelques tours de jeu:</p>
|
|
||||||
|
<p>Exemple of arena's message send after some laps:</p>
|
||||||
<pre>
|
<pre>
|
||||||
{"game-id":"1680","action":"play-turn","game":"tron","board":[[[687,110],[687,111],[686,111],[686,110],[686,109],[686,108],[686,107],[685,107],[685,108],[685,109],[684,109],[684,110],[684,111],[684,112],[684,113],[683,113],[682,113],[681,113],[681,114],[681,115],[681,116],[680,116],[680,117],[679,117],[679,116],[679,115],[679,114],[679,113],[679,112],[679,111],[679,110],[679,109],[678,109],[678,108],[677,108],[676,108],[676,107],[676,106],[676,105],[676,104],[676,103],[675,103],[674,103],[674,102],[673,102],[672,102],[672,101],[671,101],[670,101],[669,101],[669,102],[669,103],[669,104],[669,105],[669,106],[669,107],[668,107],[668,108],[668,109],[668,110],[668,111],[668,112],[667,112],[667,111],[667,110],[666,110],[666,109],[666,108],[665,108],[664,108],[664,107],[664,106],[663,106],[663,107],[663,108],[662,108],[661,108],[660,108],[660,107],[659,107],[659,106],[658,106],[657,106],[657,105],[657,104],[656,104],[656,103],[655,103],[655,102],[655,101],[654,101],[654,102],[654,103],[654,104],[653,104],[653,103],[653,102],[653,101],[653,100],[652,100],[651,100],[651,101],[651,102],[651,103],[651,104],[650,104],[650,105],[650,106],[649,106],[649,105],[648,105]],[[100,225],[100,226],[100,227],[100,228],[100,229],[100,230],[100,231],[99,231],[98,231],[98,232],[97,232],[96,232],[96,231],[96,230],[96,229],[96,228],[96,227],[96,226],[96,225],[96,224],[96,223],[95,223],[95,222],[94,222],[94,221],[94,220],[93,220],[92,220],[92,219],[92,218],[92,217],[92,216],[92,215],[91,215],[91,214],[90,214],[89,214],[89,213],[89,212],[88,212],[88,213],[88,214],[87,214],[87,213],[86,213],[86,214],[86,215],[85,215],[85,214],[84,214],[84,215],[83,215],[83,216],[83,217],[82,217],[82,216],[81,216],[81,215],[80,215],[80,216],[79,216],[79,215],[79,214],[78,214],[77,214],[77,213],[77,212],[76,212],[75,212],[75,211],[75,210],[75,209],[74,209],[74,210],[74,211],[73,211],[73,210],[72,210],[72,209],[71,209],[71,210],[70,210],[70,209],[69,209],[68,209],[68,210],[68,211],[67,211],[67,210],[67,209],[67,208],[66,208],[66,207],[66,206],[66,205],[66,204],[66,203],[65,203],[65,204],[64,204],[64,203],[63,203],[63,204],[63,205],[63,206],[62,206],[61,206],[61,207],[60,207],[60,208],[59,208]]],"player-index":0,"players":2}
|
{"game-id":"1680","action":"play-turn","game":"tron","board":[[[687,110],[687,111],[686,111],[686,110],[686,109],[686,108],[686,107],[685,107],[685,108],[685,109],[684,109],[684,110],[684,111],[684,112],[684,113],[683,113],[682,113],[681,113],[681,114],[681,115],[681,116],[680,116],[680,117],[679,117],[679,116],[679,115],[679,114],[679,113],[679,112],[679,111],[679,110],[679,109],[678,109],[678,108],[677,108],[676,108],[676,107],[676,106],[676,105],[676,104],[676,103],[675,103],[674,103],[674,102],[673,102],[672,102],[672,101],[671,101],[670,101],[669,101],[669,102],[669,103],[669,104],[669,105],[669,106],[669,107],[668,107],[668,108],[668,109],[668,110],[668,111],[668,112],[667,112],[667,111],[667,110],[666,110],[666,109],[666,108],[665,108],[664,108],[664,107],[664,106],[663,106],[663,107],[663,108],[662,108],[661,108],[660,108],[660,107],[659,107],[659,106],[658,106],[657,106],[657,105],[657,104],[656,104],[656,103],[655,103],[655,102],[655,101],[654,101],[654,102],[654,103],[654,104],[653,104],[653,103],[653,102],[653,101],[653,100],[652,100],[651,100],[651,101],[651,102],[651,103],[651,104],[650,104],[650,105],[650,106],[649,106],[649,105],[648,105]],[[100,225],[100,226],[100,227],[100,228],[100,229],[100,230],[100,231],[99,231],[98,231],[98,232],[97,232],[96,232],[96,231],[96,230],[96,229],[96,228],[96,227],[96,226],[96,225],[96,224],[96,223],[95,223],[95,222],[94,222],[94,221],[94,220],[93,220],[92,220],[92,219],[92,218],[92,217],[92,216],[92,215],[91,215],[91,214],[90,214],[89,214],[89,213],[89,212],[88,212],[88,213],[88,214],[87,214],[87,213],[86,213],[86,214],[86,215],[85,215],[85,214],[84,214],[84,215],[83,215],[83,216],[83,217],[82,217],[82,216],[81,216],[81,215],[80,215],[80,216],[79,216],[79,215],[79,214],[78,214],[77,214],[77,213],[77,212],[76,212],[75,212],[75,211],[75,210],[75,209],[74,209],[74,210],[74,211],[73,211],[73,210],[72,210],[72,209],[71,209],[71,210],[70,210],[70,209],[69,209],[68,209],[68,210],[68,211],[67,211],[67,210],[67,209],[67,208],[66,208],[66,207],[66,206],[66,205],[66,204],[66,203],[65,203],[65,204],[64,204],[64,203],[63,203],[63,204],[63,205],[63,206],[62,206],[61,206],[61,207],[60,207],[60,208],[59,208]]],"player-index":0,"players":2}
|
||||||
</pre>
|
</pre>
|
||||||
<p>Les champs suivants sont les mêmes qu'au paragraphe précédent:</p>
|
<p>Following fields are as in the previous paragraph:</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li><em>game-id</em></li>
|
<li><em>game-id</em></li>
|
||||||
<li><em>game</em></li>
|
<li><em>game</em></li>
|
||||||
<li><em>players</em></li>
|
<li><em>players</em></li>
|
||||||
<li><em>player-index</em></li>
|
<li><em>player-index</em></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
<p>Not same fields are:</p>
|
||||||
Les champs qui différent sont:
|
|
||||||
<ul>
|
<ul>
|
||||||
<li><em>action</em>String, est toujours "play-turn" à cette étape</li>
|
<li><em>action</em>String, always "play-turn" for this step.</li>
|
||||||
<li><em>board</em>Je vous explique ça au chapitre suivant.</li>
|
<li><em>board</em>A full chapter is needed ti explain that.</li>
|
||||||
</ul>
|
</ul>
|
||||||
<h4>La Carte (board)</h4>
|
<h4>The map / the board</h4>
|
||||||
<p>Elle est représentée dans le champs "board" du JSON envoyé par l'arène. Elle décrit les cases prises par chaque joueur.</p>
|
<p>It is contained on "board" field. All the cells taken by each player are writted in.</p>
|
||||||
<p> Elle est composée de plusieurs sous-arrays/sous-objets (en fonction de votre language de programmation). Elle se décompose en sous tableaux de la forme suivante:<p>
|
|
||||||
|
It is composed of several subarrays / subobjects (depending on your programming language).
|
||||||
|
the sub-tables haved the following form:
|
||||||
<ul>
|
<ul>
|
||||||
<li>Board:
|
<li>Board:
|
||||||
<ul>
|
<ul>
|
||||||
<li>Joueur 1
|
<li>Player 1
|
||||||
<ul>
|
<ul>
|
||||||
<li>Case1
|
<li>Cell 1
|
||||||
<ul>
|
<ul>
|
||||||
<li>Coordonnée X</li>
|
<li>Coordinate X</li>
|
||||||
<li>Coordonnée Y</li>
|
<li>Coordinate Y</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li>Case2
|
<li>Cell2
|
||||||
<ul>
|
<ul>
|
||||||
<li>coordonnée X</li>
|
<li>Coordinate X</li>
|
||||||
<li>Coordonnée Y</li>
|
<li>Coordinate Y</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li>Joueur 2>
|
<li>Player 2>
|
||||||
<ul>
|
<ul>
|
||||||
<li>Case1
|
<li>Cell 1
|
||||||
<ul>
|
<ul>
|
||||||
<li>coordonnée X</li>
|
<li>Coordinate X</li>
|
||||||
<li>Coordonnée Y</li>
|
<li>Coordinate Y</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li>Case2
|
<li>Cell 2
|
||||||
<ul>
|
<ul>
|
||||||
<li>coordonnée X</li>
|
<li>Coordinate X</li>
|
||||||
<li>Coordonnée Y</li>
|
<li>Coordinate Y</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -129,7 +132,7 @@ Les champs qui différent sont:
|
||||||
<ul>
|
<ul>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<p> La représentation JSON est la suivante:</p>
|
<p> JSON form is as follows:</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
[<br />
|
[<br />
|
||||||
|
@ -140,10 +143,11 @@ Les champs qui différent sont:
|
||||||
(...)<br />
|
(...)<br />
|
||||||
]<br />
|
]<br />
|
||||||
</p>
|
</p>
|
||||||
<p>L'ordre des "queues" des serpents dans ce tableau correspond à l'ordre des joueurs. Donc votre serpent est representée par la queue correspondant à player-index (le décompte de player-index commence par 0).</p>
|
<p>Trails'order on this table is the same as Player's order. So, your "snake" has the trail corresponding with player-index. (First player-index value is 0).</p>
|
||||||
<p>L'ordre des couples de coordonnées de chaque bot, est dans le sens tête vers queue. Les bots grandissent à chaque tour en déplaçant leur tête.</p>
|
<p>coordinate's are from the head to the trail. Bots grow by moving their heads.</p>
|
||||||
<h2>La réponse de votre bot</h2>
|
|
||||||
<p>Il retourne la direction qu'il souhaite prendre sous la forme d'un array.</p><p>4 possibilités:</p>
|
<h2>Bot's awnser</h2>
|
||||||
|
<p> It returns direction it wants on a JSON array.</p><p>4 possibilies:</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
{"play":"x+"}
|
{"play":"x+"}
|
||||||
|
@ -157,15 +161,15 @@ Les champs qui différent sont:
|
||||||
<pre>
|
<pre>
|
||||||
{"play":"y-"}
|
{"play":"y-"}
|
||||||
</pre>
|
</pre>
|
||||||
<p>La façon de noter les directions me semble assez explicite pour que je ne détaille pas.</p>
|
<p>The way to note the directions seems fairly explicit for me to not explain.</p>
|
||||||
<h2>Scoring</h2>
|
<h2>Scoring</h2>
|
||||||
<p>Le scorring (classement EHLO) reste sur une logique de duels, bien que ce jeu puisse contenir plus de deux bots par match. Le score est modifié au fur et à mesure de la partie à chaque fois qu'un bot "décède":</p>
|
<p>The scoring (EHLO classification) remains on a logic of duels, although this game can contain more than two bots per game. The score is changed as the game happens each time a bot dies:</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li>Lors de la défaite d'un bot, l'arène enregistre un match nul contre tous les autres bots qui ont aussi perdu au même tour de jeu.</li>
|
<li> During the defeat of a bot, the arena records a draw against all the other bots that also lost in the same round of play.</li>
|
||||||
<li>Elle enregistre aussi une défaite des bots morts contre tous les bots encore en course à la fin du tour.</li>
|
<li>It also records a defeat of the dead bots against all the bots still in the race at the end of the round.</li>
|
||||||
</ul>
|
</ul>
|
||||||
<h2>
|
|
||||||
|
|
||||||
<h2>Outils pour développer et tester votre bot</h2>
|
<h2>Tools to develop and test your bot</h2>
|
||||||
<p>Malheureusement aucun outil pour le moment. Ca viendra dans les semaines qui viennent, peut être sous la forme d'une interface swagger</p>
|
<p>Unfortunately no tools yet. It will come in the weeks to come, maybe in the form of a swagger interface</p>
|
||||||
<p>Et il faut aussi que je développe une AI moins stupide que stupid IA, car actuellement comme il se suicide trop vite, ça ne permet ni de tester l'arène ni un bot plus intelligent</p>
|
<p>And I must also develop an AI less stupid than stupid IA, because currently as it commits suicide too fast, it does not allow to test the arena nor a more intelligent bot.</p>
|
||||||
|
ent</p>
|
Loading…
Reference in New Issue
Block a user