Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Following path

Author
Message
Max Tillberg
18
Years of Service
User Offline
Joined: 16th Jul 2005
Location:
Posted: 17th Nov 2013 11:32
I am thinking of making a transport game with cars following diffrerent paths. These paths should be free form made of points. Now I wonder if you have any ideas how to do this. The cars should both follow the paths and rotate.

Sincerely,
Max Tillberg
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 17th Nov 2013 13:07 Edited at: 17th Nov 2013 13:08
maybe with linear or 4 point bezier interpolation.

but the easier way is with contact points (sensor) that hold a direction(angle) and track number,speed limit,action commands etc.

AGK 108 B19 : Windows 8.1 Pro 64 Bit : AMD Radeon HD 6670
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 18th Nov 2013 06:53
The problem with following a bezier path (or any kind of spline really) is keeping a consistent speed along the path.

Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 18th Nov 2013 12:20
@Phaelax
not really, u can use a fix length or steps from 0-1 calculated by length,or template curves where you know the length.

@Max Tillberg
for my racing game i use bezier curves and a grid for each track
with pre calculated steering angle.
the car just steer to this angle from grid in front of car.
so if the car slide off road he find a way back.
but the track editor was a lot of work.

AGK 108 B19 : Windows 8.1 Pro 64 Bit : AMD Radeon HD 6670
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 18th Nov 2013 19:42
The problem with the spline curves is calculating an accurate length. I remember several ppl trying to come up with an accurate method on gamedev some years back.

Thinking about it now though, one could pre-calculate the length of the segments. Maybe there was something else we were trying to do, cause now it doesn't seem as complicated as I remember.

Assuming the spline is the center of the track, you could check the distance of the car from the nearest line segment in the spline to see if it's currently on the track or not. This would keep the car's movement independent of the track if that makes sense.

Login to post a reply

Server time is: 2024-05-03 15:47:56
Your offset time is: 2024-05-03 15:47:56