Undefined Behaviour

Hi everyone,

There are a few conditions which I’m not 100% sure about how to handle and I was hoping for some clarification (or if it’s already been answered somewhere else, just a reference would be fine).

  • According to the game rules, shooting any worm unconscious gives 40 points, shooting an enemy worm gives 20 points, and shooting one of your own worms will reduce your points by 20. Does this mean that killing an opponent’s worm awards 40+20 points and killing your own worm awards 40-20 points?

  • Who wins in the unlikely event of a tie (after scoring has been taken into account) ?

  • What is supposed to happen when both active worms shoot the same target worm and their combined weapon damage is greater than the target’s health? Who receives the points for the kill? What if neither worm’s weapon damage alone could kill the target?

Thank you :grin:

1 Like

Great questions!

I am extremely intrigued to know the reasoning behind this one?

It’s quite an unlikely scenario IMO, but if something like that were to happen, I’d want to make sure my bot can evaluate the situation accurately. The question is somewhat tied to the first question, because if killing your own worm does in fact award you with 20 points, there could be something to gain from doing so.

For example, if I have two worms W1 and W2, and my opponent has a worm O1:

Suppose W1 and O1 are active and W2 has 9 health and weapons deal 8 damage. Also, suppose W1 cannot shoot O1, but can shoot W2. Then it might make sense for W1 to shoot W2 (again, this depends on the first question).

Other than edge cases like that, I’d still like to know how to handle situations like that, especially for close-quaters endgame situations.

Though edge case.

I think the easiest solution would be to have -40 points for killing your own worm. Then it doesn’t matter, I think.

there is however another case.

say active worm of player 1 shoots an inactive player 2 worm and kills it and active player 2 worm from behind his now killed worm shoots over it. does he hit his dead worm or the first players worm?

1 Like

That would certainly be simpler and would make the most sense, but would require the rules to be tweaked.

That’s an interesting case. I assume you’d hit your own dead worm, since the actions are supposed to take place simultaneously, but it’s not guaranteed that the engine handles it like that. :thinking:

At the end of the day the answer is in actual engine code, which you can take a look at here. Its written in Kotlin. Most of the logic is in 2019-Worms\game-engine\src\commonMain\kotlin\za\co\entelect\challenge\game\engine\command\implementation

Hi @mo_x90_oly

That’s a good catch. So the team agrees that since friendly fire provides negative score, the same should happen for the kill score (killing your own worm provides you with -40 points instead)

With this implemented, the 3rd bullet point is solved as well. Both players will then get score, except that one player gets a negative score

We don’t plan on changing this before the Early Bird Showdown(2nd of June) tournament, since everyone has already spent a lot of time training their bots on this current rule set.

You can follow progress here: https://github.com/EntelectChallenge/2019-Worms/issues/42


Hi @linjoehan

If I am understanding you correctly, you are asking about a setup like this:
▓▓11 22 21▓▓
where worms 11 and 21 are both shooting towards the middle.

In this scenario, both shots will hit worm 22, even if player one could kill it - dead worms are only removed from the map at the end of the round. If you are curious, the round order logic that makes this work can be found in the WormsRoundProcessor class.


Hi @mo_x90_oly

In addition to the response @pierre.roux gave, I just want to clarify the current scoring behaviour: Only one of the scoring rules will apply in the order they are listed in the readme. This means killing an enemy worm will give you only 40 points, not 60. And in the weird edge case you caught, killing your own worm will also award 40 points instead of -20.


Thanks for the clarification!

Also, I forgot to follow up on this:

If you reach round 400 and the scores are tied, we will look at the person with the least execution time total for the match.


@Edwin, for that reason it will be very useful if the execution times are recorded in the match logs, maybe inside the CVS files?

I agree. We will look into adding that.