Game Development Community

More distinct movement?

by Marcus Fernstrom · in Torque Game Engine · 04/11/2009 (9:06 am) · 5 replies

Once again I bug you nice people for help.

Here's the quesionmark of the day:

I'm wondering how to alter the way the character moves, as in I want to modify the way the character reacts to things like gravity/mass/whatever, right now I find that the movement is almost a bit too fluid for my liking, and would like a bit more distinct movement.

Do I have to dive into sourcecode? If so, where would I start looking, and what functions should I look for? (Keep in mind that I'm not a C++ coder)

Or can I affect the players movements from script?

I'm not sure what the script functions for mass, drag, maxdrag and so on does, maybe it's simple? Like stopping a bit faster then in vanilla TGE, jumping not as smooth, turning a bit more sharply, things like that.

I'm not looking for a complete overhaul of the engine, just some pointers in what direction to look at.

#1
04/11/2009 (10:34 am)
Hmm... if you're looking engine-side, Player::updateMove would be your best bet to change hat sort of behaviour. However, try upping the moveForce in your Player datablock - that should give things a tighter feel.
#2
04/11/2009 (11:19 am)
Thanks Daniel, I didn't find anything called moveForce, but it did point me in the general direction I needed, I have it a bit tighter now (Not much, but really close to what I wanted :) )

How about jumping? Any pointers on how to make the whole action a bit "faster"? It's a bit too fluid or "soft" for my taste.
#3
04/11/2009 (1:40 pm)
Ah, sorry, runForce was what I meant. I don't know about jumping - aside from telling you to bump up jumpForce ;P. But that will give your player massive leaps, which probably isn't what you're looking for. I really don't know what you're looking for - I might suggest modifying the source code so that jump force is always applied straight up, instead of at a horizontal angle.

If you don't want to mod the source code, you can prototype this functionality by linking the spacebar to a server command that applies a vertical impulse to the player. That way you can see if it really is the direction of the jump force that's causing the behaviour you don't like.
#4
04/11/2009 (1:52 pm)
Hehe yeah, runForce is what I changed.

Well, the basic idea is that now I want to make the jump a bit more "realistic" I'm not sure how to explain it, but to me it looks like the player slows down mid-air, both in speed and gravity. lol

I get a feeling I'm not making much sense. XD

I don't mind changing the sourcecode, it's just that I'm no good with C++ code so I don't know what anything means really :/
#5
04/13/2009 (5:10 am)
Do an online search for C++ cheat sheets or visit here for C++ explainations.