Chaosforge Forum
DoomRL => Bug Reports => Topic started by: rchandra on March 01, 2011, 22:02
-
I thought it would be a good idea to collect the known LOS issues in one place, in case Kornel feels like tweaking the system. Not sure if that place is Bug Report or Feature Request :)
1) Firing around a corner with a shotgun behaves asymmetrically
2) sometimes the auto-aim ([f]) will select a path through a wall to shoot a visible target. you can generally work around this by aiming manually until you have a clear path.
3) not sure if this one is intentional:
You see : out of vision
You hear the scream of a freed soul!
#################
#...............#
#0..............#
#.>.....%.......#
#.........0.^...#
#...............#
. #...............#
% #...............#
############/##### #...............#
...........}....... #...............#
.......}..@..|...... #...............#
......0.|.%......... #.....%.........#
########/############# #....0..........#
0....................... #...............#
##############/###################...............#
.....%....................../..............^#
#/###########################........0......#
#...............#
#...............#
#################
Rahul Armor : modified red armor [6/6] (84%) (P)
Health: 60% Exp: 3/53% Weapon: chaingun (1d6)x4 [24/40]
cautious Phobos Base Lev4
the former human killed to my northeast where the % is was able to shoot me, but I couldn't see him (you can see the corpse is still in the "dark")
examples of point #1 in the above image: the door to my southeast (around 4-5 spaces). standing immediately NE or NW of that and next to it, I cannot hit the wall 2 spaces to the south of the door by aiming at it with the combat shotgun, even though it is visible to me. I can stand SW/SE of the door and hit the wall 2 spaces to the north.
Feel free to add others, guys - I'm pretty sure there was at least one more oddity.
-
Number 3 is basically the same thing as you firing from cover at an enemy that you can see, but which can't see you. It's just employed against you in this case.
Number 2 is, I think, due to the limitations of this being an ASCII game. Firing occurs in a straight line, but a straight line is represented on computers by a repeating pattern of pixels that look like a line from a distance (see attached image). Since a map tile is the smallest unit DoomRL can work with, it tries to use them as "pixels" to represent a straight line, resulting in firing paths that should be valid, but go through a wall.
(http://img580.imageshack.us/img580/8730/linei.png) (http://img580.imageshack.us/i/linei.png/)
-
Would be nice to see the mechanics of the current system laid out as far as what you can hit from what positions. The assymetry is what always gets me, standing in a doorway with a shotgun and then remembering I cant hit anything in the hallway in whatever direction. IIRC this can also depend on which shotgun you use and whether you aim far down the hall or diagonally so the edge of the blast should go down the hallway.
-
Number 2 is, I think, due to the limitations of this being an ASCII game. Firing occurs in a straight line, but a straight line is represented on computers by a repeating pattern of pixels that look like a line from a distance (see attached image). Since a map tile is the smallest unit DoomRL can work with, it tries to use them as "pixels" to represent a straight line, resulting in firing paths that should be valid, but go through a wall.
(http://img580.imageshack.us/img580/8730/linei.png) (http://img580.imageshack.us/i/linei.png/)
The granularity of the lines shouldn't be an issue. I don't know exactly how it's implemented in the source code, but the targeting probably uses some variation of this:
http://en.wikipedia.org/wiki/Bresenham's_line_algorithm
If this is the case, auto aim can just discard the line being generated if the current pixel is being drawn on a wall while running the algorithm. Afterwards, you could just default to manual targeting if there are no more possible targets. If there are other valid paths between the same two points (I'm not sure if this is possible in-game, actually), then it would be neat if it automatically tried to use those if it finds a wall with the first choice.
I personally find it annoying that auto aim locks on to a target with an invalid path, but I can see it being somewhat useful for manually adjusting your shot after starting auto aim (by moving the cursor around the target to get a clear shot).
-
If you are inclined to learn more about how DoomRL handles LOS, most of the LOS related code is open source as part of valkyrie (http://sourceforge.net/projects/fpcvalkyrie/). Look at vvision.pas. (Or at least, as far as I could tell, DoomRL still uses this code.)
In short, the LOS code is a modification of Isaac Kuo's fast beam-casting algorithm (http://roguebasin.roguelikedevelopment.org/index.php?title=Isaac_s_fast_beamcasting_LOS).