Game Development Community

Features of the TGE

by Sven "RaCooN" Knie · in Torque Game Engine · 01/10/2002 (3:39 am) · 3 replies

Ok this may sound stupid, but i didn't fund clear answer in the forum (ups, the forum is big enough for a few weeks to read ;)) for following questions:

first of all, i came from the unreal engine an miss (or can not found) some of there features.

supports the engine (who can i use them)
- swimming (it sounds crazy, but i think a player shut not walk on the seafloor ;))

- Doors/Elevators (i found one thread that confuse me, did or didn't support the engine them. The Mapeditor Quark has in his "torque entities" a entitie called "Door_Elevator")

#1
01/10/2002 (10:42 am)
I dont know about swimming. i attempted to fix this once, but it proved to be less than satisfactory (id fly way out of the water if i tried to jump near the surface, and couldnt change directions...) i suppose if anyone has some air control implemented, swimming would come naturally after that
ryan
#2
01/11/2002 (1:44 am)
Hi.(i'm french so excuse my english)

Swimming could be implemented, in fact i implemented it two weeks ago...but it was creepy and i decover vehicles so i use vehicles instead now :)
So here is what i can remember (sorry i deleted my old code):

You have to open player.cc :)

Check for sPlayerConformMask and add WaterObjectType to it.

Now in function fallToGround(...) (for the corpse)
you have to implement water testing, i mean after a castRay(....., &coll) call use coll->object->getTypeMask() & WaterObjectType to determine if it touch water.
and look at the "sink" control on the Z position to do a floating corpse (using SINE function with time as an argument)


Look at updateActionThread() for swimming sound use the same technique, add WaterObjetType test...

You should check playImpactSound() too to implement splash emission here (i didn't do that)

Now there's a possibility, a choice i mean, use updatemove or updatepos, i prefer update move but...you should see.

So in void Player::updateMove(const Move* move)
Look at this line : VectorF acc(0,0,mGravity * mGravityMod * TickSec);

it add gravity to the player acceleration
few lines after there's a findcontact call, in this function you can add WaterObjectType management, but i remember that i use a different method, i use a "findwater" (or simply use mWaterCoverage variable) to check for water forces and substract it to gravity (if fact at 50% of mWaterCoverage gravity is null, or ... better dependent on a SINE function to add floating...)

Hope it will help, sorry i deleted my code 2 days ago.
#3
01/11/2002 (5:54 am)
perhaps i'm not up2date. but til now, there's now implementation for doors or elevators. because in tribes2 they weren't used.
So, you have to wait, until they implement it or you can do it yourself.

Hope this helps.