Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Hvilela

Pages: [1]
1
Programming / Pathfinder + Fog of War
« on: September 12, 2012, 08:03:59 PM »
I would like to understand how you guys deal with the portion of the map data that the user do not know yet or is outside his view (fog of war) to calculate paths.
I'm thinking to to the most simple approach, the unknown tiles are considered blocked so they can't even be selected as goal.

Are you guys using a more clever idea?

2
Thanks man!

3
The fist link do not explain how to implement it, the diagonal walls result are not what I expect and it do not show the results for "away the pillar".

The second has no usefull information.

The third would be great if the link to the source wans't broken. :)

4
Thank you for the reply. But I need to be sure:
Diamond == Ray Casting ?

5
Programming / Result of SHADOW and DIAMOND
« on: September 04, 2012, 03:58:05 PM »
I created an image to illustrate the result of SHADOW and DIAMOND.

6
Hi Guys,

Even though I'm a gamer and a game developer I have to admit I never developed (or even played) a rogue like game. I'm here cause I'm trying to implement the x-com gameplay and for this I need to implement fog of war / field of view.

My researches lead me to this article (http://www.robotacid.com/flash/red_rogue/shadow_casting/fov.pdf), that lead me to Roguebasin, that finally lead me here.

My first problem is that the link for the algorithm called DIAMOND (http://www.geocities.com/temerra/los_rays.html) is broken and I just can't find it, so I have no idea about how to implement it. It has another name? Were can I find an article about it?
I guess it's Ray Casting (http://roguebasin.roguelikedevelopment.org/index.php/Ray_casting) but I'm not sure.

My second problem is that each algorithm has his flaws, and (for my case, at least) that flaws are unacceptable. After a fast look I realized that a logic AND between the SHADOW and DIAMOND (the tile is visible if it's considered unblocked by both algorithms) would result in a better result.
The easiest way to imagine the result is to "sum" both shadows.

Let's take a look in each case:
Adjacent to the pillar behavior: Just like SHADOW, a nice V shaped shadow.
Away form the pillar behavior: The sum of the algorithms create a nice V shaped shadow. Better than any of the algorithms alone.
Corner peeking: Not allowed, just like SHADOW.
Inverted corner peeking: Not allowed, just like DIAMOND, making the corner peeking symmetric.
Diagonal Wall: Blocks view, like DIAMOND. What is the expected result for me, cause I allow diagonal movement but only when the 3 tiles involved are unblocked.

Symmetry: As long it's not implemented yet, I did not calculate the symmetry, but at least in the corner peeking special case it's symmetric.

Performance: My idea is to call SHADOW, and cast the rays (DIAMOND) only for the tiles considered visible. On the worst case it would roughly be the sum of the cost of both algorithms, what is in most of cases it's still faster than DIGITAL.

I would like to hear opinions about that.

Pages: [1]