Game Development Community

FPS DEMO: Player movement speed?

by Jeremy Collins · in Torque X 2D · 05/11/2008 (4:16 pm) · 4 replies

Can anyone help me figure out how player movement speed is determined in the FPS demo? I figure it is going to be a variable set in one of the components added to the player. I have been through the desertLevel.txscene and source code, but have had no luck determining just how this is calculated. Thanks.

#1
05/11/2008 (4:52 pm)
Ok, well you are looking at the wrong txscene file for starters. I'm not sure where the speed for the player is set, but I can tell you there are 4 seperate txscene files. The Desert, the Physics, The Effects, and the FPS. Since you want to mod the FPS, I'd start looking at the FPS txscene file, since that is the one thats being loaded.
#2
05/11/2008 (7:25 pm)
Interesting.... I will check the other TXSCENE files, but I can state without a doubt that if I change the Y offset for the third-person camera in the desertLevel.txscene the change does show when running the FPS demo.
#3
05/12/2008 (5:29 pm)
T3DGroundControlComponent defines ForwardSpeed and StrafeSpeed, as well as AirControl (what fraction of normal speed the player can have when trying to move in the air).

The FPS demo has FPSControlComponent inherit from T3DGroundControlComponent, so just add/edit the ForwardSpeed and/or StrafeSpeed values in the XML on the player template's FPSControlComponent.
#4
05/14/2008 (5:35 pm)
Thanks, Russell. I guess since they were inherited the values used were the defaults and not ever written to the XML txscene file. I added the lines to the XML and it worked.

For reference--so no one is confused-- the desertLevel.txscene file is the level file used by the FPS game type in the FPSDemo.