| View previous topic :: View next topic |
| Author |
Message |
Dr.Disrespect Grandmaster Cheater
Reputation: 3
Joined: 17 Feb 2016 Posts: 526
|
Posted: Mon Jun 06, 2016 6:53 pm Post subject: How does a game implement fog of war effect? |
|
|
How does a game implement fog of war effect? Maybe by using a dynamic black layer of some sort? I have no idea.
|
|
| Back to top |
|
 |
cooleko Grandmaster Cheater
Reputation: 11
Joined: 04 May 2016 Posts: 717
|
Posted: Mon Jun 06, 2016 8:40 pm Post subject: |
|
|
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 |
|
 |
Dr.Disrespect Grandmaster Cheater
Reputation: 3
Joined: 17 Feb 2016 Posts: 526
|
Posted: Tue Jun 07, 2016 3:18 pm Post subject: |
|
|
| 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 |
|
 |
cooleko Grandmaster Cheater
Reputation: 11
Joined: 04 May 2016 Posts: 717
|
Posted: Tue Jun 07, 2016 3:30 pm Post subject: |
|
|
| 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 |
|
 |
Dr.Disrespect Grandmaster Cheater
Reputation: 3
Joined: 17 Feb 2016 Posts: 526
|
Posted: Tue Jun 07, 2016 3:42 pm Post subject: |
|
|
| 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 |
|
 |
cooleko Grandmaster Cheater
Reputation: 11
Joined: 04 May 2016 Posts: 717
|
Posted: Tue Jun 07, 2016 3:44 pm Post subject: |
|
|
| 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 |
|
 |
Dr.Disrespect Grandmaster Cheater
Reputation: 3
Joined: 17 Feb 2016 Posts: 526
|
Posted: Tue Jun 07, 2016 3:54 pm Post subject: |
|
|
| 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.
|
|
| Back to top |
|
 |
|