Create a fog of war

For questions about using Classic.

Post » Sun Apr 01, 2012 7:01 pm

Hello everyone, I have a problem, but can't solve it. Hope you can. :)

I'm making a RTS, and want to do a fog of war. I searched in the forum, but didn't found the solution.

For them which doesn't know what is fog of war, it's a map all in black. When an unit walk in a black part, a part of this fog of war is revealed.
I tried with Canvas, or with layers, it works a little, but I think there is a better solution (also, I think it takes a lot of memory ! ).

This is what I've done :

With layers : http://www.mediafire.com/?pkubdu9rluld8bd
With canvas : http://www.mediafire.com/?h4r3rk09fzey95x


Hope i'm clear, thanks.
Sorry for my English, i'm french. ^^
B
7
G
1
Posts: 20
Reputation: 657

Post » Mon Apr 02, 2012 4:15 pm

I fill a layer at the top with a black TiledBackground object. set the layers opacity to 99%(or whatever you wan't just not 100%) and create a new object with an erase effect on that layer.

not sure if that helps your memory problem.

Maby play around with the Coloring effect plugin. dose basically the same thing, just more flexible and simple.
B
6
S
2
G
5
Posts: 249
Reputation: 2,323

Post » Mon Apr 02, 2012 8:58 pm

Hi Bartosh, thanks.
I tried, it's cool ! But, I have to create the "object with erase effect" everywhere is my moving character.

I want explored parts to stay revealed.

Thanks again.
B
7
G
1
Posts: 20
Reputation: 657

Post » Thu Apr 05, 2012 6:12 pm

No one knows ? I really need to know how to do this, please.
B
7
G
1
Posts: 20
Reputation: 657

Post » Thu Apr 05, 2012 8:43 pm

maby you could do some intricate stuff with arrays, and tiles. but you couldn't zoom out to far.

if that's not a problem i could make you a cap to demonstrate.
Bartosh2012-04-05 20:46:55
B
6
S
2
G
5
Posts: 249
Reputation: 2,323

Post » Thu Apr 05, 2012 10:52 pm

Thx.
I'm not using tiles. There is no possibilty to have the "Erase" effect, but with a memory of positions ?

EDIT : A .cap can be good, please. :) Thank you again !The_Lord_King2012-04-05 22:53:13
B
7
G
1
Posts: 20
Reputation: 657

Post » Tue Apr 10, 2012 1:27 am

fog command and conquer stile:

http://www.mediafire.com/download.php?djyvfhey24842b7

------------------------

arrows to move camera

left click to move nearest unit to the mouse.

mouse wheel to zoom out and see whats going on with drawing the fog.
-----------------------------------------------------------------------
there ya go.

sadly construct doesn't support proper tile maps, or large amounts of unchecked objects. so you have to deal with rendering the fog on the screen dynamically.

which is covered in this.

if you think this will work for you I will show you how to make smother edges on the fog. Bartosh2012-04-10 16:29:31
B
6
S
2
G
5
Posts: 249
Reputation: 2,323

Post » Sun Apr 22, 2012 10:55 pm

Hi, thank you ! But the it doesn't work, the fog don't "move". Think it's the solution, thank you again for your help ! :D
B
7
G
1
Posts: 20
Reputation: 657

Post » Wed Aug 07, 2013 1:13 pm

How do you make an erase effect?
B
9
S
2
Posts: 41
Reputation: 1,756

Post » Thu Aug 08, 2013 4:43 am

@HPA97, Erase effect is part of Construct Classic, you give an object that effect and it will hide objects in the same layer, and then show objects in the layers below ( I believe, it's been a while since I used it )
"Construct 4 lets YOU make advanced games! (maybe)" Construct Classic - Examples Kit
B
86
S
28
G
13
Posts: 2,092
Reputation: 15,009

Next

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 1 guest