(SOLVED)How to make the Ai car? (TopDown)

So, it worked this time, but just to check im applying a force to the point right? or am i wrong?

There’s only a z for a closed loop. The wiki should have been more clear on that. Here is what you drew (I found this site mentioned somewhere on the forum a while back).

SvgPathEditor



Unhelpful answer, but yes there is haha. But as you already seem to have found out, you can also access the path in the object properties.

2 Likes

You’re rotating towards the point and applying a force in the direction of the car car.Angle()

1 Like

(click there)

1 Like

Ah, sorry Amigo, I see now you were referring to my ellipse movement solution. That’s an interesting point and yes I think it could easily be varied by changing the x and y radiuses a small amount. I’ll have a play with it tomorrow.

1 Like

Yes.
Dave’s dot method isn’t bad either, especially if you don’t know 1 software like Inkscape which is my case.
Without being very precise, we could imagine moving certain points (according to Y ordinate) at strategic points (bends or in a straight line), with small random Y variations.
The challenge would be to manage correctly the Y variations in these points, without overdoing it and while maintaining a certain realism.

A+
Xierra

@zGameCreator Try GIMP, it works on Linux, it’s arguably the Linux equivalent of Photoshop.

GIMP

1 Like

Right, so I 'm going to continue on with my ellipse idea even though zGC is pursuing a different option. 1. Because somebody else might use it in the future and 2. Because it’s fun.

I’ve followed up the suggestion from Amigo to vary the path. I did this by using random step in range for the Y radius of the ellipse. I thought the ideal Y radius for my track was about 180 so I used a minimum of 150 and a maximum of 225 with steps of 15 for variation. Meaning it could be any one of 150, 165, 180, 210, 225: five different paths. Every time the car completed a circuit it would change or not change randomly within the given range. There’s an intial delay of one quarter of the loop time, in this case 1 second to get the car to the right side of the track so that it would start its variation in the right place.

The events shown here are not the ones used for the gif. In order to make the gif semi interesting I made sure it did all the variations one time.

CarEllipse

3 Likes

Very well done i must say, but i prefer the other way. :stuck_out_tongue_closed_eyes:

1 Like

I watched the vid! - so you’ve got a hard turn at each arrow - Which actually is another way of doing things! You could use loads of arrow objects - when its in collision (every time i type collission it takes me three goes to get the number of l’s and s’s right!) with arrow - raycast in the direction of the arrow to find the next one and rotate towards it!

2 Likes

Hello!

It is a good start.
Arrows are also not bad to add variance in the path. They could be fixed or even sometimes randomized.

A+
Xierra

3 Likes

I tried it quickly with arrows but couldn’t get it working better than the points method - I think you’d need to number the arrows and tick them off with a variable rather than raycasting at the next one.

1 Like