Dynamic creation of a "beautiful" racetrack from a list of coordinates

So I'm in the middle of making a racing game for Android (but this problem is more general than Java, so I hope I asked in the right place) ...

For my game I dynamically generate new maps for the user to "race" and let them preview the track they want to race in advance, I need to nicely, dynamically draw a preview image to represent the track.

My first solution was a simple list of roots for the corners, using a basic drawLine in between to give the user a preview of the map as intended ... The 2D green line on the screen is soft, however, and I'm just looking for tips to improve it. I tried by changing the line colors a little ...

This is perhaps best illustrated with an example:

Above is a bad example of a preview of a generated "race track" of its windy lane with a sharp turn and then ends.

It's a terrible design and looks bland and will ruin my game immersion ...

So (besides generating the best tracks!), How can I have a cute ify preview a track to make it look attractive? I know this is a VERY general question and more about DESIGN than programming, but I'm just wondering if anyone has any insight or advice: I mean I know I can animate it / view a ghostrace on a track but I'm looking for obvious solutions first before making the whole project from the track preview.

Any help is greatly appreciated.

+3


source to share


1 answer


Have you looked at Bezier curves? It's a way of defining attractive curves with a fairly small number of points, and most graphics systems draw them quickly. Don't worry too much about math, just get the idea that points define the general direction of curves, perhaps play with them in a graphics program and then program with them. I think if you follow a fairly simple rule of not letting the points get too close together, you should get decent curves.



Then, as far as design goes ... I'm not very good at this, but I would start by making a thicker line and then drawing a thinner line in that. Try different color combinations. Perhaps the thin line in the center is dotted, yellow or white, like a road lane.

+1


source







All Articles