Game Development Community

Small player.c quark/problem

by Chris Fitzgerald · in Torque Game Engine · 09/25/2007 (1:11 pm) · 3 replies

I'm attempting to move jumpForce out of PlayerData and into Player.

Say I declare in player.h:

F32 mJumpForce;

Then in player.c:

mJumpForce = 75.0f;

Then I change:

F32 impulse = mDataBlock->jumpForce / mMass;

To:

F32 impulse = mJumpForce / mMass;

The end result is that my player cannot jump. When the player jumps, it makes a small movement (ie, a "failed jump").

What's the issue here? mJumpForce has the same value as mDataBlock->jumpForce. I also tried substituting a direct value as follows:

F32 impulse = 75.0 / mMass;

And I get the same result. I've taken a few other variables out of the datablock and have not had any problems.

This is the only location in Player.c for jumpForce.

#1
09/25/2007 (5:06 pm)
It sounds like you aren't ghosting the Player's mJumpForce over the networking engine to the client instance (yes...you have to do this even in singleplayer).
#2
09/26/2007 (7:56 am)
But Matt, wouldn't the hard coded value work even without ghosting?


However Chris, with a moments thought I remember seeing the line:
jumpForce = 8.3 * 90;

In the player datablock in server\Player.cs.

This is ALOT bigger than the default value of 75.0


And personally I prefer 8.3 * 90 * 2 but I'm a bit jumpy...
#3
09/29/2007 (12:31 pm)
Thank you two for the replies. As Brian noted, I don't think I need to ghost the jump value when I am simply applying a base jump value across all player objects. But I'll take a look at the datablock and see if that is the problem.

Thanks! :)