Fog of War

This forum is currently in read-only mode.
From the Asset Store
Full game Construct 2 and Construct 3 to post on Google Play
  • well as I'm sure everyone is sick of me asking so many damned questions...here's another!!

    I'm looking to try and achieve a fog of war effect, which I've done with induvidual tiles...the problem is that the circle of vision around the player looks like a ring of enormous pixels, as it's each tile that is visible, how can I, if it's even possible...instead do the fog per pixel, so that's it's a nice round, smooth circle of vision around my player, any ideas?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Have you tried the erase effect?

    http://dl.dropbox.com/u/5426011/examples4/fog.cap made in 0.99.96

  • haha no, no I had not! Thanks for that

    although, that's only half of the effect I'm after.

    I'd like everything to be blacked out initially and as the player explores more of the map is revealed.

    The erase effect will be great for the circle of vision in the areas the player has already explored, but I want areas the player has never been to tobe totally black until they explore them, and then after being explored they're simply grayed out when the player is somewhere else (like starcraft, warcraft, etc)

    any ideas?

  • hmm, unless I'm missing something in your example, I did everything the same, but I wind up with this...

    <img src="http://dl.dropbox.com/u/4075855/fog%20of%20war%20glitch.png">

    the purple square is actually a monster from elsewhere on the map and the player doesn't show up at all...

    I created the tiled background for the fog, on its own layer, and then created the vision object on the same layer, above the fog, applied erase, and in the events...

    Always: "vision" set position to "player"

    um...help?

  • Did you check "Force own texture" in the fov layer?

    I updated the example with a grayed fog of war. I used a canvas 1/4 the size of the layout, for large layouts this method is inefficient because it will require a large amount of video memory.

    http://dl.dropbox.com/u/5426011/examples4/fog.cap

    For other ideas:

    http://www.scirra.com/forum/viewtopic.php?f=3&t=7447&p=58285&hilit=fog+of+war#p58285

  • Wonderful examples R0J0hound.

    Tips his hat

  • no I completely missed the force own texture button lol

    and your second example is perfect...is it wrong that I want to eat your brains and gain your knowledge?

    edit: Construct knowledge specifically so really I'd only eat that part of your brain, you could keep the rest

    edit: Also, my layout is somewhat large, 2592x1440, and may get bigger in the future...any ideas that might not be so brutal on the vram?

  • Looking at it again it doesn't seem to use up as much vram as I originally thought.

    You can keep the vram usage low by making the canvas smaller scale.

    For a layout with a size of 2560x1920 and a canvas 1/8th (320x240) the size of the layout ~6 mb vram is used in this example.

    http://dl.dropbox.com/u/5426011/examples4/fog2.cap

  • I am endlessly impressed by your knowledge of Construct and your willingness to share...your brains do smell yummy haha

  • Looking at it again it doesn't seem to use up as much vram as I originally thought.

    You can keep the vram usage low by making the canvas smaller scale.

    For a layout with a size of 2560x1920 and a canvas 1/8th (320x240) the size of the layout ~6 mb vram is used in this example.

    http://dl.dropbox.com/u/5426011/examples4/fog2.cap

    tiger tiger everywhere haha i love the example indeed

    I was wondering, is it posible to make objects like enemies or items appear in the light but invisible in black and grey areas?

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