Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


How does a game implement fog of war effect?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
Dr.Disrespect
Grandmaster Cheater
Reputation: 3

Joined: 17 Feb 2016
Posts: 526

PostPosted: Mon Jun 06, 2016 6:53 pm    Post subject: How does a game implement fog of war effect? Reply with quote

How does a game implement fog of war effect? Maybe by using a dynamic black layer of some sort? I have no idea. Sad
Back to top
View user's profile Send private message
cooleko
Grandmaster Cheater
Reputation: 11

Joined: 04 May 2016
Posts: 717

PostPosted: Mon Jun 06, 2016 8:40 pm    Post subject: Reply with quote

I haven't played a game with fow in a long time, but many years ago there was a x-by-y array of some precision, the player had an x and y coord and a field of view (radius z) around those coords. When the player moved any of the units in the array that fell within the circle defined by z about x, y would be marked revealed.
Code:

0 0 0 0 0 0
0 0 0 1 0 0
0 0 1 x 1 0
0 0 0 1 0 0
0 0 0 0 0 0

0 0 0 0 0 0
0 0 1 1 0 0
0 1 x 1 1 0
0 0 1 1 0 0
0 0 0 0 0 0

0 0 0 0 0 0
0 0 1 1 0 0
0 1 1 1 1 0
0 1 x 1 0 0
0 0 1 0 0 0


And so forth.

In the past, i would find the field of view variable and set it higher to reveal a greater radius around the x, y coords. This was typically found by finding what accessed the coords and tracing each instruction to see which performed math on them.

Do you have any recent game in mind? If i can find it ill take a look and see how it is done.
Back to top
View user's profile Send private message
Dr.Disrespect
Grandmaster Cheater
Reputation: 3

Joined: 17 Feb 2016
Posts: 526

PostPosted: Tue Jun 07, 2016 3:18 pm    Post subject: Reply with quote

cooleko wrote:
I haven't played a game with fow in a long time, but many years ago there was a x-by-y array of some precision, the player had an x and y coord and a field of view (radius z) around those coords. When the player moved any of the units in the array that fell within the circle defined by z about x, y would be marked revealed.
Code:

0 0 0 0 0 0
0 0 0 1 0 0
0 0 1 x 1 0
0 0 0 1 0 0
0 0 0 0 0 0

0 0 0 0 0 0
0 0 1 1 0 0
0 1 x 1 1 0
0 0 1 1 0 0
0 0 0 0 0 0

0 0 0 0 0 0
0 0 1 1 0 0
0 1 1 1 1 0
0 1 x 1 0 0
0 0 1 0 0 0


And so forth.

In the past, i would find the field of view variable and set it higher to reveal a greater radius around the x, y coords. This was typically found by finding what accessed the coords and tracing each instruction to see which performed math on them.

Do you have any recent game in mind? If i can find it ill take a look and see how it is done.


Thanks for the reply. Your explanation is very helpful. I don't have any game in mind, it's a general question that I was wondering for a while. I assume that it is impossible to create a fog of war effect for a game, right? I mean ,by using CE.
Back to top
View user's profile Send private message
cooleko
Grandmaster Cheater
Reputation: 11

Joined: 04 May 2016
Posts: 717

PostPosted: Tue Jun 07, 2016 3:30 pm    Post subject: Reply with quote

How so? 2d or 3d game, map or playing field? Some would be simple others would require substantial game additionsthat are best suited as a mod (assuming the game has an api for this) but CE isnt the right tool for most of this (even though it will let you inject your own code on top of the games, it dosnt let you easily build graphical effects. While i could see someone feasibly blacking out the minimap, anything else is a little too involved for CE. Tbh, i wouldnt attempt anything else because my skillset isnt in graphics/sprites. If you go over to a mod community, im willing to bet you could get some really solid advice on adding the effects which they may consider trivial!
Back to top
View user's profile Send private message
Dr.Disrespect
Grandmaster Cheater
Reputation: 3

Joined: 17 Feb 2016
Posts: 526

PostPosted: Tue Jun 07, 2016 3:42 pm    Post subject: Reply with quote

cooleko wrote:
How so? 2d or 3d game, map or playing field? Some would be simple others would require substantial game additionsthat are best suited as a mod (assuming the game has an api for this) but CE isnt the right tool for most of this (even though it will let you inject your own code on top of the games, it dosnt let you easily build graphical effects. While i could see someone feasibly blacking out the minimap, anything else is a little too involved for CE. Tbh, i wouldnt attempt anything else because my skillset isnt in graphics/sprites. If you go over to a mod community, im willing to bet you could get some really solid advice on adding the effects which they may consider trivial!


It's like a strategy game, 3d, like civilization 5.
Thanks for the advice, I will see if there is a modding community for that.
Back to top
View user's profile Send private message
cooleko
Grandmaster Cheater
Reputation: 11

Joined: 04 May 2016
Posts: 717

PostPosted: Tue Jun 07, 2016 3:44 pm    Post subject: Reply with quote

Is it something you are coding yourself? If so, just make a shadow cloud sprite that dies when seen! I wouldn't listen to me though, i dont know anything about coding a game!
Back to top
View user's profile Send private message
Dr.Disrespect
Grandmaster Cheater
Reputation: 3

Joined: 17 Feb 2016
Posts: 526

PostPosted: Tue Jun 07, 2016 3:54 pm    Post subject: Reply with quote

cooleko wrote:
Is it something you are coding yourself? If so, just make a shadow cloud sprite that dies when seen! I wouldn't listen to me though, i dont know anything about coding a game!


Nah, I just want to modify a game. Very Happy
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites