Tokamak and FPS player

Blitz3D Forums/Blitz3D Programming/Tokamak and FPS player

JoshK(Posted 2004) [#1]
Has anyone set up Tokamak with an FPS player for collision and movement? Is this an appropriate use, or should I just use conventional FPS player controls, and just have the player exert inertia on Tokamak objects around him?


Bot Builder(Posted 2004) [#2]
I believe the best way would be to use a Tokamak Animated Body. Then, with your own movement code have it move about etc. I haven't tried it myself, but it should work. the main problem with this is getting the player movement right. Maybe blitz collisions and tokamak collisions on the player? use blitz collisions to move the player, and use tokamak collisions to affect tokamak rigid bodies.


JoshK(Posted 2004) [#3]
I'd prefer to use one or the other, if possible. I'll let you know what I find.


JoshK(Posted 2004) [#4]
I loaded up a CShop map, and placed a bunch of boxes, but they go through the floor most of the time.

Tokamak doesn't actually perform mesh collisions for complex meshes, like maps, does it? I suddenly get the feeling it is only for boxed-in simulations.


RetroBooster(Posted 2004) [#5]
Halo, look a little deeper and you'll see that tokamak supports a lot more then you think, it just takes some thinking and it won't do it all for you, for example how do you expect tokamak to handle complex geometry when you haven't told it what the complex geometry is? Tok will handle it just fine, you just have to pass it to it.


IPete2(Posted 2004) [#6]
Halo,

Find the example of a static mesh and use that (its one of the Sweenie examples

- look for the example with these lines of code:

Terrain = loadmesh("filename.b3d")
MakeTokCollider(Terrain)

Its in the Sweenie Tokamak car demo.

it is very straight forward to set up complex models and as long as you don't tweak the fps parameters too much the collision seem to work okay for me.

IPete2.


Rob(Posted 2004) [#7]
The key is to get off your fat arse and learn it.
I've done some awesome UT2004 style vehicle physics and plan on getting tokamak to do the player as well. You can just apply velocities if you want and get any kinda feel you like.

It's a robust capable physics engine better than anything else I've used.


Vorderman(Posted 2004) [#8]
I've got it running a racetrack from Racer or Netkar or something - it's a large mesh and it works just fine.

I've modified the car demo example quite a lot, aiming for a more realistic simulation. The suspension is now more complex, allowing the wheels to bounce around quite nicely.

If only I could get the car to oversteer as I wanted it would be great. Currently I can get either oversteer and poor straight line stability or understeer with straight line stabilty, but no happy compromise between the two.

I'll let you know if I get it any better.


JoshK(Posted 2004) [#9]
Thanks Pete. No thanks to all these other useless/ignorant/stupid-ass answers. Actually, I guess Rob is the only stupid-ass.


aCiD2(Posted 2004) [#10]
terrain is just tokamaks inaccurate naming conventions. A terrain is simply a complex mesh as you want, iirc? i may be wrong however - im good at that ;)


Vorderman(Posted 2004) [#11]
Well, here's another ignorant and useless (though apparently not stupid-ass) piece of info...

I've got the oversteer under control now, and you can slide the car around quite well. I'm using a sort of variable inertia damping, dep. upon speed and steering input, seeing as there's no tyre model and I don't fancy learning how to use the pacejka system.

Hopefully at some point I'll get around to posting some of this stuff up where people can take a look at it. Perhaps...


JoshK(Posted 2004) [#12]
Okay, well spheres collide with the map, but if I use anything for gravity beyond a really floaty, low number, they slowly sink through the floor.

Boxes get stopped momentarily by the floor, but then just jiggle around and sink through.


Sweenie(Posted 2004) [#13]
Hopefully at some point I'll get around to posting some of this stuff up where people can take a look at it. Perhaps...


Please do, please do!... :)

halo:
What values are you using in your simulation?
Such as Gravity, mass of body, inertiatensor(doublecheck this one as a faulty one can cause these behaviours), dimensions...
And what are your timestep values?


JoshK(Posted 2004) [#14]
Gravity is 10.

I have used everything for timstep.

My masses are all 2.

My boxes are 100x100x100 and my sphere is 128 wide.

It probably is the interia tensor. What values would you recommend for boxes and shere of this size?


Sweenie(Posted 2004) [#15]
For the boxes, TOKRB_SetBoxInertiaTensor BoxRB,100,100,100,2
For the sphere, TOKRB_SetSphereInertiaTensor SphereRB,128,2
Bare in mind that when using a gravity of 9.8 the box would actually be 1 million cubicmeters in size and with a mass of 2, have a weight of a cardboard box or something.

Hmm, It just occured to me that I haven't wrapped the function to set the InertiaTensor "manually", that is, by providing a Vector or a Matrix.
(though I have no clue how to calculate them) ;)


Bot Builder(Posted 2004) [#16]
Try setting the second parameter of TOKSIM_Advance to 2 or 3. Your balls/boxes shouldn't go through the ground.


Rob(Posted 2004) [#17]
Hey halo, if you got your head out of the sand you'd get a lot of info from www.playerfactory.co.uk forum. But then you're an ass.


big10p(Posted 2004) [#18]
You go, girl.


JoshK(Posted 2004) [#19]
Sha-nay-nay