Game Development Community

First Person Weapon Model?

by XoCluTch · in Torque Game Engine · 08/18/2002 (10:17 am) · 128 replies

Hey,
I am trying to make a change to the engine so when the player is in First Person model of the weapon he see's will differ from the weapon he see's in Third Person or to anyone else looking at him.

Does anyone know how i can perform a engine change like this? I'm pretty good at coding changes to the engine. But this might be a little over my head =P

Any help is Welcome..


Thanks,
XoCluTch
#101
12/09/2005 (1:22 am)
@Josh Moore (off topic)
Your UI reminds me of Deus Ex: IW alot..

@Alan James
So, Your problem is that the Weapon Shadows are rotated wrongly, that would probably be the First Person shadow cast issue C2 pointed out. I'll have to try this recource.
#102
12/09/2005 (1:56 am)
@C2, you might be taking a performance hit due to the shadow being taken from the high poly 1st person model. When that happens, are you, i.e. the camera, in 1st person mode observing another player/bot? Do they then also have a 1st person weapon? i.e where is the 1st person shadow coming from?
#103
12/23/2005 (6:24 am)
Ah I missed these posts.

@Alan, your problem is due to the solder pack's problem. Download the new soldier pack files and it will be fixed. The mount point was rotated incorrectly. Since you don't have an eyeOffSet in your game, things in first and third person look fine for you. Nothing to do with this added code.

@Duncan: I don't have "renderFirstPerson" set to true, so there is no shadow of the player in first person mode. If I go to third person mode and observe my own character during the reload sequence, it is noticeable it is the high-poly model that is doing the shadowing. This I have also observed in networked play on the other players, their shadows are as well, taken from the high-poly models.
#104
12/23/2005 (7:25 am)
@C2

I got the updated soldier pack model before it was even uploaded and have reintroduced eyeOffSets since then, so it's probably not that. It also occurs with Psionic's models and ones from FPS Creator along with several other sources. I'm sure it has to do with rotation of mount points, but for the life of me I can't seem to get it right!
Thanks!

- Alan
#105
12/23/2005 (7:45 am)
@Alan: Strange. I got the updated soldier pack rig from Jeff Gran 3 days after the Soldier Pack came out too, but my shadows don't do that. Hrm.
#106
12/23/2005 (10:24 am)
@C2, if thats true about the shadows then you can expect a major FPS increase by doing a similar one line change to the renderShadow method in shapebase.cc. I'll have a look later today when I'm more awake.
#107
12/23/2005 (6:22 pm)
OOC: As a side note, I just realized this entire topic is in the Public forum. =O

@Duncan: That'd be great. :)
#108
01/02/2006 (8:03 pm)
@C2

I've just got one word to say about my own stupidity. rotated nodes. =P

I was using the wrong soldier model and had rotated the nodes wrong in all of my new characters. Doh!
I didn't even notice it until I loaded Evi's new female pack model and low and behold one of my old weapons worked right in first and third person AND the shadow was right. I'm an idiot, but I'm all better now...

- Alan

www.reallyreallygoodthings.com/screenshot517.jpg
#109
01/07/2006 (4:58 pm)
@Alan: Glad to hear you got it working. :)

@Duncan: Did you get a chance to take a look at the renderShadow thing?
#110
01/19/2006 (9:45 am)
Wot does LOD mean, ive put in the

if(fogExemption == true)image.shapeInstance->render(1);
else image.shapeInstance->render()

but i dont understand wot to do next and where the first person animations shud be and where the thrid person animations should be
#111
01/27/2006 (6:18 pm)
Just to clarify on something, since we used this method for our own project... It should actually be:

if(fogExemption == true)
   image.shapeInstance->render([b]0[/b]);  //not 1, LODs start at zero
else image.shapeInstance->render();

-Jase
#112
01/27/2006 (6:43 pm)
0 did not work for me, totally screwed up a lot. (Some reason LOD 0 is not rendered in my model exporter for me) Which is why I made it 1, and that works to perfection.
#113
01/28/2006 (5:49 am)
The exact opposite, for me. The models I'm using were exported from max, what modeler do you use? TorqueShowTool Pro also shows that the LODs start at 0, which is why I changed it to get it working.

Oh well, atleast its working for both of us. Might just be differences in exporters, but if 1 doesn't work for someone, they can try 0 and vice versa.

-Jase
#114
01/31/2006 (4:50 pm)
For some reason I get an error when I try to do this in TSE.

Edited: Fixed. Copied some foxExemption stuff from the old code to the TSE version and it works now.
#115
02/15/2006 (8:01 am)
I got both LODs to export and render properly, but the 1st person object is inheriting the 3rd person object's animation, even though they are connected to two completely different dummy objects in the schematic view. Any idea why this might be?
#116
02/15/2006 (9:11 pm)
@ C2 or anyone else using this method.

Just so I fully understand what's going on here, does putting in the resource that Josh Moore kindly donated and using the methods that C2 outlines above mean that...

a) When in 1st person view you may have a reload animation with hands that doesn't render in 3rd person view?

b) To achive this all your weapon models must include hands?

c) The only thing that renders in first person view is the weapon and hands, not the rest of the player?
#117
02/16/2006 (1:22 pm)
Hi Tim,
I'm going to try to answer this (I was hoping someone else would who knows more than I do would, but haven't seen anything yet, so I'll give it a shot).

a) Yes. I've done at least part of these modifications (C2's, not Josh's), and I have separate models for the weapon/hands that do different things than the third person model and are not visible in third person.

b) No, but of course if you don't include hands, in first person you won't see any hands, just the weapon (and what ever you choose to give the same LOD).

c) Yes. The only thing that renders are models that have the a LOD of "1" which if you want a detailed weapon/hand model is "1"(or at least that worked for me). This has caused me a bit of a problem with reflective surfaces (i.e. mirrors in first person mode -- "floating hands and weapons").

If I mistaken on any of this, someone who can help out Tim more please chime in.

- Alan
Really Really Good Things Studio
#118
02/16/2006 (9:38 pm)
Thank you kindly Alan,

That calrifies things a lot more.

So really the head code changes are minimal to achieve this? I'm guessing out of all the code changes mentioned on this thread only the one C2 mentions is necessary, is this correct?

So in effect, what you are doing if you want hands on a weapon that interact with that weapon during a reload sequence, is including the hands as part of the weapon dts model reload animation. These hands won't render in third person view, only 1st person view due to the LOD mod? So in 1st person nothing renders but the weapon dts with hands?

I'm still a little hazy, if anyone want's to donate their time and dumb it down for me i'd be greatly appreciative.

Someone should tidy this up and post a resource, i'd be happy to do it once I work out what's going on.
#119
02/17/2006 (11:48 am)
I'll put it up as a resource with a bit more in-depth information on how it works soon.