Author |
Message |
CaveCricket48
Joined: Tue Jun 12, 2007 11:52 pm Posts: 13144 Location: Here
|
Fog of War stuff
So far, there are two functions that seem to deal with fog of war. Code: SceneMan:MakeAllUnseen(Vector(25, 25), Activity.TEAM_1) SceneMan:LoadUnseenLayer("Base.rte/Scenes/UnseenTest.bmp", Activity.TEAM_1);
The first one makes the entire vision of a specific team to be fogged up. The vector defines the size of the fog "particles" (note, they are not really particles). Larger fog particles are less laggy than smaller ones. The second function loads the BMP file of what the fog will look like, for which team.
|
Sat Dec 18, 2010 7:53 am |
|
|
zalo
Joined: Sat Feb 03, 2007 7:11 pm Posts: 1496
|
Re: Fog of War stuff
Missed a few:
SceneMan:GetUnseenResolution(team).X; I have a feeling that that gets the exact X pos of each fog section for scanning multiple resolutions of fog.
SceneMan:CastSeeRay(team, Vector(self.ScanPosX[team], 0), Vector(0, SceneMan.Scene.Height), self.ScanEndPos, 50, SceneMan:GetUnseenResolution(team).Y / 2); This one gets rid of fog. It has a team variable for which fog will be eaten.
A formal documentation would be nice though...
Btw, aren't you on the dev team? How would you miss this?
|
Sat Dec 18, 2010 10:45 pm |
|
|
Patriot24
Joined: Sun Jul 04, 2010 6:14 pm Posts: 37
|
Re: Fog of War stuff
data has said several times he makes this game for himself. I wouldn't expect a documentation.
Contribute or or say nothing. This is not contribution. - Seraph
|
Sat Dec 18, 2010 10:54 pm |
|
|
zalo
Joined: Sat Feb 03, 2007 7:11 pm Posts: 1496
|
Re: Fog of War stuff
Except he documented the lua before this, and he IS proud of the modding community (that's why he went to such pains to make the game moddable). I'm sure with the devlog post we'll see some form of docs.
Also, it seems you clear away fog with a bunch of rays cast from the eyes. 1 per frame. This leads to problems with Higher resolution fog maps. I am disappoint. I'll probably have to code a way to make high res fog maps work well.
|
Sat Dec 18, 2010 11:01 pm |
|
|
CaveCricket48
Joined: Tue Jun 12, 2007 11:52 pm Posts: 13144 Location: Here
|
Re: Fog of War stuff
zalo wrote: Missed a few:
SceneMan:GetUnseenResolution(team).X; I have a feeling that that gets the exact X pos of each fog section for scanning multiple resolutions of fog.
SceneMan:CastSeeRay(team, Vector(self.ScanPosX[team], 0), Vector(0, SceneMan.Scene.Height), self.ScanEndPos, 50, SceneMan:GetUnseenResolution(team).Y / 2); This one gets rid of fog. It has a team variable for which fog will be eaten.
A formal documentation would be nice though...
Btw, aren't you on the dev team? How would you miss this? I didn't formally test those myself, so I didn't want to show you stuff that wouldn't work.
|
Sat Dec 18, 2010 11:08 pm |
|
|
411570N3
Joined: Wed Jan 07, 2009 10:26 am Posts: 4074 Location: That quaint little British colony down south
|
Re: Fog of War stuff
Patriot24 wrote: data has said several times he makes this game for himself. I wouldn't expect a documentation. I use internal documentation on my personal projects. Internal documentation has more uses than you'd think.
|
Sun Dec 19, 2010 2:22 am |
|
|
mail2345
Joined: Tue Nov 06, 2007 6:58 am Posts: 2054
|
Re: Fog of War stuff
Some things about bitmap FoWs I found out: A bitmap based fog of war is scaled to the map size, and overrides existing(Vector based) fog of war. Also, fog of war bitmaps must be in pallet, however transparency works(allowing you to reveal areas without having to place an actor).
|
Sat Jan 08, 2011 7:48 am |
|
|
Roast Veg
Data Realms Elite
Joined: Tue May 25, 2010 8:27 pm Posts: 4521 Location: Constant motion
|
Re: Fog of War stuff
That would suggest there's a way to re-initiate vector fog, if not yet then at some point. Also transparency is magic pink, right?
|
Sun Jan 09, 2011 5:23 pm |
|
|
|