Create a fog of war

This forum is currently in read-only mode.
From the Asset Store
Fully commented source code/event sheet & sprites to create a space shooter game
  • 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 ! <img src="smileys/smiley5.gif" border="0" align="middle" /> ).

    This is what I've done :

    With layers :

    With canvas :

    Hope i'm clear, thanks.

    Sorry for my English, i'm french. ^^

  • 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.

  • 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.

  • No one knows ? I really need to know how to do this, please.

  • 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.

  • 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 !

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • fog command and conquer stile:


    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.

  • 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

  • How do you make an erase effect?

  • 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 )

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)