Tokamak is alive! > Breakages demo

Blitz3D Forums/Blitz3D Programming/Tokamak is alive! > Breakages demo

Tom(Posted 2004) [#1]
Hi all,

After building my game project using Tokamak, then running into a known static mesh/terrain bug (destroying the toksim doesn't free up the terrain data which I didn't know about at the time :S), I didn't want to abandon Tokamak or change to the new ODE wrapper (still early days for ODE :)

Researching some more I found out Tokamak had a second way to use static meshes, using a callback function. Instead of just sending the whole static mesh to the collision engine, the callback function gets called for every rigidbody in the scene. Within it you can do some checks and build a small array of just the triangles that will likely collide with the rigidbody.

The routine I borrowed from Adam Dawes tutorial number 5 ( www.adamdawes.com ), and it seems to work just as quick.

Theres also an upside to using this method, you can modify the terrain data realtime! Although you'd have to be careful that you're not moving a vert or tri and subsequentialy causing an intersection with any rigid body (the collision will be missed!)

Sweenie is currently working on his own Physics engine (go Sweenie!!!) so I didn't want to bug him too much, that's why I thought I'd have a go at updating it.

I'm a C++ noob! And working on this was hard, but careful reading of Sweenies wrapper source really helped me out (cheers Sweenie!)

Breakages!
This was pretty much the last thing to be added to the wrapper to make it complete, and there's still a few things to be done, but the guts of it have been added, demo here:

http://www.tomspeed.com/breakages.zip

Extract to a temporary folder and run.

NOTE: These DLLs are NOT updates to wrapper v0.6, they're specific to this demo only, so don't go copying them anywhere else or you may screw up your Tokamak :)

Updated wrapper source will be released when the breakages are in and tests show no bugs/memory leaks. Tokamak's been 100% stable for me until the terrain bug, I'd like to keep it that way!

Credit goes to Sweenie for all his hard work on this and Adam Dawes for the terrain callback stuff.

Cheers!
Tom


Perturbatio(Posted 2004) [#2]
looks nice, runs smoothly, legs break.
The fps is a tad haywire (either that or exceptionally impressive, i.e. it exceeds the max size of an integer variable).


Caff(Posted 2004) [#3]
Looks neat :)


Sweenie(Posted 2004) [#4]
Could you possibly update the demo so that the force applied to the table isn't affected by the framerate?

The computer i'm using now is pretty slow so the table will barely lift from the ground and therefore the legs never hit the ground hard enough to cause breakage.

Anyway, Great work Tom!
I'm very curious about your project, when will you let us know what you are working on?


Tom(Posted 2004) [#5]
Sweenie:

Yeah Beaker had this problem too, I really need a slower PC to test my work on :) Try this exe along with the 2 DLLs in the old zip:
http://www.tomspeed.com/breakages50fps_2.zip

Use LMB & RMB for a stronger force

Here's some early prototype pics, it's a marble type game for kids, with lots of physics based interactive features like seesaws, magnets, lifts, hoovers, cannons, destructable items & more:




Sweenie(Posted 2004) [#6]
For kids?, hmm.
That looks like something I would enjoy playing as well
(I'm 27)... ;)


Danny(Posted 2004) [#7]
err.... got one for 43fps?! :)

got a crappy gfx board as well, but can't seem to get anything to break. Defenitely NOT an ikea table! ;)

D.


Beaker(Posted 2004) [#8]
Tom does himself a disservice. Its not just for kids.


Tom(Posted 2004) [#9]
Must be something I'm doing wrong (still a beginner atthis stuff! :).

I have the demo game_fps locked at 30fps and use render tweening, I must be calling the tok advance at the wrong place or something.

oopsah!


Picklesworth(Posted 2004) [#10]
Thanks a lot for doing this! Good luck :)
Is that terrain updating routine built directly into the wrapper, or is it in the blitz code?
Yay, breakage!!!!


Tom(Posted 2004) [#11]
Updating a terrain is as simple as rebuilding the static mesh bank, or Poking new vert position values into the old bank.

Like I said though, you'd need to make sure that altering a terrain doesn't cause it to intersect with any rigid bodies, else that collision will be missed.

i.e, you could lower a terrain that a sphere is resting on, but not raise it.


.rIKmAN.(Posted 2004) [#12]
Great going Tom - sadly I never got into Toka and got excited when ODE came along....unfortunately it has a few bugs.

Any timeframe on releasing a new DLL - I`m sure Sweenie wouldn`t mind hosting it on the PlayerFactory Toka Forum ;)


Tom(Posted 2004) [#13]
Rikman: Soon as I can get a few things ironed out.

Currently I'm having 2 snags with breakages, and unfortunately tech support @ the Tokamak forums is lacking.

Hosting won't be a problem :)


shamanenCoder(Posted 2004) [#14]
can't run the demo ... www.tomspeed.com/breakages50fps_2.zip

userlib not found!!!

where i can get the libs?

thx @all!


Rhyolite(Posted 2004) [#15]
Tom, not sure if you still have the framerate dependant problems? I had similiar problem in my current project and maybe the couple of things I learnt might help? Oh, anyone correct me if I am wrong, Im pretty much a Toka n00b too ;)

1) The damping settings need to be adjusted based on your frames per second.

2) Impulse type commands also need to be adjusted based on your frames per second. Use SetForce type commands instead if possible.

Also consider seperating your frames per second from your physics updates. But then you have probably already done that.

Maybe that helps?? And oh yeah, that game looks great, I reckon my kids would love it (and maybe even me)!

Im gonna download as I am also interested in the terrain stuff you are talking about.


Erroneouss(Posted 2004) [#16]
i got it at 332 fps stuck there


Eric(Posted 2004) [#17]
Is there a new wrapper with these new funtions?
Regards,
Eric


slenkar(Posted 2004) [#18]
it ran at 90 fps here on a crappy PC but it wouldnt break


Carrot(Posted 2004) [#19]
Is there a new wrapper with these new funtions?

yeah, anyone managed to incorporate the terrain callback functionality into Sweenie's wrapper? The memory leak bug is starting to cause me problems now...


Eric(Posted 2004) [#20]
Does anyone know if the new functions have been wrapped?