This is the mail archive of the xconq7@sources.redhat.com mailing list for the Xconq project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Major bug and what to do about it (long)


>But, this is where we differ, I think. The shell has to land somewhere,
>and it is possible that _no_ unit sits where it lands.

Of course. And it is also possible that the target unit is entrenched,
protected by other units or the terrain, or takes evasive action. One could
also argue, as you do, that larger units are easier to hit etc.

I do understand the "Unit target area" scheme that you are proposing, or at
least I think so. You would calculate how much of the total area is
covered, and then use that to distribute hit-chances between the units and
the empty area. However, I think this may be both too simplistic and too
complicated. Too simplistic because many factors affect the hit chance
(some are mentioned above) and the unit size in terrain is just one of
them, not necessarily the most important one. Too complicated for reasons
that have to do with the underlying statistics. Perhaps I should elaborate
on the latter, because it is an important point to clear up.

I see random firing of a gun into a terrain area as a statistical process
in two space dimesions (we need not consider time here). The key aspect of
this process is that the position of each hit is independent of both
previous and coming hits. This means that a given unit (or subarea) has a
fixed probability of being hit with each shot. This probability may depend
on the unit's size, its protection, the terrain and many other factors. The
probability may be anything from 0% to 100%.

Now, as I see it, all these factors (including the unit's size) are already
weighed into the hit-chance table and its various modifier tables such as
uu_protection etc. I certainly assign a larger hit chance against units
that are big targets when I design a game. So if the hit-chance for
artillery against infantry is 20% it means that an infantry unit which sits
in a standard terrain cell (no terrain modifiers) has a 20% chance of being
hit each time a piece of artillery fires into that cell.

This probability, and this is the key point in my argument, is not affected
by the presence of other units in the cell (or - in the case of failed
fire-at actions - their absence). Nor is it affected by the sizes of these
other units or the total area covered by all units. The only size that
matters is the size of our own unit, which is already weighed into the
hit-chance table. We can therefore forget about these other units, which
are statistically independent of our unit, in the hit-chance calculation.
The only exception is if one of them has a protection property that affects
our unit.

So, to answer your question, if we have 5 units in the cell, and the
artillery has a 1% hit-chance against each one of them, the probability
that no unit at all will be hit is (1 - 0.01) ^ 5, or 95.1%. If we have 2
units in the cell and the hit-chance against each one is 98% the
probability that no unit will be hit is (1 - 0.98) ^ 2, or 0.04%. A small
but still non-zero number. I would expect the combined hit-chance to equal
100% only if the hit-chance against at least one of the units is 100%, in
which case it will always be 100%.

So how do we translate this into a combat resolution algorithm that makes
sense? I would favour a Monte Carlo approach, where the dice is rolled once
for each unit in the stack, using its own individual hit-chance. This dice
rolling should stop, however, once a unit has been hit. The reason for this
is that if we know that the shell hit one position, it cannot also hit a
completely different postion. Sort of like the collapse of the wave
function in quantum mechanics, if you see what I mean.

Furthermore, it is important that the dice rolling is done in a random
order, since we would otherwise favour hits of units at the top of the
stack, particularly when each unit has a high hit-chance.

I hope this clarified my views.

Hans




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]