Game Development Community

FlyingVehicle class, input modification ($)

by Stefan Lundmark · in Jobs · 09/18/2004 (4:38 am) · 2 replies

Background
We are working with the flyingVehicle class, and we would like to change the way the input is handled to the vehicle.

The normal player in TGE uses the mouse to look around. When you move the mouse, the view is moving in it's direction. If you move it faster, the view changes faster. This is based on mouse sensitivity.

The flying vehicle class does not work this way, and that's where we want a change.

How does it work in stock TGE?
Basically, you move the mouse and the view changes - just like the player; but then gets a dampening effect applied to it.

If you stop the mouse, the view will still move until the dampening has slowed it down. If you disable damping totally, the view will never stop and will just go into the direction you moved the mouse for infinity.

The changes
We want the flyer vehicle class to behave the same way as a player does, with the view. (read: not the movement).

This should be able to be done with moving some code from the playerclass to the vehicleclass, as an example.

The above change shouldn't be too hard to implement for someone that has done it before.

Another thing: If you start thrusting the vehicle forward, then stop thrusting, the vehicle will continue forward until the dampening effect kicks in. This is totally okay. But if you turn the mouse (and thus, the view) while you slide forward, the vehicle will go into the direction of the mouse.

We want the vehicle to continue to move into the direction it WAS facing when it was thrusting. This way you can still look to the left while moving forward (when you're not thrusting, just moving with the wind - you know). Like in the game Asteroids.

The money
I'm hoping someone can help out with this.
The money given is all I have in my paypal account at the moment.

Our project is volounteerely based, and thus we are not used to paying large sums of money.
I'm a student so my monthly income is not more than $90 at most.

Sincerely,
Stefan Lundmark

#1
09/24/2004 (7:26 pm)
For the linear movment type thing, just apply the vehicle velocity to the force before the bulk of physics code(or soemthing like that). I was trying to get some better flight physics a while ago, but I got lost in the code. I can give you some on/off code that makes the vehicle fall like a rock if its off(doesn't float down). It would be cool if we could have some BattleField Vietnam type flying vehicles(I love those jets and helicopters).
#2
08/15/2005 (8:25 am)
Hello,

i know that this thread is really old, but i have the same problem described above by Stefan. When i stop to move the mouse, the view doesn't stop rotating. Does anyone have a codesnippet that shows how this behaviour could be changed to a player like behaviour -> mouse stops, view stops (without decreasing speed)

I've tried a lot of things in the updateMove- and updateForce-methods, but nothing works correctly.

best regards
Rob