Author Topic: Fog of War -- Trouble getting started  (Read 2254 times)

Velo

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 2
  • Posts: 13
    • View Profile
Fog of War -- Trouble getting started
« on: April 15, 2014, 02:08:09 PM »
Hello,

I just purchased the fog of war package, and I've read the readme and looked at the example scene, but so far, I can't see the fog of war at all in my scene.  Also note, that I'm using Unity free version (Indie version).  I do not have pro.

This is what I've done so far:  I've dragged the "Fog of War" prefab with the "FOWSystem" script into my scene.  I positioned the prefab over my terrain and it fits great (my terrain is 500 x 500).  At this point should I see the fog of war in my scene?  So then, I attached a "FOWRevealer" script to one of my gameobject units, and made sure it was using a fog of war diffuse shader.  At this point, in my scene I still saw absolutely nothing changed -- there was no fog of war at all.  I also have played my game and nothing appears in terms of fog of war.

I've tried changing several settings, especially the "Raycast Mask" on the "FOWSystem" script.  As I thought maybe I had to set it to mask only my terrain layer?  I also tried lowering the Fog of War game object prefab to be slightly lower than my terrain, in-case the raycasts weren't reaching the terrain for some reason or something like that.

All in all, I don't see any fog of war yet  :-\  Thanks for any help/advice/suggestion! 

Velo

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 2
  • Posts: 13
    • View Profile
Re: Fog of War -- Trouble getting started
« Reply #1 on: April 15, 2014, 02:28:54 PM »
Okay, so I figured out to have my terrain material use the terrain shader provided with the package and now I see some fog of war finally :)

I have a feeling this is going to be one of those things where I'll slowly fumble around through trial and error until I figure out how it works.  Right now, it looks like the fog of war has no height to it, as it doesn't cover any of my units, buildings, or other objects.  So that's my next step.

My one test unit with the fog of war revealer on it looks like it revealed correctly, but again, there's no height to the fog -- even though I have the "height range" on the "FOWSystem" script set above the units. 

Update1:  Figured out putting the "FOWRenderers" script on enemy units will hide them "under" the Fog of War.  So it looks like that's how it knows what to hide "under" the fog.  Slowly getting there.  Btw, the fog of war itself, and effects I'm seeing look great.  I'm excited about it and the possibilities.  Especially being able to turn off the renderers while their under the fog.  Hopefully that will help with performance in my game  8)



« Last Edit: April 15, 2014, 02:46:54 PM by Velo »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Fog of War -- Trouble getting started
« Reply #2 on: April 16, 2014, 11:34:21 AM »
FOWSystem determines the fog of war's overlay map by doing raycasts, using the mask that you specified. So if it's only set to Terrain, then things like buildings that may be on the Default layer won't actually block the line of sight and will effectively be ignored by the fog.