Basics
- In order to play in RDM, your bot need to extends robocode.DeathMatchRobot?.
- Just build your bot as usual the same methods are available.
- The only things you need to do is rename the run() methods to runDeathMatch().
- That's all!!!
On the robocode screen you will see that your bot as between 400 and 500 energy, this is normal. But the getEnergy() and ScannedRobotEvent.getEnergy() will still return a number between 0 and 100 (can be negative if a bot is dead).
Additional methods
- public long getTimeLimit?() : return the time limit for this game, if the time limit is 0 the no time limit is used, see rules for more info about time limit.
- public int getFragLimit?() : return the frag limit for this game, if the frag limit is 0 the no frag limit is used, see rules for more info about frag limit.
- public ScoreDM? getScore() : return a ScoreDM? object wich contain the number of frag and death for each bot, call get public ScoreDM?.RobotScore? getScore(String robotName) to get the score for a particular bot, see rules for more info about score.
- onRobotDeath?(robocode.RobotDeathEvent?) : Is called by the game when a bot is dead and will reappear. The event is in fact a robocode.RobotDeathEventDM? (wich is a subclass of RobotDeathEvent?) wich contain one more method : public String getKiller() and will return the name of the killer.
- onDeath(robocode.DeathEvent?) : Is called by the game when your bot is dead and will reappear. The event is in fact a robocode.DeathEventDM? (wich is a subclass of DeathEvent?) wich contain one more method : public String getKiller() and will return the name of the killer. So if you are thinking about vengeance...
If you want to correct this text (especially my english), you will be welcomed. -- Synnalagma
Other consideration you want to add
Interesting... Are you sure there's not a way around renaming all these methods? With CoopRobot, nothing needs to be renamed, and all the same stuff is accomplished. I can email you the source code to CoopRobot if you'd like to see how it's done; the only reason it's not open source is so people don't modify it and introduce incompatibility issues with their bots. -- Vuen
Great proposition, I tried to think about it but not found a solution since getAllEvents? (and all this methods) don't have the event already dispatched. My email is synnalagma__AT__hotmail.com -- Synnalagma