Tokamak Rally

Community Forums/Showcase/Tokamak Rally

Sweenie(Posted 2004) [#1]
Well, not really a rallygame but at least a car driving around a track.
The carphysics still needs alot of tweaking so don't expect anything spectacular.
Anyway, here it is...
http://www.svenberra.net/tokamakrally.zip


The carmodel is made by Pongo.


fredborg(Posted 2004) [#2]
Pretty good! It feels fairly nice, even though it seems like the car is turning around it's center...It isn't fast enough, a bit pedestrian.

A bit Sega Rallyish, with a lot less speed :)


Mark Judd(Posted 2004) [#3]
Can you roll the car ?

Please tell me yes, i've just spent 30 mins trying instead of finishing my work this Friday PM.

Looks promising - also are you using sensors ?

Funky Frank


CopperCircle(Posted 2004) [#4]
Sweenie, thats great any chance you will release the code?


Caff(Posted 2004) [#5]
Nice demo! And to think I hated physics at school :)


BlitzSupport(Posted 2004) [#6]
Like Fredborg says, it goes too slow, but the movement is very nice indeed. Funky Frank -- I rolled it (eventually)!


Sweenie(Posted 2004) [#7]
@Funky Frank:
With the current frictionsettings I used in the demo it makes it a bit hard to roll.
But with some adjustments I could make it roll much easier.
Higher velocities will make it easier to roll as well.

@CopperCircle:
Sure thing. But I will need to cleanup the code a bit first.
I tend to write messy spaghetticode and then clean it up afterwards.

The method is pretty simple though.

One Rigidbodybox for the chassi and four rigidbodyspheres as wheels.
Then I attach the spheres to the body using the slider joint.
To get the suspension I simply use a basic springforce formula to apply forces to the spheres and the body.

The driving forces(longitudal force) is applied to the rear wheels and the sideways friction of the wheels is done by multiplying the wheels X-velocity by a certain gripfactor.
The lower the gripfactor the easier for the wheels to slip.
The steering comes automatically as the x-velocity removal is based on the wheels orientation.

But I realized that the key to a good simulation is lots of tweaking.


JoshK(Posted 2004) [#8]
The shocks are way too loose, but this is the best car physics I have seen in Blitz. Good work.


Bot Builder(Posted 2004) [#9]
Thats a nice car demo. My only crits are that it looks like to much linear damping. This is noticable when you go off a jump and kinda stop. This could just be the more realistic gravity though :P


Steve C ™(Posted 2004) [#10]
Very impressive work dude :)


SopiSoft(Posted 2004) [#11]
very cool, i like it, though i wish you could drive faster than right now.


Sweenie(Posted 2004) [#12]
The suspension is adjustable.
I used a very wobbly suspension in the demo to make it more noticeable to the viewer.

I will increase the allowed speed of the vehicle, but i'm gonna need to build a bigger track. ;)


Rob(Posted 2004) [#13]
Very stable!

Would you be kind enough to tell me what joint settings I need to use in order to make the slider joint sit between the car and the chassis?

And do I push the slider joint down or the car up? A little bit confused :)

The demo is really well done, very stable physics and nice feel!


Paul "Taiphoz"(Posted 2004) [#14]
Hay Id love the source to this as well.

On the subject of tokomak, I downloaded it again but the two samples you get done work I get some DLL function missing error or something like that.

Any chance you could check it out Sweenie, or am I just missing something.. The Dcls and DLL are in the userlib folder.


Regular K(Posted 2004) [#15]
Nice game or whatever :)

Do a bit of work and you might have a really fun game or whatever :P

(I almost managed to roll the truck, but right before it stopped moving it fell off the edge!)


Rob(Posted 2004) [#16]
Sorry I meant what slider joint code shall I use for wheel to chassis?


Picklesworth(Posted 2004) [#17]
I got it on its side. It's a bit weird though, I think I can still move it then. Hope that's fixable.
Nice job Sweenie!


Paul Murray(Posted 2004) [#18]
I flipped it by driving off the edge of the terrain.

That was surprisingly fun.


wizzlefish(Posted 2004) [#19]
This is exacly how "surprisingly fun" my prototypes are.

But better than anything I could accomplish


JoshK(Posted 2004) [#20]
Any source? This is a pretty good base to work from.


Braincell(Posted 2004) [#21]
cool. If you go off the edge, after a while the car is spinning so hard its wheels are floating around it.

Give us the source!


Sweenie(Posted 2004) [#22]
Ok, here it is...(messy & badly commented, the Sweenie way!)




JoshK(Posted 2004) [#23]
Thanks, man! This will work great for a little WillysMB jeep.

If anyone wants to, you can tighten the suspension with this:
UpdateSpring 1.2,-0.5,-1.5,RR_Spr_RB,50,15.0,1.1
UpdateSpring -1.2,-0.5,-1.5,RL_Spr_RB,50,15.0,1.1
UpdateSpring 1.2,-0.5,1.65,FR_Spr_RB,50,15.0,1.1
UpdateSpring -1.2,-0.5,1.65,FL_Spr_RB,50,15.0,1.1


Braincell(Posted 2004) [#24]
Thanks! A great way for me to learn tokamak and have sum fun messing up the code!


Picklesworth(Posted 2004) [#25]
Great, thank you!
This just put tokamak up a notch for me and gave me a revelation about choosing physics engines.
Maybe I will put wheeled vehicles into my game after all...

edit: Cool! When I make the suspension insanely low, it slows down drastically when it hits the ground. For some reason I didn't at all expect that.


BlitzSupport(Posted 2004) [#26]
Wow, thanks, Sweenie! This is the most fun and easily tweakable car physics code I've played with in Blitz so far (not to put down any of the others)! Excellent fun when you make the acceleration limit 20 (even though your wheels can get knocked out of place)...


Sweenie(Posted 2004) [#27]
Hmm, yes. The wheels can get a bit misplaced if they get smashed into the ground too hard.
But that is easily fixed by setting limits on the slider joint that prevents the wheels from moving too far.


Play(Posted 2008) [#28]
Can someone reupload the file with source of any car Physic in Tokamak ?
I search for it from a long time but every link is died :/


Sokurah(Posted 2008) [#29]
Here it is.


Sweenie(Posted 2008) [#30]
You'll find the source further up in this thread


EOF(Posted 2008) [#31]
In case anyone needs it here is the relevant Tokamak.decls wrapper (v0.71) which needs copying to the Blitz3D userlibs folder
Other versions available in the BLitz3D userlibs forum




BlitzSupport(Posted 2008) [#32]
I'd forgotten about this, though it was still buried on my hard drive... it's great.