"Area Of Sight Code" Should I use this for my Game?

BlitzPlus Forums/BlitzPlus Programming/"Area Of Sight Code" Should I use this for my Game?

coffeedotbean(Posted 2003) [#1]
Most of you are probably firmilar with my Alphabreed game, it was suggested a while back when the first demo came out that I should use some sort of line of sight... so I developed an "Area of Sight" algo. Below is the code which any 1 can use or abuse. ( I might put an artical on BC if any 1 wants to know how it works), any way I need an idea of wether I should use it in My Alphabreed Game, Here are two pics to help you decide until I can get a demo out.


http://www.jabawokie.ukgamers.net/sight.bb


Sunteam Software(Posted 2003) [#2]
Could be good, difficult to say without seeing it in motion.


Dr Derek Doctors(Posted 2003) [#3]
It's a little bit blocky, but I suppose if you're culling images with it, having arbitrarily angled lines would be a bit of a 'mare. However I certainly think it'll add immeasurably to the atmosphere. Especially if you hear them coming long before you see them...


Foppy(Posted 2003) [#4]
It appears to be only using 90 degree corners. Like the
case above the player where the room to the right is dark,
and to the left it is bright, and the alien which is in the
middle is partly visible. Shouldn't the line be diagonal,
based on the location of the player? If not, what happens
if the player moves "up" a little bit, will the line stay
the same and then suddenly disappear, making the room to
the right visible as well? That would be a bit unrealistic.

It is more noticable for the small corner of the room the
player is in, on the right side, where the red object is;
this space should be entirely visible to the player, but
in the "area of sight" version, it seems to be completely
in the darkness.

Also the alien being only partly visible looks a bit
strange, like it is coming from under the floor.

So, summing up I think I would not use this system. Maybe
a better idea is to use a "line of sight" system so that
you can calculate more accurately which enemy is visible
and which is not.

Here's a "line of sight" function I wrote with a demo:

http://www.oprit.rug.nl/prins13/download/lineOfSight.zip

Although when you use line of sight the downside of course
is that the rooms will still look the same (no darnkess).
I remember having seen games (both old games and BB games)
that do use this "area of sight" technique but in such a
way that the areas are formed in a more realistic way, even
if this means that you get "blocky" edges (since the
"resolution" of drawing these areas is the size of the
tiles). In fact you could use "line of sight" on the tiles
to get this effect... This is (was?) often done in RPG
games, typically those classic dungeon exploration games.

Then again, maybe the system you have there does work out
really well when you actually play the game, it could be
that the things I pointed out about the screenshots are not
really a problem when playing. And making the rooms bright
or dark does make it clear what you can and cannot see;
using "line of sight" on *only* the enemies has the big
disadvantage of the enemies popping out from nowhere.

(This is typically a problem in 2d games I guess; in 3d the
enemy would just be invisible since it is behind a wall; in
2d the area behind the wall *is* visible but the enemy is
not; your solution is to make that area dark)


jhocking(Posted 2003) [#5]
Whether or not to do that is a game design judgement call. Some people like that and some people don't, plus whether or not it is even necessary depends on your game. Speaking for myself, I don't like that for a straight action game but for a more strategic game obscuring the player's vision is an important part of the strategic gameplay. I guess this is because finding/avoiding enemies isn't really a goal in a simple action game, the point is fighting them, whereas in a strategy game (or at least a more strategic action game) needing to figure out where things are because you don't know from the get-go is a primary goal. Now that I think about it this distinction carries over for me into 3D games; I don't enjoy FPS games that are all action if I don't know where my opponents are (eg. I enjoy "Halo" more with radar than without) but in more strategic games (eg. slower paced FPS games which tend towards stealth and sniping) I do enjoy creeping around looking for stuff.