Archived

This topic is now archived and is closed to further replies.

Line of Sight in 2D game

This topic is 5381 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I''m working on a 2D, overhead, tile based, shooter. Basically,the player just goes around shooting stuff. I was thinking about implementing a Line of Sight system where the player will only be able to see what someone would normally be able to see from that position (you wouldn''t be able to see into the next room, for example). I have all the technical and programming issues down, but i''m wondering if it''s a good idea. It will be more realistic and challenging, but it also might be frustrating (especially considering that this is a shoot-everything-you-see game.. not a tactical shooter or anything). Anyone know of any 2d overhead games that use it to good effect? Any opinions?

Share this post


Link to post
Share on other sites
I think this could get very frustrating, ie being shot at from behind. How about you just make the exact position of enemies not in los unknown, maybe blur what cannot be fully seen?

Stuart

Share this post


Link to post
Share on other sites
Hmm.. possibly show the level but shade the parts that can''t be seen? the more i think of it, the worse the idea sounds. It''ll be very difficult to point the player in the right direction by showing the key in the next room he needs to get to.. and yeah.. the enemies will pop out of nowhere.. hmm..

Share this post


Link to post
Share on other sites
I use the effect but with 360 degrees field of vison in my game Fiend. You can find it at fiend.cjb.net

There is a shooter called Taipan Kakki that uses the effect aswell.

Share this post


Link to post
Share on other sites
I think it would be kind of cool. 3D shooters limit your line of sight with no problems (ive been shot in the back many times), though it may be a bit differnt in 2D it could still work.

The idea of blurring things that would be out of your peripheral vsion sounds cool too.

Share this post


Link to post
Share on other sites
What about having different modes that the player can enter. A sort of assault mode, where you are very focused on what is in front of you, and an observation mode when you constantly look around, perhaps making shooting more and less acurate respectively? I find that in 3d shooters, the worst part of the design is actually how you observe your surrounds, ie you can''t glance over your shoulder without actually turning around. By having an observation mode in a 2d game, this could perhaps fix this problem???

Stuart

Share this post


Link to post
Share on other sites
If you decide to do this, you''ll actually be making it less realistic in my opinion. True in real life we can not see into the next room and in a 360 degree view, but we do have other things that help us make up this picture. For starters, we have accurate "3d" sound. So although we cannot see behind us, we can certainly hear if someone is coming from behind. This will not be possible to implement in your game. In fact we have 4 other senses in real life to help us besides vision. So because in games we are really only given 1 proper sense, it needs to be augmented to make up for the fact that the other 4 are largely or entirely absent.

Share this post


Link to post
Share on other sites
One possible refinement would be to restrict actual vision to LOS, but have some sort of sprite for a non-visible sound source - so the player can see there''s something there, and pretty much where, but not identify it directly. (Nethack uses something similar)

Share this post


Link to post
Share on other sites
If you make it so that you can look independantly of where you move, then you can do things like walking through a corridor moving the mouse around to make sure no one is sneaking up from behind.

Another cool idea I had at the mention of 3d sound. If enemies make footstep sounds, you could maybe show an icon in the direction where the sound is coming from. Maybe a footstep icon or something. It wouldn''t show you exactly where they are or exactly what kind of enemy, but its enough to have a general idea of where they are.

Or you could simplify it. Instead of full line of sight, you could simply make only the room your in be visible. Lots of 2d games have done this before and worked fine, one example that comes to my mind is Out of this World. You only ever see one screen at a time - there is no scrolling. And I didn''t have trouble with it even though enemies did attack from offscreen.

So it could be cool either way.

Share this post


Link to post
Share on other sites
quote:
Original post by PouyaCat
Play CyberDogs. Old, but GREAT! ^_^

My thoughts exactly. CyberDogs blacks out areas not within your logical line of sight, but gives you a hand up by generally not allowing enemies to attack from offscreen unless you know they''re there (say you entered a room, shot at a guy or got shot at and then backed out, the guy would keep shooting).

Share this post


Link to post
Share on other sites
In a 3D game, especially a FPS*, there''s a natural, intuitive way to maintain situational awareness. running around and looking around takes on a nice smooth feel and you can keep tabs on what''s around. In a 2D game, especially an isometric game, that natural glancing is reduced. I can see this leading to a feeling of disorientation. Making the enemies really dumb is not a valid solution.

The discussion about sound is compelling. Reading these posts, I got an image of an action/infiltration game, where you peep through keyholes and listen at doors. Very neat idea. I''d like to address the sound issue, and some mild RPG elements I''ve been thinking about as well. But first, the vision issue, and line-of-sight.

I think giving the player a "cone" of vision would feel like your little guy was in the dark with a flashlight. Human field of view is well over 180º, but it gets sketchy toward the edges, and in stressful situations "tunnel-vision" is common. At the same time, your basic perception of spatial relationships and working memory will keep you aware of the static objects in the room, like desks and walls. Dynamic things like people will of course be a different story.

Here''s what I recommend. A sort of "fog of war" could be implemented. Unexplored rooms would be totally unknown, and black to the gamer. The current room would be visible, and anything within 90º of forward would be perfectly clear. Anything behind the plane of your eyes would be a little foggy, but motion can be seen in close to 270º, so I''d be inclined to throw it "rustling" animations, to simulate the experience of glancing something out of the corner of your eye. "Tunnel vision" can be included as a narrowing of the "highly vissible" field if you deem it appropriate, but I''m not going to get into serious detail.

The room that you''ve already seen, as well as other rooms that have been explored, could be clouded by the fog, and any changes will only be detected when you next see the area. Like in Warcraft when you trash a base, and then come back later and the fogged image of shattered castles is seen to be a new, bustling fortification.

Looking through a keyhole or window would narrow the field appropriately, and objects such as pillars or walls would cast "sight shadows", allowing the player or enemies to hide from view. You would feel rather like the enemies in Commandoes, but not quite as stupid.

===Now I''ll discuss sound. It''s a little off-topic, so feel free to skip the rest of the post.

i think it would be really cool if sounds could be detected by the character and reported to the player through a series of icons. If you hear music wafting in from a duct, then there would be a little graphical representation of music (maybe some dancing notes and clef signs or something) next to the vent. Footsteps in the adjacent hallway could be shown as little footprints clopping through the unknown territory. Voices could be shown as text and the text could be put over the approximate location of the sound. Opening or closing doors, barking dogs, running car engines and snoring guards could all have a place in the game. This would make sound an even more useful tool than it is in a 3D game, since true hearing could be simulated.

I was also thinking that it could be a skill that the character could develop. The type of shoe (combat boot, high heel, bare foot) making the footsteps could be graphically represented if the character could tell the difference. Itentifying voices at least as man or woman, possibly as an individual, could be good as well. Just a thought.

*Grammatically, should it be "a FPS" or "an FPS". I guess it depends on whether you pronounce "FPS" as "First-Person Shooter" or "Eff Pee Ess". Any grammar experts out there?

Share this post


Link to post
Share on other sites
quote:
Original post by Iron Chef Carnage
*Grammatically, should it be "a FPS" or "an FPS". I guess it depends on whether you pronounce "FPS" as "First-Person Shooter" or "Eff Pee Ess". Any grammar experts out there?


I believe that acronyms pronounced as a series of initials are always 'an', though that can produce some strange seeming situations (an TLA) In colloquial usage, I'd go with the sound, so 'an FPS' sounds better when you try saying it (though 'a first person shooter')

Back on topic, I always found it annoying when things like buildings show through the fog with full detail, and suddenly change when you get too close. I'm sure there must be a better way of distinguishing between permanent features (mountains, rivers, etc) and potentially variable phenomena (ruined buildings, city size in Civilization, etc) than simply showing them both the same way and expecting the player to remember which is which. Something as simple as replacing buildings with silhouettes rather than leaving them in full detail would be an effective reminder that they are subject to change (though you could run into problems trying to represent things like trees that way).

About the visual sound thing, there's a console game using cel-shaded animation and comic-book style visual sounds either already out or due sometime this year (it's a while since I read the (p)review)

[Edit]
Checking my archives: game is "XIII" on Game Cube and was due out sometime around now-ish when it was previewed around Christmas time
[/Edit]

[edited by - rmsgrey on March 26, 2003 1:59:57 AM]

Share this post


Link to post
Share on other sites
I have thought about this before, since I am interested in realistic games, or at least games with innovative ideas.

Although I''ve never applied it, I have a nice idea for simulated 3D sound.

We''ve all seen the equalizer on sound programs, or the visualizatins on Sonique or Winamp that "move with the music". A simple example would be a ball that grows with the volume of low frequency sounds, and becomes wavy on the edges with high frequency sound. When we watch a visualization like this, we don''t hear the music, but we can catch on to the beat of the music, and when the music gets louder, we can see more deformations in the ball. Why is this important?

Basically because most people can make an association between the visual and the audio. If I were to play a song, and have two of these "audio balls", one that cooresponded to the song playing, and one with a different song, usually I can pick out the right visualization.

So a solution to this 3D sound would be this. Create a system of making sounds visual, to which the character can associate. If I were to do it, perhaps I would use the ball. I''d make it transarent, so it wouldn''t cover anything in the game. But when there was a sound, it would appear, and move with the sound. To make it more interesting, you could make different colors mean different sounds. Voices could be blue, gunshots could be red, doors could be yellow, cars green, and so on.

Players would learn to read the sounds as they hear them. So when they hear a sound of a car drive by, and they see a green dot appear behind them approximately where the car is, they know about where the car is, as we would with our ability to determine location.

If the green dot was getting bigger, and moving closer to the player, the player would know maybe the car was driving towards him. If red dots appeard sharply by the green dot, the player would know the car was firing, probably at him. If he turned arond, he''d realize this, but he woudln''t have to, because he could "read" the sound, like we could in real life.

The beauty of this is that you create a language for the character, who learns to read it quickly, plus, it can be neat to see in action when there is a lot of action in the game.

--Vic--

Share this post


Link to post
Share on other sites