Nox had a very nice feature: dynamic view cones! When the player moved, they also were updated in real time. What an eye catcher!

The indie game Teleglitch also has this feature. “Awesome Simon, thank you for pointing this out. Next!”. Not so fast, little Padawan! I mention this, because they fake the view cones in a very interesting way! At first i also thought “Oh ok, they have this Nox-Effect nice.” but after a while i noticed, that they move a bit differently. And then i saw how it works.

No I didn’t! Twice. I was corrected via mail and also now via a comment from johann and i have no idea why i didn’t updated the article… but better later then never, right? *correct mode on*

The code extrudes black “walls” above some objects and the walls upwards to the camera. Simple but awesome. But they don’t let they black walls start directly at the top of the objects. There’s a small gap in between so you can still see the top areas of the objects/walls. I love it.

Here’s the quote of the mail i got:

Actually, the line of sight shadows aren’t done with perspective. They are just black polygons extruded from the walls away from the player. The math is similar to black 3d walls extruding towards the camera, but if you really look at them, they aren’t.

Since my originally thoughts are at least similar to the actual technique, i think i can let the following stay in the article:

Because i have no idea about math and coding, and it’s hard for me to imagine things which i can’t see. So i checked the difference of “real” view cones vs. extruded walls (which isn’t what they actualy did, but at least it’s similar). What i saw was, that the columns aren’t 100% correct, but definitely good enough. Have a look Mr. Bond:

I can only speak for myself but this impressed me a lot. This is a great idea to save the time which would be necessary to code “real” view cones. Oh and if you’re a coder and interested, one of the developers sent me a link to the code.

Update #1
I thought about Diablo 2 one day and they had also some of these view cones. Really interesting because they don’t have any 3D information to calculate these.

Source: Diablo 2

14 thoughts on “Teleglitch – Viewcones

  1. Anonymous

    The problem with teleglitch pseudo view cones system is that I can’t help but see them as giant black 3D geometry hovering above the play field.

    Reply
    1. Simon

      Which is like it is…but i think it’s a cool work around because implementing “real” view cones could be more complicated.
      But you’re right! It looks…weird :D

      Reply
  2. Anonymous

    I never saw teleglitch “walls” as view cones… But just as.. well, black super high walls.
    And it’s super fine by me, makes the small areas much more interesting.

    Reply
  3. adam

    You say D2 didn’t have 3D info, but it did. Remember there was a “3D mode” you could enable, where it used the GPU to do a perspective “bend” of the world, as though you were on a very small planet with visible curvature.

    From some angles, it gave you greater view distance, from others: less. I remember flipping it on and off between different levels. It looked nicer, but sometimes was lethal :)

    Reply
    1. SimonSimon Post author

      Yes you’re right and i just wait for the right time to do a small article about D2-Perspective-Mode. It was a bit…”wobbly” but still impressive :) Do you know more about it? Just wonder how the interpreted the 2D-Data…

      Reply
        1. SimonSimon Post author

          Yeah, i saw this on the website from Paul and it’s crazy. It would be really interesting to see the original tools which where used by Blizzard.

          Reply
  4. Allicorn

    In Droid Assault we use a similar technique but we only cast the shadow over objects within rooms – including enemies – and not over the walls and floor texture. This means you can still see the basic layout of the adjacent areas but you simply can’t see what’s in them until you go look.

    Reply
    1. SimonSimon Post author

      Awwww i love the style of your games! These droids are sooo cool :) Thanks for mentioning your tech – but unfortunately i wasn’t able to see it too well in your trailer because all moves soooo fast :) Do you have some dev papers or examples?

      Reply
  5. johann

    This article is incorrect. If you actually try to extrude walls upward you’ll end up with something a bit different.

    Reply
      1. johann

        teleglitch doesn’t extrude the shadows upwards, it extrudes them away from the player.
        this makes them look a bit more uneven and organic

        Reply

Leave a Reply

Your email address will not be published. Required fields are marked *


*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>