3D Rad - Free 3D game maker - Forum

This forum is now archived!

This forum is locked, and is a read-only version. A new community-ran forum can be found at classdev.net

News:

The 3DRad community can be found at classdev.net.

Pages: [1]

Author Topic: Simple Traffic Car with AI  (Read 1059 times)

« on: December 02, 2013, 01:59:54 PM »
This is a very simple car made of three objects, a body mesh, a single wheel mesh, and a rigid body.
The car uses local2parent to mimic the movements of a car by rotating the car about the rear axle position. I also equipped it with a simple waypoint system that reads from an array and spawn the cars randomly along the path. This can be used for simple traffic cars in for example an open world game like GTA or a racing game with many opponents. It's not very cpu hungry as it doesnt use any of the car or wheel objects. I think it can be optimized even more if the imposter wheel and body meshes is used for all the cars in the scene. I was able to run 21 cars at a decent framerate.
Big thanks to Bobby Soon/Chronocide for the help with waypoint navigation:)
It's free for non-commercial purposes if anyone wants to use it, just remember to mention me & cronocide in the credits ;D
« Last Edit: December 02, 2013, 04:34:48 PM by Sondre S. »
"Believe you can, and you're halfway there."
- Theodore Roosevelt
« Reply #1 on: December 03, 2013, 11:32:54 AM »
i haven't looked at this yet, but i like the idea... a non physics controlled car with only the rb used to keep it on the terrain...

this alternative to the premade cars opens up a lot of possibilities...

--Mike
« Reply #2 on: December 03, 2013, 05:44:42 PM »
Seems pretty cool.
I can't really tell what a possible limit would be as both versions run smoothly while taking up 100% of a single processor. If there'd be a way to force 3D Rad to run on multiple cores, the limit would probably be with how many you can make with the max object limit.

One step further would be to use rigidbody imposters and control everything through a single script.

Currently using 7.22
« Reply #3 on: December 04, 2013, 05:35:38 AM »
Thanks :) I tried to use rb imposters but I could not get the custom L2P function to work with an imposter as both parent and child, so I think you'll need a separate rb for each car.
« Last Edit: December 04, 2013, 05:41:06 AM by Sondre S. »
"Believe you can, and you're halfway there."
- Theodore Roosevelt
« Reply #4 on: December 04, 2013, 08:25:54 AM »
Quote
I could not get the custom L2P function to work with an imposter as both parent and child

yeah... it appears that you must pass an object reference (ID or handle) to the function...


question: are you familiar with OOP (Object Oriented Programming) methodology...

--Mike
« Last Edit: December 04, 2013, 08:41:45 AM by Mike Hense »
« Reply #5 on: December 04, 2013, 10:48:41 AM »


question: are you familiar with OOP (Object Oriented Programming) methodology...

--Mike

Sorry, no, apart from scripting I don't know much about programming:)
"Believe you can, and you're halfway there."
- Theodore Roosevelt
« Reply #6 on: December 04, 2013, 10:59:31 AM »
don't sell yourself short... scripting IS programming...

if you did all the above, and if you understand what you did and why you did it...  then you are a programmer...

or at least starting out as one  :)

--Mike
« Reply #7 on: December 04, 2013, 01:42:30 PM »
Well yes I guess I'm almost a programmer now ;), anyway I moved my driving sim project to unity so I don't have much time left to experiment with this, but I gotta say it was a very useful experience and made scripting in unity very easy to adapt to. I pretty much did a remake of this waypoint system thing in Unity.
« Last Edit: December 21, 2013, 07:28:24 AM by Sondre S. »
"Believe you can, and you're halfway there."
- Theodore Roosevelt
Pages: [1]