Game Development Community

Seperate view and player models

by Logan Strunk · in Torque Game Engine · 09/13/2006 (8:37 pm) · 5 replies

Is there somewhere to feed torque seperate view and player models?

That way I could adjust the location of the players gun and hands that they see, and animate them seperately from what the rest of the players in the game see.

I saw a resource on it, but it was using level of detail, and seemed very much like a hack rather than a real solution, because if someone got too close, they would see a pair of hands and a gun hanging there.

#1
09/13/2006 (8:42 pm)
I disagree, I use that resource and I have not had a single problem with it. I wouldn't go as far to say it is a hack, but it is certainly not the most ideal solution.

I have never experienced "a pair of hands and a gun hanging there" when getting close to another character. I would suggest that people who do should learn how to implement LOD correctly.

Getting back to your question, as far as publicly available code is concerned that resource is the only way. The same technique is used in commercial engines, where a separate model is used for first person. At least give it a try before dismissing it.
#2
09/13/2006 (9:05 pm)
Thank you. I wasn't trying to put it down, but I was more hoping for a way to make one .dts that the player see's, and one .dts that everyone else see's. Having seperate LODs on the same .dts just seems strange.

I spoke with a friend, and he said thats exactly how half life does it too though....so, I guess I'll use it. Thanks guys.
#3
09/13/2006 (9:19 pm)
There is probably a way to do it, but you would have to write it. I know that you can turn off player models for the first person view. Then you would need to mount a model that only that client can see. I think there was discussion on how to do that somewhere. It would be a model that the server does not know about, but the client does. Kind of like a GUI.
#4
09/13/2006 (9:30 pm)
Quote:
Having seperate LODs on the same .dts just seems strange.
Really? I think it makes sense. Essentially, each LOD is a separate model anyhow.

If you can get used to the idea, I think you will find the resource extremely useful. Aside from only requiring one or two lines of code alteration, you will achive exactly what you are asking for. One model that is rendered in first person, and another separate model for 3rd. This makes animations a lot easier to work with in both views, and because you are only rendering the weapon in 1st person view as opposed to the entire player it will most likey aid in optimizing your game (poly counts). Also, you can do what we do and make the 3rd person model at a lower LOD so that you further reduce poly count without a noticable drop in visual appearance.
#5
09/13/2006 (10:39 pm)
It wouldn't be terribly hard to change the Player.cc and Player.h files, and the player data datablock, to provide separate model renders, if that's what you want to do. Follow the code for the existing model instance, and duplicate it, basically (note: a lot of the model instance code comes from ShapeBase).

To tell whether the player is the "local" player or a remote player, you could for example do the same thing as the third-person camera does to figure out what entity it should look at.