Ray Rider - Faked Physics + Car Physics

script loops through and stores bases,

then

loops through bases and applies forces, and sets wheel position and rotation

Enjoy!!

Edit:
Update - > v.6

  1. Moved body centroid inside object (it was outside)
  2. Fixed Rpm calculations
  3. Fixed ‘Centroid pop through’ bug that caused the engine to quit if you bottomed out.

update v.7 - changed aiming systems and fixed a few things.

Attachments

RayRidingTankWithSimpleMouse (AndUbberAim).blend (713 KB)

Update -> better math for wheel rotations, also added a ‘top dead center’ mark, so you can see the rpm better.

Attachments

RayRider5.blend (610 KB)

i had already tried without great success .
anyway try to keep separate the components , and using right formulas.

suspension:
high = …
maxforce = …

to me seem right this:

maxdistance = high
force = maxforce - maxforce*(effective_distance/maxdistance)

where effective_distance is => (ray_hitposition-ray_start).magnitude # if ray not hit, effective_distance = maxdistance

It looks promising.

Anyway i found a bug, engine will fail.
hit w let it go down, and up, when you are going up hit s, you stop and then throttle+reverse does not work anymore.

yeah, I noticed that, I need to move the start point of the ray above the wheel base, like .25 units.

right now, if conditions are just right, the ray emitters pop though the ground and the ‘body’ rests on the ground

Update - > Fixed Centroid Pop Through etc, Changes reflected in post #1

Update -> Ray Tank = Controls seem to all be working nicely, also added a turret with a targeting system, a projectile and a explosion on impact :smiley:

I Give you HateTank!

Attachments

RayRidingTank.blend (640 KB)

Ok Last update for tonight - > Added targeting system

please report any bugs / behaviors you don’t enjoy.

Attachments

RayRidingTankAim.blend (696 KB)

please report any bugs / behaviors you don’t enjoy.

The engine fail is gone, but the camera movements should be smoothen out, it’s a bit of a pain with the shocking camera.
also i have a feeling that it needs a weight setting or something, when hit ground a bit more force applied so it sticks better to the ground.

beside that it looks/works good.

I think your car needs wheel hinges for turning.Then that would make it more moddable.That would require some coding it.

I can turn the wheels using the property A and D I added,
it’s actually planned :slight_smile:

I should merge the properties into single property
that goes from -30 to 30, rather then two that go from 0 to 30…

about the camera, there are 2 issues, the ‘bounds’ to keep you from looking too far right and left and back are too hard, I need a second set of bounds that the camera aligns slower when your outside of the primary bound, second, the alignaxis to vect time property needs to be relitive to the distance the camera has to travel, so I am going to need to compare the angle the camera is at, to the new angle its trying to reach, the larger the angle, the more time the alignAxisToVect should take…

thanks for the feedback!

Nice little technical demo ! well when it comes to the movement, that is okay, after as LS pointed out, having the front wheels turning at the same time that the A and D keys are pressed would be good.
Personally, I would let the mouse movement control the camera or view, and allow the turret to turn around on 360 degrees, so the main pivot for the camera would be for example the turret…
I will see if I can make a nice little 3D tank/truck model to use with your demo and upload it here.

yeah, I can just use the mouse actuator for that, and then cast a ray, and aim the gun with it, rather then the mouse over any sensor,

will probably cost the same,

Sorry if i did not explain myself well.Make a wheel parented to the car that is laying flat.That would turn left if the whole wheel is turned left and if the whole wheel is turned right it turn right.This could be useful to make a steering wheels as well as the hinges for the car wheel.Thereby making it more moddable.

I started to make some sort of an armored vehicle/buggy, it’s still far from finished but the basic geometry is not that bad ; Tried to use the last demo that was posted, but I must be doing something wrong…

Weasel_v1.1.zip (1.02 MB)

I fixed the weird problem with your weasal tank but it has a steering problem now and the wheels don’t turn.
http://www.pasteall.org/blend/36126

Thanks LS ! GJ, well I think we will leave this one up to BPR :slight_smile:
If anyone is up for improving the weasel (3D model) ! then go ahead ; otherwise I will upload something during the weekend…

hey, been away from this thread a while, I’ll check out your model tonight.

I tried appending your mesh, and or / the groups in the blend, and I get a empty mesh ?

just try appending your model over GFX model, and the physics mesh needs to be super simple (think diamond or?)

/
[]
/

rotated 90

wheels Z axis needs to line up with wheel center,

Camera bobs up and down when shooting and driving.Could you fix that?That is giving me problems making a game with it.