Search Unity

FogOfWar For RTS

Discussion in 'Assets and Asset Store' started by shallwaycn, Aug 31, 2012.

  1. shallwaycn

    shallwaycn

    Joined:
    Apr 3, 2012
    Posts:
    199
    Hi, everyone,
    my package <FogOfWar For RTS> now is available on asset store : http://u3d.as/content/shallway/fog-of-war-for-rts
    only $15 :)



    Features
    *Supports more than 300 clients with good performance!
    *Use height map to block visible area.
    *Use multi thread to save performance.

    needs Unity Pro, and currently is not compatible with Anti-Alias.


    FAQ:
    1, why the height block is not working for my game?
    try to increase FOW Texture Quality. if still not work, try to add extra wider colliders to specify the block area.
     
    Last edited: Feb 23, 2013
  2. shallwaycn

    shallwaycn

    Joined:
    Apr 3, 2012
    Posts:
    199
    And, currently it's not work for mobiles, but i'm trying to find a solution.
     
  3. shallwaycn

    shallwaycn

    Joined:
    Apr 3, 2012
    Posts:
    199
    Hi, every one.
    I have submitted version 1.1 to asset store, have fixed some bugs:
    1, can use multi thread on Mac now.
    2, shader performance improved.
     
  4. seifer8ff

    seifer8ff

    Joined:
    Aug 14, 2012
    Posts:
    11
    Hi, does this work on mobile yet? It looks fantastic, much better than the other fog of war implementations that I see on the Asset Store

    *Edit
    I just wanted to add that it's difficult to find this on the asset store because you spelled the title "FogOfWar" rather than "Fog of War." I think when most people are trying to find a fog of war asset, they put the spaces in. Also, there are no screenshots showing how good it looks, which may be why people are reluctant to buy.
     
    Last edited: Jan 6, 2013
  5. shallwaycn

    shallwaycn

    Joined:
    Apr 3, 2012
    Posts:
    199
    hi, seifer8ff

    Thanks for your advice, I'll polish this package in next version.

    about working on mobile device, Unfortunately i haven't found a solution yet. The main problem is the post process shader works really bad on mobiles.
    I'm still trying to find other cheap fog of war solution for my mobile game. If i find it out, I‘d be glad to tell you.
     
  6. fholm

    fholm

    Joined:
    Aug 20, 2011
    Posts:
    2,043
  7. seifer8ff

    seifer8ff

    Joined:
    Aug 14, 2012
    Posts:
    11

    Hi fholm, I definitely did take a look at your fog of war implementation, but there were a couple of things that I didn't like about it..From what I could tell from your videos (and I could be wrong, because it is kind of hard to see in the videos), the fog looks a bit chunky. Also, as compared to this, I didn't see any mention of your asset including the ability to have complete fog where you haven't been, and darkened areas where you have been previously. That's not a deal breaker for me, but all in all it just doesn't look as smooth as this package. Of course, I understand I'm comparing a mobile implementation vs a desktop implementation, but that is why I had to inquire here to see if it was working this smoothly on mobiles. Also, one last thing I noticed is that your asset doesn't seem to completely darken the fog areas, so you can still see highlights and such. What I'm really looking for is a fog of war like in Sword of Fargoal for iOS. The fog is totally smooth and looks very polished.
    Anyway, I may buy your fog of war in the near future, but I am still undecided. Your lack of activity on your threads is also a concern, not that I anticipate needing assistance, but you never know.
     
  8. Superjayjay

    Superjayjay

    Joined:
    Mar 28, 2013
    Posts:
    25
    Hey shallwaycn, I bought your fog of war package and the example seem to work great and very easy to implement. Definitely sounds like a very good implementation.
    However when I try to apply the fog of war in my game it just doesn't show any fog of war at all. I tried playing around with the FOV texture quality, set one of the actors as player and another as enemy, disabled all the image effects but no dice, playing around with the area box cube but no luck so far.
    What else do you recommend to try ?
     
  9. Andrew_atl

    Andrew_atl

    Joined:
    Sep 21, 2010
    Posts:
    103
    Did you really just advertise your product in another guys post? That is incredibly rude man.
     
  10. Superjayjay

    Superjayjay

    Joined:
    Mar 28, 2013
    Posts:
    25
    Managed to make it work, but now I'm stuck again. Instanced objects won't work as fog clients, probably because they are not added to the clients list after they are created. How do I do that ?
     
  11. shallwaycn

    shallwaycn

    Joined:
    Apr 3, 2012
    Posts:
    199
    @Superjayjay
    Hi, sorry for the late comment, I'm in china, so I'm not able to answer your question immediately, hope u don't mind:)
    Okay, I'm glad you've solved your first problem, and for your second question:
    You need to call XftFogOfWar.AddClient(XftFowClient client) to add dynamic clients.
     
    Last edited: Mar 29, 2013
  12. Superjayjay

    Superjayjay

    Joined:
    Mar 28, 2013
    Posts:
    25
    No problem, thanks a lot for the help, got it fixed. :)
    Another question, how I would I save/load the fog of war ?

    Great work btw, I recommend it to anyone who wants a good and cheap fog of war effect.
     
  13. shallwaycn

    shallwaycn

    Joined:
    Apr 3, 2012
    Posts:
    199
    Thanks:)
    The Fog is saved in "FogOfWarMap", you can read the pixels to load the fog.
    if pixel.a == 0, the corresponding area has not been visited,
    if pixel.a == "ShadowIntensity", then the corresponding area has been visited, but has no client in there.
    if pixel.a == 1, then the corresponding area is bright, and has our clients in there.

    Hope this would help:)
     
  14. Vaniljleif

    Vaniljleif

    Joined:
    Nov 20, 2012
    Posts:
    1
    Hello, this looks awsome.
    I have one question, why does this require unity pro?
     
  15. shallwaycn

    shallwaycn

    Joined:
    Apr 3, 2012
    Posts:
    199
    @Vaniljleif
    because the fog is actually a Image Effect which is not supported in unity free:(
     
  16. Caliber-Mengsk

    Caliber-Mengsk

    Joined:
    Mar 24, 2010
    Posts:
    686
    Hate to be a bother. This looks great, but last you said, it doesn't work for mobile. Have you gotten that figured out yet? This would only be useful if it works on both desktop and mobile. Thanks for letting me know.
     
  17. shallwaycn

    shallwaycn

    Joined:
    Apr 3, 2012
    Posts:
    199
    @Caliber Mengsk
    Nope, still not work for mobile.
    The demo scene on iphone4 has only 10-15 FPS.:(
     
  18. BuckeyeStudios

    BuckeyeStudios

    Joined:
    Oct 24, 2013
    Posts:
    104
    i have tried everything and still cant get the examples to work can you please help
     
  19. shallwaycn

    shallwaycn

    Joined:
    Apr 3, 2012
    Posts:
    199
    hi, can you give me some info about the problem..?

    the demo scene should work properly if you are using Unity Pro..
     
  20. DoomSamurai

    DoomSamurai

    Joined:
    Oct 10, 2012
    Posts:
    159
    Hi! I'm running into an issue with this asset when running my game in the editor. If the editor loses the focus (because I'm opening Visual Studio or doing other work outside the editor) and then I click in my game view to set the focus back on the editor, the fog of war texture turns completely black and does not seem to update anymore.

    Has anyone run into this problem? Any idea where I could look in the code to solve this ?

    Btw, it seems to happen only in editor mode. Using a PC build, losing the focus from the game window and setting it back did not create any problem.
     
  21. Sollare

    Sollare

    Joined:
    Feb 14, 2012
    Posts:
    6
    Hi! I just bought your asset, its great! But i have question - how can i make dynamic block objects - like a door. I cannot see through it while its infront of me. And when i get closer - door is moving down, and then i need to see everything behind. But know, i understand, objects are baked, and changing their position not helps
     
  22. Rajmahal

    Rajmahal

    Joined:
    Apr 20, 2011
    Posts:
    2,051
    Looks great ... buying.
     
  23. DooDoo

    DooDoo

    Joined:
    Oct 3, 2014
    Posts:
    3
    Hey, I'm Korean
    I buy your packge.
    but, I have big problem.
    This problem is packge scene error.
    Do you know this error???

    <Error>
    NullReferenceException: Object reference not set to an instance of an object
    XftFogOfWar.CheckHeightVisible (Int32 cx, Int32 cz, Int32 gx, Int32 gz) (at Assets/FogOfWar/Scripts/XftFogOfWar.cs:343)
    XftFogOfWar.GetBrightPixels (Int32 cx, Int32 cz, .XftFowClient client) (at Assets/FogOfWar/Scripts/XftFogOfWar.cs:461)
    XftFogOfWar.GetPixels (.XftFowClient client) (at Assets/FogOfWar/Scripts/XftFogOfWar.cs:478)
    XftFogOfWar.CalculatePixels (Int32 maxClients) (at Assets/FogOfWar/Scripts/XftFogOfWar.cs:433)
    XftFogOfWar.Update () (at Assets/FogOfWar/Scripts/XftFogOfWar.cs:562)
    1.PNG
    why does happen this problem???
     
  24. DooDoo

    DooDoo

    Joined:
    Oct 3, 2014
    Posts:
    3
    2.PNG Also, I play packge scene!!
    xft Fog Of war(script) is not to be enabled.
    Why..... I use unity 4.5.4ver
    I Not enough time. tell me how to Solution.
    Please...ㅜㅜ
    2.PNG
     
  25. shallwaycn

    shallwaycn

    Joined:
    Apr 3, 2012
    Posts:
    199
    @DooDoo

    First of all, you need to use unity Pro.

    This plugin does not support unity free:(
     
  26. DooDoo

    DooDoo

    Joined:
    Oct 3, 2014
    Posts:
    3
    @shallwaycn
    Thank you
    I'm college student.... so no money ㅜ.ㅜ
    But I don't give up!!
     
  27. SamTheBay

    SamTheBay

    Joined:
    Jan 11, 2014
    Posts:
    13
    I just bought this asset and am trying to get it to work for a 2d game. This means that I need the area box to be on the x-y plane instead of the x-z plane like it is in the examples. So far I haven't been able to get it to work. Do you know if this is supported or if support for it can be added? Thanks!
     
unityunity