Understanding Grenades

From UFOpaedia
Revision as of 07:16, 4 April 2008 by NKF (talk | contribs) (Initial idea scratches)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This article aims to explain how the X-Com UFO/TFTD grenade functions. This article refers mainly to the standard grenades, and not the proximity grenade unless otherwise noted.


How the Grenade Timer Works

The grenade timer can be quite confusing, particularly to new players. What do all the numbers mean? Turn 0? Why did the grenade blow up in 2 turns when you set it to 3?

The confusion stems from the fact that each grenade timer delay settings do not correspond to the number of turns that you see during the alien movement phase. Each time delay in fact represents half a turn. That is not quite right, but it's the easiest way to explain the timer settings.

So how does that work? A grenade will only explode at the end of a move by either the player or the AI. Observe the following delay settings:

0 = Explodes as soon as you end the turn, before the aliens move. 1 = Explodes after the aliens end their turn. 2 = Explodes at the end of your next turn 3 = Explodes at the end of the aliens' next turn.

Turns and the Grenade Timer In-Depth

There are two turn counters that the game keeps track of throughout the battle. One counter that counts how many times each side has moved, and another to store a number that is equal to half of this value. For this article, to simplify the explanation, we'll call these the movement phase counter and the other the round counter. To avoid ambiguity, round refers to a group or set, not circle.

The move counter is incremented to count every move made by either the player or the AI. So if you end your move, this counter gets incremented by 1. The aliens then make their move and end their turn. The counter gets incremented again to 2, and your move starts.

Move order is always Player then Aliens. Because the counter starts at 0, we can assume that a counter with an even number will always be the player's movement phase, while an odd number means it's the aliens move phase.

The Round Counter is always equal to half the value of the move counter. For example, if the move counter has totaled up to 6 moves (3 turns have passed), the Round counter will equal 3. As you can see, this counter is the same as the number of turns that have elapsed. A Round is therefore two Movement phases, the player and then the AI.

We never see the moment phase counter, but we can assume that it is always double the value of the turn number.

You probably already see where this is leading: The grenade timer works off the movement phase counter.

Note, there isn't a separate movement phase for civilians - they are controlled by the AI, though they are flagged as a 3rd party. If there was a separate phase, the delay settings would've been in 1/3rds, which would've been even more confusing.


Detonation conditions

A grenade will only explode when these two trigger conditions are met:

  1. The grenade counter has run out (detailed explanation in next section)
  2. The grenade is on the ground at the end of the current side's turn

Except in very buggy circumstances, a grenade will never explode during a movement phase. Only between them before either side gets control of their units.

Because of the strict detonation conditions , you can make use it by safely hanging onto a grenade even though it's well past its timer setting. This allows you to arm grenades several turns in advance to avoid the 50% TU arming cost when the grenade is needed the most. As long as the grenades are in your inventory, they will be safe to carry.


How The Timer is Implemented

Ever wondered why the delay settings for the timer begin at 0?

Rather than being assigned a number of turn and then counting down after each movement phase, a grenade is instead assign a scheduled detonation time. This is a number that equals the current movement phase count plus the delay setting of your choosing.

If the current movement phase count is greater than this number, the first condition for the grenade to explode will be met and it's cleared to explode.

For example, it's the 120th movement phase (that's 60 turns into the game). You get a soldier to prime a grenade with a delay of 1. The grenade will be given a detonation time of 120 + 1 = 121.

When you end your turn, the turn counter increments to 121. This is equal to the grenade scheduled time. That's fine for now. When the alien's end their turn, the movement phase counter jumps up to 122. This is greater than 121, and thus the grenade's first detonation condition is met. If the grenade was on the ground, it will explode.



Standard Grenade Experience Attribution

In order for the game to properly reward experience to soldiers who've harmed enemies with grenades, it assigns an ownership value to every grenade. Unfortunately this only occurs if the grenade is thrown, not when its dropped.

Until thrown, a grenade always refers to the very first unit on the map. (Unit 0 - in unitpos.dat terms). This is either the soldier that starts on the equipment pile, or a HWP if one is on the ship.

Proximity Grenade Experience Attribution

Unlike the other grenade types the proximity grenade awards experience to the person that set it off. The mine layer will therefore not earn any experience by using the mine.


Possible TODOs:

  • Section on strategies to briefly mention pre-arming, Dead Man's Trigger, grenade relay, etc. Passing the experience trick. Then linking to the right section.
  • Strength, weight, the throwing arc and an invisible ceiling.
  • etc.