Proper bot termination
Bots are launched using MultipleUT2004BotRunner, and all of them share a common super class that contains this method.
@Override
public void logic() throws PogamutException {
if (limitedEvaluation) {
if (startTime < 0) {
startTime = this.game.getTime();
}
double elapsed = this.game.getTime();
if ((elapsed - startTime) > evalTime) { // Terminate evaluation
this.bot.kill();
}
}
}
The logic method of all the subclasses call super.logic(). The startTime is always initialized to negative so that it can be properly set once the bot realizes it is in the world. Afterwards, the bot should remove it self after evalTime has elapsed.
This might be a problem with UT not removing bots that suddenly get disconnected. That's why I'm asking if there's a better way to disconnect the bots than using this.bot.kill().