Data Realms Fan Forums
http://forums.datarealms.com/

Fog of War stuff
http://forums.datarealms.com/viewtopic.php?f=73&t=20705
Page 1 of 1

Author:  CaveCricket48 [ Sat Dec 18, 2010 7:53 am ]
Post subject:  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.

Author:  zalo [ Sat Dec 18, 2010 10:45 pm ]
Post subject:  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?

Author:  Patriot24 [ Sat Dec 18, 2010 10:54 pm ]
Post subject:  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

Author:  zalo [ Sat Dec 18, 2010 11:01 pm ]
Post subject:  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.

Author:  CaveCricket48 [ Sat Dec 18, 2010 11:08 pm ]
Post subject:  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.

Author:  411570N3 [ Sun Dec 19, 2010 2:22 am ]
Post subject:  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.

Author:  mail2345 [ Sat Jan 08, 2011 7:48 am ]
Post subject:  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).

Author:  Roast Veg [ Sun Jan 09, 2011 5:23 pm ]
Post subject:  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?

Page 1 of 1 All times are UTC [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/