I am kinda stuck on a concept for multiple floors I have and could use some ideas to push me in the right direction. I already got something similar working for one camera, but I can't figure out how to get it working for 2 views.
The basic concept:
I use a third person camera above the player (kind of like old school diablo angle). The problem was when entering buildings, you could not see the player through the roof/walls. And I did not want the camera to zoom in closer to fix this. What I wanted to achieve was to make the roof go invisible to see through it whenever the player enters the building.
(this is already working, the explanation is just so you guys get a general idea of what I am doing).
Adding support for multiple floors:
Then I decided to complicate things a little more and added multiple floors to my buildings. What I did was use the skill1 and a trace upwards from the player. Everything on the first floor (walls & objects) had skill1=1, everything on the second floor had skill1=2, etc...
What I did was trace upwards from the player and if an ent was hit it looked at its skill1 value and set the invisible flag for every ent that had skill1>=hitentity.skill1
(also pretty straightforward, just so you guys get the idea)
Adding support for multiple views (split-screen):
Here is where I am stuck, and would like some ideas so I can re-work my system.
EXAMPLE-1: Player1 (using view1 camera) walks into the building, he is at the ground level so the trace upwards hits an entity on floor1 (with skill1=1), and sets everything with skill1>=1 INVISIBLE. Player2 (using view2 camera) is still outside the building but can now also see into the building! (I would like to fix this but it is not that big of an issue. I could live with this since it is not really a problem)
EXAMPLE-2: Player1 now walks up to the first floor of the building, his trace upwards hits floor2 (skill1=2), he resets INVISIBLE for floor1 (skill1<2), and sets INVISIBLE for the the floors above him (skill1>=2). Player2 now enters the building at ground floor and his trace upwards hits floor1 (skill1=1), and sets invisible for all floors above him (skill1>=1). (Now this is a huge problem and has to be fixed since player1 has the floor he is on as invisible and seems to be floating in mid air above player2!)
Possible solution I cannot get to work:
So it is obvious to me now that I cannot use the invisible flag on entities since it will affect both player's views simultaneously. I have been searching the manuall for something that could help me, thinking the flags should be set for the views individually and not for the entities. I found a wonderfull little view flag that could be the first step to a solution "NOFLAG1". The only problem with this is that it only works for one floor (ground floor + ceilling), since there is not an equvialent NOFLAG2, NOFLAG3, NOFLAG4, etc... that I could use for the other floors.
Any ideas you guys can offer for me to start working on are welcome. I seem to be stuck at this point and cannot come up with a better concept. Mabe I'm just stuck thinking on ideas similar to my first system. So I'm putting this out there for anyone else that has not been working on this to see, hopefully you will not be conditioned to think in that direction like I seem to be.