Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by yveris · Jan 02, 2014 at 10:51 PM · c#shaderrtsfog of war

Fog of War Explored Area Gray out / un-updated areas

So I'm working with a RTS style game and I am unsure as how in SC2 or WC3 etc. when the player has explored an area and seen a building and left the area there appears to be a grayed out image of what was found in that area that doesn't update until the player returns to the region.

IE player sees a building, and it displays when he looks at that portion of the map and if it's destroyed but the area hasn't been explored since the building is destroyed it still displays that building on that player's view of the region. Also the player doesn't see any unit movement inside that area.

alt text

I am looking at two implementations using a shader that changes the alpha value of the aperture point where the camera sees the player seen here http://www.youtube.com/watch?v=yzcfTb9e0lo. The second is sort of a block veil plane that sits above the map and is changed when the player enters the region seen here http://www.youtube.com/watch?v=x40TDCjC4DY&list=PLDE92E64BE11FE309∈dex=17.

Comment
Add comment · Show 9
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image yveris · Jan 10, 2014 at 05:27 PM 0
Share

someone please help?

avatar image RudyTheDev · Jan 10, 2014 at 05:58 PM 0
Share

Are you asking how to do the entire FOW or just the hidden/unupdated objects?

avatar image yveris · Jan 10, 2014 at 06:46 PM 0
Share

The hidden/unupdated objects portion in previously explored areas but not currently occupied by anything that provides the player vision.

avatar image RudyTheDev · Jan 10, 2014 at 08:50 PM 0
Share

Just keep a different version of the object map for the player than the actual object map. Depends how your map/object list is done.

avatar image RudyTheDev · Jan 11, 2014 at 02:53 PM 1
Share

@yveris For objects, this is something that very much depends on your game world implementation and how your GameObjects are linked to the actual data. But in theory, the world would live separately from what the player "remembers".

For units, you can just hide them if the player can't see them. Layers is one option if your GameObjects depend on their Update calls.

For buildings, one way would be to store a secondary variable for each property of a building that can have player-specific data. So may be health_real and health_playerLastSeen. Every turn/update the world would update the real variables. But it would only update/match the player variables if they can see them at that time.

Then you render what the player variables say, not what the real state is. So building will burn if the player last saw it at low health, regardless of what is actually happening.

As for terrain, that will be handled differently, both your linked solutions would work.

Show more comments

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

21 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

RTS fog of war texture remapping shader,Fog of war plane texture remapping shader HDRP 0 Answers

How to show render texture in a 2D game (Fog of War). 1 Answer

Multiple Cars not working 1 Answer

Shaders making raw image invisible 0 Answers

Distribute terrain in zones 3 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges