I've made an image showing what the conceptual problem is.
Let's assume fog of war is on. Thus, in the left example, the red
puffer is out of sight. In the right example, everyone is visible.
Let's say that the blue Snipey is shooting the red Snipey in both
examples. The bullet path(s) are marked by yellow squares. The red
line is the conceptual bullet path (drawn in shaky hand). You can see
it passes through the puffer's square.
The blue line indicates visibility, and you can see the puffer is
clearly invisible in the left case, and blocked by the Max in the
second case.
Now, red snipey shoots blue snipey. Since the puffer is invisible,
the "blindfire" rules kick in. This means you can't hit squares you
can't see, even if the bullet theoretically passes through them. This
means the puffer's square is simply removed from consideration---it
didn't pass through it, or we can assume the Puffer was cowering in
the corner and hiding. Thus, you'd be able to tag the red Snipey
despite the puffer being along the sightlines. Red player gets mad
and sends me a bug report. :-)
In the right case, there is no blindness. In that case, the puffer
will take the hit instead. If the blue Snipey were taking an opp-fire
shot, it would NOT choose the puffer as its target (since it's blocked
by the Max), but it WILL take the shot on the Snipey and hit the
puffer instead. It looks a little odd, but I bet no one notices since
it looks like a marginally legal shot with the lights on.
So, basically, same setup, different visibilities, different behavior.
Obviously, people aren't very pleased with it, but...what do you do
instead? Here are two principles:
1. You can't shoot squares you can't see. It's been abused badly, and
I don't like what it does to the game. The game originally didn't
have blindfire rules and this blindfire thing got to be
abused---people were using it constantly to smack people around
corners and it detracted seriously from the fun of the game.
2. It should be clear what happened. Otherwise I get bug reports.
Solutions:
1. The Puffer Is Always Missed. In this case, we push in the
collision detection hull a little and let corners off the hook. Most
of the units are sort of round, right? However, this means in
well-lit areas you can see people taking some pretty crazy shots
between the ranks. I don't think I like this.
2. Recall The Shot For Intermediate Target: When you take the shot,
we trace the path. If you hit an intermediate target, act as if this
were your ACTUAL target and recalculate the path. In this case, on
the left, if you targeted the red Snipey you'd shoot the wall and on
the right you'd shoot your own Max (as you'd be following the blue
line). One could imagine having a psychic opp-fire calculation that
looks at both of those cases and says, no, that will be bad, and
doesn' t take the shot.
3. The Invisible Puffer Ducks: I make the some sort of signal to the
target player for when its puffer "ducks" by dint of being invisbile.
So, the in the left case, the puffer gets an icon over it that says
"DUCK!" when the bullet goes by, or I (ye gods more art) draw a
ducking position to indicate the shot missed. So, the invisible
player will say, ah, I see why I got tagged, and the shooting player
remains unaware of the puffer. In the right case, I'm not sure what
happens.
I'm open to any other suggestions.
The drawing also indicates a black sheep shooting at the puffer. I
can't remember why that was important. I'm sort of sleepy.
Thanks,
Wolff/Dan
----
Note: The doors at the bottom of the map were required by Kate, my
3-year-old daughter. As I was working on the drawing, she kept asking
me how the guys were going to get out, and I told her that's the
problem, they can't get out. That's why they fight.
She said, "You need to make a door." So I put doors in, and then she
said, "But how are they going to get past the sheep?" I said I wasn't
sure---maybe they'd lift the sheep over their heads and walk under it
or something.
She smiled. "They'll play tollbooth!" which is one of Kate's favorite
games. I imagine the sheep will be demanding pretend money of the
troops as they walk by.
How about changing the line of sight calculations? Make it so that any
square you can reach by drawing a line from the center of the shooter
square counts as visible, even squares that you can only graze. Then make
the squares that you can target be any squares that you can see at all.
You could have some sort of "there's someone in this square but I don't
know who" state for squares you can't see more than half of, maybe.
Or make it that there are two levels of squares, "fully visible" and
"parly visible", and if you shoot someone in the "partly visible" square,
then you do half damage.
--
Ian Hickson U+1047E )\._.,--....,'``. fL
http://ln.hixie.ch/ U+263A /, _.. \ _\ ;`._ ,.
Things that are impossible just take longer. `._.-(,_..'--(,_..'`-.;.'
> How about changing the line of sight calculations? Make it so that any
> square you can reach by drawing a line from the center of the shooter
> square counts as visible, even squares that you can only graze. Then make
> the squares that you can target be any squares that you can see at all.
>
> You could have some sort of "there's someone in this square but I don't
> know who" state for squares you can't see more than half of, maybe.
>
> Or make it that there are two levels of squares, "fully visible" and
> "parly visible", and if you shoot someone in the "partly visible" square,
> then you do half damage.
The problem at the moment, as I see it, is that the requirements for
targetting someone are not the same as for hitting them. To target someone
you need a free line to the center of the tile, but during a shot you can
pass any part of the tile to make a hit (as long as you see it, otherwise
blindfire kicks in).
The solution, as I see it, is to remove this distinction. You should not
have to aim at something other than your target to hit (except when using
splash, of course). So here's my take on it.
1a. Guys are not square, so they don't occupy the corners of tiles.
1b. Walls, doors, and other square things are square.
2a. A direct shot targets the "center" of the target tile. That's where
the guy is.
2b. Sight targets the same "center" of the tile. If you can't see the
"center", you can only see the parts of the tile where the guy isn't
standing, so you don't see him.
3. When a shot is made, it can only hit on the tiles where it passes
through the "center". When it passes through outside the center, it only
grazes the guy. It cannot pass through any part of a square object.
Thus, a shot can only hit tiles where it passes through the center. Any
tile where you can hit the center can be targetted, and also seen. Thus
you can only hit targets you can both see and target.
Exactly what part of the tile makes up the "center" is up for definition.
The best would probably be to set up a few testcases like the OP image and
decide whether those should be inside or outside. Intuitively, I would
suggest a diamond with vertices on the midpoints of each tile edge, as it
shouldn't make the calculations too complex. An even easier fix would be
to say the center is the entire tile, not sure about the resulting
behavior though.
--
Magnus Kristiansen
"Don't worry; the Universe IS out to get you."