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.


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.
Posts: 68
Reputation: 1,459

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 !
Posts: 7,413
Reputation: 75,222

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.
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."
Posts: 1,419
Reputation: 4,867

Return to How do I....?

Who is online

Users browsing this forum: RevampedSpider and 2 guests