Part of TacticalTeamSetting
What's this ?
is a new game mode for Robocode.
there are two teams and one ball.
The objective of the game is to put the ball in the enemy goal (just like soccer).
The score limit is 300.
Your team can score in several ways :
- you kill an enemy bot: 50 points (very hard to kill a intelligent bot see below)
- you put the ball in the enemy goal: 25 points
- you kill the enemy Captain: automatic win (since the game can't do without it)
You can perform (regular Robocode actions are valid) :
- your speed is limited to 4
- the ball speed is not limited so it can move faster than bots.
- go to one goal, when you arrive your bot will have 100 energy (the robot energy is set to 100) or 200 if it is a Captain.
- shoot at the ball. The ball will then go in the direction of the bullet (if it was standing still, otherwise it will be influenced by the bullet heading corresponding to the bullet power) a 3 power bullet will give a speed to 8 (this is calculated using vector and the norm is the velocity)
- move (as you like)
- ram the ball. It will go in the opposite direction (exactly)
The ball always has 100 energy so it's impossible to kill it.
When it hits a wall it will bounce perpendicularly.
The ball maintains the score of each team.
It's connected to the Captain of each team (by socket)
are regular bots. In addition there are two events that can arrive (you must catch them in onCustomEvent
- WinCondition?: when you win
- LoseCondition?: when you lose
After this events the game will stop.
A int getSide() methods will tell you where is your home.
If getSide()==0 then your home is East wall (all the wall and 40 large) you must put the ball in the West wall
else then your home is West and you must put the ball at East
Captain are leaders of a team. They receive the following events:
- YouScoreCondition?: when you score a goal
- EnemyScoreCondition?: when the enemy score a goal
- StartCondition?: when a new round starts (at the beginning of the game or after a goal)
- in addition to SoccerBot?'s events.
Cool, where can I get it ?
http://robocoderepository.com/BotDetail.jsp?id=1571 Maybe someone can put it on this wiki
just put the file in your robocode folder and unzip (you may want to copy this folder first to be sure)
note that there are no modification of existings files (just new files)
You must have RobocodeGLV014
installed (it use it to write the scores) and robocode expanded in a folder.
you can also do it manualy (there are path info in the zip file).
Basicaly all classes go in the robocode/ directory (the expanded one) except
- EnergySetter? goes in robocode/peer/
- Ball goes to robots/Ball?/
- FirstCaptain?, firstSoccer and FirstTeam? goes to robots/firstTeam/
To run it
Put one ball robot and two team set the inactivity parameter a bit bigger (for me not necessary but I don't know on other systems)
Use a bigger map (default seems to be too small).
How do I write a team ?
You must write one (and only one) CaptainBot? by extending the class and many SoccerBot? (you can use the same several time)
Please note while there are change you must implement the following methods :
public void initialise():
first method called and called only once
public void round():
This methods is enclosed in a while(finishCondition) so you must not have a while(true) (otherwise the game will never finish)
for both Captain and Soccer bot you can't subclass onMessageReceived?() (it's used by the game) but you can subclass onMessageReceivedSoccer?(same parameter)
For Captain you can't subclass onDeath() but onDeathSoccer?(same parameter)
Then write a team file as usual
The code is commented (I mean what each method does) so you can see what each method does or generate a javadoc
It's a basic team (they don't move just firing and go to home when energy goes lesser than 50)
It's just there to illustrate (I mean we can implement more powerfull things, it's sure)
Thanks to FootBallDemo (I don't remember the exact name), it gave me the basic idea
Please : if you see english errors correct them
Please share any modifications you do to this code
I don't know what should be the terrain size and the limit score (currently 300)
If some people are interested and find this fun (I still need to build a solid bot) I'll run a league (when we think all parameters are ready)
If you have any comments and/or suggestions and/or bug reports put them here.
This is cool! Looks like I'll be installing RobocodeGLV014
this weekend. :-) --Dummy
It doesn't seem to work properly on my computer. I get te following error message:
Perhaps I haven't installed RobocodeGLV014
Are you using java 1.4 ? The message about "not scoring" Ball.Ball beacause of no action is normal it don't alter the game. But the main problem of SoccerRobocode is that it's too much complicated to implement a really valid tactics. There's a need of changing some rules so it can become "playable"(that was really a bad english, sorry) --Synnalagma