Fog Of War - how to execute?

This forum is currently in read-only mode.
From the Asset Store
Full game Construct 2 and Construct 3 to post on Google Play
  • I belive everyone knows what FoW is.

    The problem is - how to implement it?

    At first i thought the obvious - create "fog cloud" object every X and Y.

    And this would be okey i gues, for a small layout. lets presume that one cloud would be 128^2 pixels big. Thats about 100 of them for 1280^2 big layout. And as its the same sprite object it wouldnt only impact the CPU, not the VRAM. But what if the layout is 10k^2? now we have about 10k of them. And 10k objects is... troublesome, at best.

    So to cut the CPU usage/number of Objects i can adjuct the cloud size twice but then it will impact the VRAM the bigger the cloud would be. So either way CPU or VRAM are burdened.

    I though about Canvas but Canvas of this size is like a russian roulette with full barrel.

    I could try the 1st + occlusion culling/array i am not sure if i can pull this one out.

    Any ideas or tricks comes to your head how to execute this? i cant think of any reasonble solution but i lack the skills and knowledge. And this FoW is something i really would like to have. Or at least know how to use, if not for my current project then for future use.

  • This has already been asked before HERE

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • actualy no. The guys knew what FoW technique he'll use, he just wanted the blob around player to have a custome shape.

    I exactly know what i am after but the problem is my layout size. the smallest is 10k^2

    I know the basic techniques how could i have FoW. What i want to know is a variation of known technique or a new one that will not blow up the player CPU or VRAM :P

  • I think it still won't be a problem to use that method if your maps are large.

    Otherwise, just have a tonne of the same sprite black placed along the maps (probably using a for loop to place them in a grid, so you don't have to manually place them). It won't take up much VRAM since it's the same image for each sprite, and will only lag if you display too many of them on the screen at once. Then when the player gets close to them, destroy them.

  • Although I think this is similar to the HERE link above, it's a bit more simple and to me, it creates a more classic FOW effect. Uses two layers, a Main one and a Fog one, where the Fog layer is set to 90% opacity with a black filter. On that layout is a black panel object which acts as the fog. On the main layout is the player and background. Basically, the player spawns "FogCLEAR" objects on the Fog layout, which have the erase effect. To conserve performance, the player only spawns the "FogCLEAR" objects as he is moving, and at 500 millisecond intervals.

    dl.dropbox.com/u/31490769/fogSPG.cap

  • Just an idea.

    Fog of War

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