Advanced Fog Of War?

Get help using Construct 2

Post » Tue Apr 19, 2016 8:19 am

This is repost from my post from about week ago and nobody answered.

I have currently project to make a moba with C2. I started with fog of war, and I don't know how to make satisfying vision with my current knowledge.

Basically I want "realistic fog of war" where units cannot see behind objects, and vision stacks from multiple sources. Vision shows objects with "team" variable same as oberserver's and hides others.

Image

I can achieve simple fog of war with black spheres in layer with "destination in" blending, but you can still see behind walls. I tried to use shadowligth, but multiple lights make glitchy shadows.

I think tile-based map is best for this, but it would be strange as heroes etc. would still move around with 360 degrees 8direction, plus map would be one huge constantly updating lagfest.
~~~~Jabutosama
B
14
S
3
Posts: 68
Reputation: 1,439

Post » Tue Apr 19, 2016 9:17 am

Actually, fog of war is strictly a visual artifact/effect for the player.
Use the Line Of Sight behavior for your units, and be sure to add the walls as obstacles.
Out of their range, they won't "see"/perceive.

And the fog of war has to cover/be drawn out of their range of perception.
Spheres seems relatively OK for fog of war "border" details, otherwise it is overall a big dark rectangle.
Consider using those spheres with appropriate blending modes like "destination out" to use them as display masks.
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
292
S
115
G
96
Posts: 7,293
Reputation: 70,769

Post » Thu Apr 21, 2016 4:23 pm

Yea, we use the destination out blending as in the "Lighting Demo" in C2 > New for our visual fog of war.

All of the perception is handled server-side in our case.
https://www.ravenheart.ca/home
I don't check the forums much anymore, but I will receive an email for PMs.

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
22
S
6
G
1
Posts: 1,418
Reputation: 4,830


Return to How do I....?

Who is online

Users browsing this forum: AllanR, brunopalermo, farsen, ST314 and 27 guests