Decent Vehicle example?

Blitz3D Forums/Blitz3D Beginners Area/Decent Vehicle example?

Imperium(Posted 2012) [#1]
Looking for a good example of how to code a basic vehicle. I already tried out the Tomahawk car example.(really neat!) But now I need to study working code in Blitz3d.

This devs efforts certainly mirror my own:
http://www.blitzbasic.com/gallery/view_pic.php?id=2103&gallery=&page=14

I still have my boxed copy of Armourgeddon. :)

Last edited 2012


Imperium(Posted 2012) [#2]
http://blitz3d.wikispaces.com/Acceleration

Still hoping for a bit more.


Yasha(Posted 2012) [#3]
JV-ODE is generally considered good for vehicles (although there's a longstanding argument between two of the physics-engine experts about whether it's best, you'll probably find it if you read through that thread): http://www.blitzbasic.com/Community/posts.php?topic=89252

There are a couple of OK vehicle samples in the freeware BlitzODE: http://www.blitzbasic.com/Community/posts.php?topic=38644

...and a couple of rather nice vehicle examples in the awesomely ancient original ODE wrapper by Vorderman, which still stands as the only time I've ever seen anyone use CallDll for anything (mainly because we now have .decls instead). This one has good documentation too: http://www.blitzbasic.com/Community/posts.php?topic=60001#669361

I think there are a couple of pure-B3D examples in the code archives, but I can't find them right now. You'll want a physics engine either way if you want to do vehicles properly though, and I don't know if there's an open-source 'Verlet' physics implementation that doesn't suck (and doing it from scratch is... well, mainly a colossal waste of time).

When working with physics engines be aware that some of the ones which appear to work well may have memory leaks. I believe this affects Tokamak and BlitzODE with trimeshes. Stick to geometric colliders anyway for better performance.


EDIT: As a PS, the reaosn I didn't include my own miniODE wrapper in this list is because it doesn't come with a vehicle sample, but it's probably the most up-to-date of the free ODE wrappers. Just don't expect any serious support with it like you would get from VIP3R: you get what you pay for.

Last edited 2012


KronosUK(Posted 2012) [#4]
Another vote for JV-Ode here. It's what I use for my vehicles. It has plenty of usable examples for cars for instance so shouldn't be too hard to pick up. Benefits are you only need to provide thrust/braking and steering info although physics setup is key. I think you can download a demo from here. You can't really do huge physics terrains without a little work though. One thing I love about Ode which I don't see in any other physics engines is the ability to create infinite physics planes. One approach I have taken for instance is to create a physics plane, drop a few hill trimeshes on it and voila you have a massive terrain.

jv-ode physics wrapper

Either that or a variant of MadJacks code from the archives for surface alignment. You need to add the usual acceleration, velocity calcs to this. You can add a bit of bounce so that vehicle isn't always sticking to the terrain.

Vehicle pitch and roll without child/pivot entities

TFormPoint and DeltaYaw commands are particularly handy when it comes to calculating steering to a particular point. Or just fake it using PointEntity command.

Last edited 2012


Imperium(Posted 2012) [#5]
Thanks guys for helping me get me back on track.

Last edited 2012


airborne(Posted 2012) [#6]
You could always build/animate your own with sketchup, then simply export a 3ds file to blitz, sketchup has helped me immensely in my endeavors


Imperium(Posted 2012) [#7]
I have my own models ready to go but I won't be using the 3ds format for anything that needs animation. I will stick to Maya/3dsmax for now. :)