Jump to content
  • Advertisement
Sign in to follow this  
vmax

[2D] Outrun style road techniques

This topic is 3903 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm very curious to know if anyone has some ideas on the best way to approach handling the road drawing / movement for a 2D racing game in the style of Outrun / Lotus / Enduro Racer. Is the basic display broken up into segments (based on distance from the player, i.e. the 'fake' z-axis), for example in this screen shot: http://www.arcade-history.com/images/game/756_1.png You can clearly see each 'segment' of the road (thanks to the popular use of an alternating road colours back then) - are we simply talking about drawing each road segment and shifting them all left/right (as the road bends) in alignment? Would love to hear your ideas on this.

Share this post


Link to post
Share on other sites
Advertisement
I've experimented with various techniques, none of which have looked especially satisfactory.

One thing I can mention is that early 2D video hardware often supported scrolling tilemaps, and so by adjusting the horizontal scroll offset on each scanline the road image can be curved.

Share this post


Link to post
Share on other sites
I read something about this some time ago. I can't remember which system this was for, or which game, or anything. It might have been something like Pole Position on the 2600 of Speed King on the C64.

At any rate, this particular machine had very low level access to the raster process. The program did some simplistic 3d calculations to see how far away the current scanline was, how narrow the road segment should be, color of the road segment, and how far (and which direction) it should be from the center. This worked in conjunction with the hardware sprites, so player and opponents are rendered correctly.

Hope that helps, but it's vague and probably wrong :P If I ever find the link to what I was talking about, I'll post it here.

Share this post


Link to post
Share on other sites
You've got the basic gist of it. The road is indeed drawn as several segments, one for each row below the horizon. You do some calculations to determine some scale factor at the given distance and shift the segments right or left based on the track geometry.

You can notice quite easily that the perspective is not *quite* right, in the game, the road segments are always parallel to one another, but in the real world, they would skew as the road curves.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!