alanhdu / hunt

Play Hunt (the terminal game) online at http://quiet-forest-3036.herokuapp.com/
1 stars 0 forks source link

When the arena is very empty, vision behaves weirdly #34

Open samm81 opened 10 years ago

samm81 commented 10 years ago

In theory, you should be able to see anything blocked by walls, but when there are very little walls you can still only see in about 3 columns/rows.

alanhdu commented 9 years ago

Hm...I actually coded it this way. What should the alternative be? That if you're facing one direction, you have 180 degree field of vision?

I'm not sure you should be able to see infinitely off to your left and right. That's how the original hunt does it, but I think it detracts from maze-like quality.

Hopefully, with wall regen, this won't be that big of a deal.

samm81 commented 9 years ago

Well, I think it doesn't make sense if you can't. If there are not walls in the way, you should be able to see that person in real life right?

But like you said, with wall regen it shouldn't matter as much. I can only see it becoming an issue in games with lots of people.

On Fri, Dec 5, 2014 at 7:43 PM, Alan Du notifications@github.com wrote:

Hm...I actually coded it this way. What should the alternative be? That if you're facing one direction, you have 180 degree field of vision?

I'm not sure you should be able to see infinitely off to your left and right. That's how the original hunt does it, but I think it detracts from maze-like quality.

Hopefully, with wall regen, this won't be that big of a deal.

— Reply to this email directly or view it on GitHub https://github.com/alanhdu/hunt/issues/34#issuecomment-65880294.

alanhdu commented 9 years ago

Hm...fair enough. I guess the question then is how to technically do it.

Write now, I just use the four cardinal directions (except them one to your back) and extend them until you see a wall to get the current view. So, for example

        *
        T
        T
   *TTTT<
        T
        T
        *

How would we make walls block line-of-sight if we do 180 degree vision?

samm81 commented 9 years ago

Yeah, it's tricky. I never said it would be easy hahahaha. Could do some sort of primitive ray tracing, where a square visible only if there's a direct path to the you from it. Could just make every square visible that doesn't have a wall between it and the direction of the player, like so:

UBUB
 - -
UU^U|B
B|UUUU

Where B is not seen or "blocked" and U is seen or "unblocked".