How do you handle visibilty in a TOP-DOWN Game?
I have been trying arroung with the top-down template a bit and tried to figure out a way to handle the visibility of objects, that hide you character when you walk behind them. Imagine you are in a little town with houses which you can enter. Now in order to see your charcter you need to hide everything that is hiding it, like wall, ceilings and maybe even props.
Here is what i have tried so far:
Use a material parameter collection to store the position of the character and make stuff that occludes him invisible. However, this approach doesn't look very good, thats why I threw it out of the window.
My second approach is, to make everything part of a special blueprint type, that has events you can trigger, which then will hide / show the mesh by settings its visibilty. This works, but i have some problems:
How can i determine wether a BP should be triggered to be (in)visible? I tried using rays. The problem here is. that if you use Small modular assets for walls, it will only hide the pieces that actually occlude the player character. I want it to hide whole walls, that might hide not only the character, but also important parts of the room. The effect i would like to achieve is like in the game "The Sims" (Screenshot: http://7games7.com/wp-content/uploads/2014/05/Sims3AP.jpg) As you can see here, all the bottom walls + the ceiling of the room are hidden. I wonder how it is determined which walls to show and which not, based on camera and character position
You can do a Multi Line Trace by Channel to hide Actors between the camera and the character, doing something like this:
But if you're looking to do something similar to what's shown in that image, you might be better off using a Trigger Volume around your building. When the character enters the volume, you Hide the specific walls you want (looks like bottom and left walls in that image) and ceiling, and leave all other actors visible.
If you are using static lighting, shadows will remain when actors are hidden. Dynamic shadows will not remain. When an Actor is hidden, you it won't be picked up by your mouse clicks.
Hope that helps!
answered Jun 13 '14 at 03:00 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here