1
\$\begingroup\$

Obviously in a first person view point the player sees only what's in front of them (with the exception of radars and rearview mirrors, etc). My game has a top down perspective, but I still want to limit what the character sees based on their facing.

I've already worked out having objects obstruct vision, but there are two other factors that I worry would be disorienting and want to do right.

  1. I want the player to have reduced peripheral vision and very little view behind them. The assumption is he can turn his head and so see fairly well out to the sides, but hardly at all behind without turning the whole body. How do I make it clear you are not seeing behind you?

  2. I want the map to turn so the player is always facing up. Part of the game is to experience kind of a maze and the player should be able to lose track of North. How can I turn the map rather than the player avatar without causing confusion?

\$\endgroup\$
3
  • 2
    \$\begingroup\$ How much of the world do you want to hide? If it's only objects, enemies, characters and so on, one solution might be to do it like Mark Of The Ninja does (at least on harder difficulty). In the direction you're not currently looking, you only see black and white and blurred environment, and none of the enemies, while in the direction you're looking everything has normal colors and is visible. Peripheral vision might then be a state inbetween, where vision is somewhat blurred and colors a bit desaturated. \$\endgroup\$
    – Christian
    Apr 9, 2013 at 15:45
  • 1
    \$\begingroup\$ Actually trying to draw problems like this out on paper, or doing a quick 3D model with a camera view in an editor... great way to figure out what's possible and how it might work. \$\endgroup\$ Apr 9, 2013 at 15:50
  • \$\begingroup\$ I definitely want the player to have "visual memory" of parts of the world they've seen recently, so I may so the map without enemies behind them. \$\endgroup\$
    – Rorrik
    Apr 9, 2013 at 19:41

2 Answers 2

4
\$\begingroup\$

Have you considered making your game isometric or 3D 3rd-person? Then you'd get both of your requirements for free, simply by virtue of the fact that you can't see behind the camera.

If you're absolutely set on top-down, you could try graying-out the areas that can't be seen, like Monaco does.

monaco

As for rotating the map rather than the player - there's no technical difficulty to doing this, but it might become disorienting. Try adding a minimap, and see if it still "feels right."

\$\endgroup\$
1
  • \$\begingroup\$ Because of the maze aspect, "disorienting" may be okay, but I'm also concerned that it might be unclear that the map turned. This game is extremely low graphics. \$\endgroup\$
    – Rorrik
    Apr 9, 2013 at 19:34
2
\$\begingroup\$

There are a couple ways of doing this:

You can create an invisible triangle that represents the view arc and translate it to the proper position and draw anything that collides with.

You can do the same thing but instead get the angle (radians/degrees) the player is facing and draw anything within the arc at a distance (probably more process intensive than triangle collision).

The other option is to only draw the hallway the player is in. Not sure how your data is set up but a recursive function that finds connected visible tiles and flags them to be drawn would probably get the job done.

\$\endgroup\$
2
  • \$\begingroup\$ The angles not blocked by objects are currently part of the obstructed vision portion. What about 4 triangles, an obtuse triangle for forward, 2 for peripherals, and 1 for behind? \$\endgroup\$
    – Rorrik
    Apr 9, 2013 at 19:43
  • \$\begingroup\$ yeah, you can detect which triangle they collide with and draw them differently. \$\endgroup\$ Apr 9, 2013 at 20:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .