Tokamak space ship

Community Forums/Showcase/Tokamak space ship

Picklesworth(Posted 2005) [#1]
I dug this up, and I realized that somebody may find it handy.

This is a test that I did a long time ago using the Tokamak physics engine and a lot of help from people on these forums (who taught me all about the TForm commands).
This application used to work quite poorly and had very rough collision detection... which is why it inspired me to write APE -- Which I have just used, about 15 minutes ago, to fix up the Rigid Body objects. It now works perfectly :D
You may notice a bit of imperfection around the @#!*pit, because its RB object is just a big cube. (uhm... the FRONT of the ship. I hope this censor doesn't censor code... because there's lots of naughty words ending up in some of those Windows API things. InitCommonControlsEx springs to mind)

I did a bit of cheating with regards to realism... For the ship to be able to stop, I just added air friction. I could have had thrusters on the ship and a little 'on-board' program to handle this (would have been in the game, if it ever succeeded in becoming a game, which it obviously, sadly, did not... but may eventually). In order to make this air friction seem moderately possible, I dumped the scene inside of Klass's excellent fog system. (Thus, it is all in some kind of weird cloud of gas).
The controls are as follows: Arrow keys turn, W and E rotate. Numpad + and - change speed. Backspace jumps to full speed, and 0 jumps to full stop.
Sorry about the very limited camera controls.

Anyway, have fun :D
What do you think of it?

Download: http://crumbsoftware.f2o.org/files/TokSpaceTest.zip

This screenie is not intended to look nice... it's just so that nobody will complain about how this would otherwise lack one:


Also needs the latest version of Sweeney's Tokamak wrapper, and a recent version of the Tokamak Physics Library.
Includes source. Thankfully, it is commented... for once.


Xzider(Posted 2005) [#2]
looks cool..

User lib not found
got that error tho


Picklesworth(Posted 2005) [#3]
That ALWAYS happens to me!
I'll fix the archive. Give me 30 seconds to upload.
Now contains both required DLLs and Decls files. I did not create Tokamak.decls... credit for that goes to Sweeney. (Though hopefully everyone already knows this)


LineOf7s(Posted 2005) [#4]
Apart from a few stats in the top left-hand corner, that's the stealthiest ship I think I've ever (not) seen.


Picklesworth(Posted 2005) [#5]
Hehe, yah... it doesn't work well on CRT monitors.
Just go into the source and play around with the setting in line 86. Doing Global weather_nearfade = 100 should work fine.
You may also want to change CameraFogRange in line 53.

Uhm... Sorry, my FPS counter appears to have been attached the the fog effect, so don't trust it.

As I said, this was done a long time ago...


LineOf7s(Posted 2005) [#6]
Sorry - I should have been more specific while I was being facetious: the screenshot is as black as the ace of spades.

I will however check out the code just so I can see what I'm not seeing. :o) I dun wanna miss out.

[edit] Okay... now I'm more perplexed. It's an interesting effect, and the collisions look as cool as collisions do when they look cool... but is 'silhouette at night in dark fog' the look you're going for... nice that it is?[/edit]


Picklesworth(Posted 2005) [#7]
Actually, I wasn't looking for a look.
Because of that, now that ou mention it, I think I'll tone down the fog... Above post changed.

Thanks for the advice and comments :)


Don't worry, no offence taken! Your response was helpful advice. Yah, no textures... It's just a physics demo. I do have textures for that model, but they look horrible.
|
|
\/


LineOf7s(Posted 2005) [#8]
Sorry - I didn't mean it to sound like criticism. I thought it might have been missing a texture or something...

^
|
|
|
Okay then! :o) I'll twiddle with the settings as you suggested. It still provides a cool "flying at high speed with wingman" sorta feel nonetheless.


Braincell(Posted 2005) [#9]
Oh, so this kind of thing IS possible with blitz? Wow i had nooo idea. This is really cool. Too bad i got rid of any physics-dependant ideas from the outset. I mean i have no clue how Tokamak works and what it can do, i thought it can only do collisions between primitives. Maybe this is also only collisions between primitives but it feels more complex anyway.


Picklesworth(Posted 2005) [#10]
This scene contains two rigid body objects. The objects's physics collision data are each assembled out of 4 boxes, two cylinders, and two convex hulls. (Convex hulls are about as close to pixel-perfect as you can get.).

The front of the ship should really be a convex hull, but I was too lazy to redo that model (even though it would only take a minute :D). The original model was done for a more basic, far-off perspective simulation, so perfection didn't matter.

So, real-time physics (in any language, actually) are still carried out using Primitives, but they are all cleverly assembled into one object to make a rather complex physics object. Of course, you will have to come up with positions of the primitives on your own. (Which, of course, is where my editor, and others like it but not as fantastically amazing, comes in ;) )


Picklesworth(Posted 2005) [#11]
I played around with turbulence today, and the results are actually surprisingly nice.
I also added a basic chase camera from the code archives. (SuperCam, by PsychicParrot).
It doesn't work perfectly for this program, but it doesn't really matter since it's just a horribly coded test.




(Oh and this thread should probably be moved to the B3d section...)