How do I Advanced Fog of War

Get help using Construct 2

Post » Thu Jun 15, 2017 3:37 pm

I want to create a fog of war that isnt just black, or a fog that you cannot see the map but instead is a grey darked out fog, but you can still see the ground. Then when the player goes over it it reveals the map and anything new going on under the map that wasn't seen.

So the fog sort of takes a screenshot of the map while the player is there, then when it fogs back over again it will show what the player just saw but anything new happening under the fog isnt shown until the player reveals it again. This is a fog used commonly in RTS games.

Anyone have any ideas on how this can be done in Construct 2?
B
9
S
3
Posts: 50
Reputation: 804

Post » Thu Jun 15, 2017 10:17 pm

If you just want to darken the unseen surface you can create the fog of war out of a tilemap on top of your surface tilemap. All you need is a whole black tile with less than 100% opacity set in your graphics program of choice before saving it. That is the easy part. This could also be done with just sprites but believe me, using a tilemap is much faster, especially if the map is big.

Making things only show their last "seen" state is trickier. If it's just units you need a "dummy" ghost sprite. Basically when a unit is being set to invisible due to being in a hidden area, it would spawn a ghost sprite at it's position and with it's angle. This would be destroyed the moment the tile is revealed.

To be honest the hardest thing with FOW is making efficient FOW reveal events. The higher the map size (in tiles not pixels) and the higher the unit count the bigger the performance hit will be, there basically is no simple solution here that is also efficient. With small unit numbers, small maps and simple map reveal mechanics (show all tiles in vision range, so no line of sight blocked by obstacles etc.) you might not notice anything. However anything more ambitious and it will become apparent there is slowdown.
B
15
S
6
Posts: 85
Reputation: 1,195

Post » Tue Jun 27, 2017 5:36 pm

You can do one layer for fog.

Layer: "Fog"

Configurations:
Color = black.
Transparent = No.
Opacity = (Optional).
Force own texture = Yes.

For do visible create one sprite and put in effect

Blend mode: destination out.
B
6
S
2
Posts: 9
Reputation: 468

Post » Tue Jun 27, 2017 8:44 pm

Message: krombanna can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
See my topic and demo capx for cloud over level
I wil post a new demo a beter demo later today
viewtopic.php?f=147&t=193303&p=1129686#p1129686
If you chance the destroy on collision to set transparent then the sprite wli be back covering the map agan ones the player moves off the sprite
Dont know if it is what you are looking for but if you need more just ask
Also do download the new demo not the old one
i always whanted to make games and now i finally can
B
6
S
1
G
2
Posts: 22
Reputation: 1,401

Post » Wed Jun 28, 2017 5:44 am

Message: krombanna can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
Oke here is a tutorial video
http://www.youtube.com/
watch?v=sYbgzq-xb5E

did you maen something like this?
i always whanted to make games and now i finally can
B
6
S
1
G
2
Posts: 22
Reputation: 1,401

Post » Wed Jun 28, 2017 3:45 pm

Yes that looks really nice compared to some of the other ones i saw. Thank you. One thing I wanted was ghosting when a player sprite leaves an uncovered area, so it sort of partially fogs over, you cannot see anything new under the fog but its sort of like a snapshot of what you saw while it was revealed minus enemy units.

It was suggested to do ghost sprites which is actually a good idea, so the sprite clone would just appear in postion when cloud fogs back over, but it is all sort of confusing still.
B
9
S
3
Posts: 50
Reputation: 804

Post » Wed Jun 28, 2017 10:29 pm

I am a litlle iverloaded with work at the moment but i try to make a demo video voor you this weekend
i always whanted to make games and now i finally can
B
6
S
1
G
2
Posts: 22
Reputation: 1,401

Post » Fri Jun 30, 2017 8:55 am

Message: krombanna can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
http://www.youtube.com/
watch?v=vHAwPC0THVU

This is part 2 with an returning cloud in 50% transparentsie
And with hide enamy under the 50 % transparentie
As i say in the video i did not have mutch time to make ik and to shoot the video so there will be a part 3 also and depending on the time i have to make and shoot the video meby a part 4
In part 3 i will have a better cloud not the best but beter also i will set enamys hide and show beter then this but as showing in the video that code will be the basic of the beter versie so you can start to set it in your capx
Also meby you can upload your capx to google drive or so and pm me a download list and what you ehat to hide and be show then i can make it in your capx and upload it to my drive and send you a download link that way it will go faster and i dont have to gues what it is you want to hide and show
i always whanted to make games and now i finally can
B
6
S
1
G
2
Posts: 22
Reputation: 1,401

Post » Wed Jul 05, 2017 3:52 pm

Look at the "Lighting" tutorial in the Construct2 > New...
https://www.ravenheart.ca/home
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."
B
23
S
6
G
1
Posts: 1,419
Reputation: 4,857

Post » Thu Jul 06, 2017 6:28 am

gumshoe2029

never looked at that before i will go play around with that to see if i can make a beter cloud and cloudremover effect with effects thanks for the tip
i have to say i am new to construct 2 and i just read the how do i forum and see people questions and if it something i am going to use or just want to know my self i just open up construct 2 and start trying out stuff to see if i can make it if something work great is not delete and try agan
i have not looked at effects at all for now but i will try to make a better cloud and remover with this.
i always whanted to make games and now i finally can
B
6
S
1
G
2
Posts: 22
Reputation: 1,401

Next

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 28 guests