The Orange Box engine has an brush entity called "func_reflective_glass", it is a mirror entity.
Technically, it is a Camera and a Monitor within itself, which is why if you have more than one of these in a same room, you will get issues.
These mirrors look great and add a lot of realism to environments, unfortunately there is one thing that does not reflect : The player himself.
This is due to the player NOT having a model set in Orange Box, and even when set, it remains invisible when in first person mode.
Player Model
Due to a small Third Person part in Underhell : Chapter 1, we had to create a functional and animated player model, that would closely follow the player's movement speed, animation and head direction, to try and make him as "alive" looking as possible.
This is why we manually animated and linked every single player behavior, down to lowering weapons, shooting, jumping and crouching, to a preset playermodel.
The default player model is : "models/player/jake_casual.mdl"
In order to change the player model, an input must be sent to the !player entity:
!player SetPlayerModel models/player/jake_guard.mdl
This input to the !player will set the playermodel to whatever is specified.
If the model path/name is not correct, the game will simply display an error message in the console, and the model will remain unchanged.
In order for any additional player model to be animated properly, the following lines must be added to the .qc of the model :
$includemodel "player/male_anims.mdl"
$includemodel "humans/male_shared.mdl"
$includemodel "humans/male_ss.mdl"
$includemodel "humans/male_gestures.mdl"
$includemodel "humans/male_postures.mdl"
$includemodel "humans/female_shared.mdl"
$includemodel "humans/female_ss.mdl"
$includemodel "alyx_animations.mdl"
$includemodel "alyx_gestures.mdl"
Yes, those are a lot of compiled animation models, but this gives many possibilities for the player model to be well animated or even be an actor during scenes, that can have many gestures/poses.
A feature commonly used in Underhell.
Mirrors
So we had our player model, fully functional in Third Person, but it would still not render in mirrors nor monitors.The main problem was, that in order for it to be rendered there, it also needed to be rendered in the "world" so that it could reflect properly, which means that if the player would look down while in first person, he would see INSIDE the player model, and cause very nasty visual bugs.
So, we thought of a system that would allow us to render entities ONLY in the "RenderTarget" textures, giving us not only the opportunity to render player in Mirrors and Monitors while in first person, but ANY dynamic entity in the game, can be added a keyvalue to be rendered only in Mirrors or Monitors.
This system gives us endless possibilities for scares, where "something" would only be visible while looking at it through a mirror/monitor.
The playermodel has this value set by default, in order for any entity to be rendered only in mirrors, the following keyvalue must be added in hammer, by turning smartedit off:
Setting this keyvalue to any entity in the game, will tell the engine to render them only in "RenderTarget" textures, therefore only in func_reflective_glass or func_monitors.
Multiple Mirrors
As previously stated in the Multiple Render Texture, placing multiple RenderTargets that use the same RenderTarget texture in one room, messes it up badly, and can even cause crashes.
The Multiple Mirrors feature is something that we have planned, however at the time we are uncertain if it is possible using the same technique used previously.
Whenever this feature is implemented and works correctly, I will edit this section and describe it's functionality.
Player reflections? In a Half Life mod? Hell must have frozen over! Nice.
It's not like this is the first mod to have reflections in mirrors. Still mighty impressive though.
I sense really creepy mirror scares coming o.0
in this case we need feet and legs too! i can't identify myself with a mute, astral entity anyways..
indeed a properly animated player view model capable of visibly interacting with physics props would really bring the games atmosphere to life. IE being able to see your own arm picking things up for example. Not even valve has had the balls to pull something like that off.
Yeah well don't expect that to happen any time soon.
Crysis kinda does that in first person for some objects, but you can't really pick up a lot of objects in the game.
The problem with this system comes in the fact that every object has different mass and shape, and the arms and hands would need to be animated correctly so the "carrying" would look right.
Doing this arm and hands animation for every possible object in the game is a nightmare.
It could be done procedurally, which is most likely what will happen, but game developers have more important things to do that work on such things.
Very few games allow you to pick up physic objects at all...
Uh, what?
Valve has done that before in a game.
Also, there is a mod that allows you to pick up weapons. You see your hands go down, like Crysis and pick them up.
Can't find the mod right now though. It was basically CS:S with really advanced bots, more weapons,a nd changes, like SMOD, but wasn't called so.
Awesome
That's really neat, i like how you put small but cool extra details.
You can finally see yourself in mirrors? I suggest to make some scares like this :D example: You look at the mirror, everything looks normal. You look away, then you look back and "she" is standing behind you.
This.
It's one step to make the player fell that he isn't just a floating weapon!
Floating weapons have feelings too!!!!
The Player is not a weapon!! It's a pair of floating hands holding a weapon!
Can we just call it Field of View? Hands with a weapon seems weird for me :P
Wow, so weird this isn't supported by default, great work!
you should make a crazy mirror maze for one of the dreams
Thank You so much!
Too bad I won't enjoy looking at my reflection...I'll be too worried about what else is about to appear in the reflection.
Aright, now give us the lower half of our bodys. Please
I think this would be a good horror scene idea "You walk into the room and look at the mirror, the door shuts and you investigate, when you turn back and look at the mirror you see her then some creepy stuff happens like screaming then the lights go out and so on" don't you people agree with me.
Why Valve couldn't implement this stuff by now? I mean I feel that the whole Valve gaming company programmers are no better than Charly all alone...