View unanswered posts | View active topics It is currently Thu Oct 17, 2019 9:49 pm



Reply to topic  [ 8 posts ] 
 Fog of War stuff 
Author Message
User avatar

Joined: Tue Jun 12, 2007 11:52 pm
Posts: 11824
Location: Here
Reply with quote
Post 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
Profile

Joined: Sat Feb 03, 2007 7:11 pm
Posts: 1494
Reply with quote
Post 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
Profile WWW

Joined: Sun Jul 04, 2010 6:14 pm
Posts: 37
Reply with quote
Post 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
Profile

Joined: Sat Feb 03, 2007 7:11 pm
Posts: 1494
Reply with quote
Post 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
Profile WWW
User avatar

Joined: Tue Jun 12, 2007 11:52 pm
Posts: 11824
Location: Here
Reply with quote
Post 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
Profile
User avatar

Joined: Wed Jan 07, 2009 10:26 am
Posts: 4074
Location: That quaint little British colony down south
Reply with quote
Post 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
Profile WWW
User avatar

Joined: Tue Nov 06, 2007 6:58 am
Posts: 2054
Reply with quote
Post 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
Profile
Data Realms Elite
Data Realms Elite
User avatar

Joined: Tue May 25, 2010 8:27 pm
Posts: 4521
Location: Constant motion
Reply with quote
Post 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
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 8 posts ] 

Who is online

Users browsing this forum: No registered users


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 post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.018s | 13 Queries | GZIP : Off ]