Saturday, March 09, 2013

Road Path Implementation Complete

Following those exciting Excel spreadsheets and a little ranting, I'm pleased to say road path editing is implemented and working.

Here's an initial screenshot showing the progress of LayOut, the OutRun level editor.

This is just the first small stage; changing the path of the road. It's really easy to layout a complete track; you can produce something usable in under a minute. You define a series of control points and LayOut produces the curves and straights for you. Internally, the editor uses its own format and then exports to the format required by OutRun. This makes it easier to manipulate the track than dealing with the raw data.

Cannonball will have a debug mode to render the output in conjunction with Layout, so you can use both tools together. For now, a lot of this is somewhat hard coded, but the concept is proven.

For now, the road width and objects are still read from the original level data. This will obviously change as we add these options to LayOut. Here you can see we've inserted a curve at the start of Coconut Beach.

Well done to Shawn LeBlanc for naming the editor. I was originally going to call it 'Last Wave', but this sounds more like a sound editing tool and if I ever get round to creating sound editing tools it might cause confusion.

The next step will be to add the ability to define the road width, which encompasses single and dual road support. 


Adrian said...

Incredible work yt! It doesn't take you long to accomplish something once you get stuck in to it, does it?!

If you're wanting beta testers to try this out on real hardware then I'm more than happy to step forward and offer the services of my mini upright cab in the interests of testing and reporting back potential issues/bugs. I've got a few spare 27c512's and an eprom burner/eraser. It's one thing to see a custom track running in Cannonball or MAME but it would be quite something else to drive a brand new track on the original 1986 hardware!

Well done and keep up the awesome work! :-)

yt said...

Yes. We should definitely do some hardware testing when the editor is more mature.

Most of the time so far has been spent learning the QT framework. And as always a few annoying niggles take longer to solve than they should.

The good news is a lot of legwork has been done leaving me to focus on actually building the rest of the editor as opposed to learning tools.

On a side note, its possible to represent a trackpath in around 100 bytes as opposed to the 8k or so for each path in the original game. If I was AM2 I would have used a lookup table for the sin and cos.

Adrian said...

If only we had a time machine to wind back to 1986! Then you could apply for a position at AM2 and Out Run would be roughly 80 times bigger than it ended up being! :-)

I guess if they'd used a lookup for trackpath sin/cos then the sub cpu program would probably have squeezed into a single 27c512 instead of 4 of them.

Trad Flakenblerg said...

> Well done to Shawn LeBlanc for naming the editor.

Woohoo! Thanks, It's such an honor :)

yt said...

Well, they had a bit of space to play with.

The Rev B romset contains not just the unused prototype track that can be played in Cannonball, but also the alternate Gateway course from the previous Japanese version.

Kungfu Steve said...

Very cool. But I was kind of hoping for a 'live' editor.

Was the original a set of beziers? Or does it seem to be free floating?

In my opinion, as an artists.. you have to see what the person would see, to be able to really create great levels. Drawing lines on a top view map, just isnt going to be very easy to get good levels down... and a lot of time would have to be spend going in and out of the editor to the tester, over and over and over again.

Also, its not just about the feel of the course, and the difficulty... but the look too.

And what about 3d object placement.. like the pillar tops on the tunnel level, or the low clouds on the overhanging tree level?

*** Ideas

What about a split-scree editor? In which you can see the actual game version on one side, and the top view editor on the other?

Maybe that live screen, could also be a sprite dropper as well. Where you can select an object, and place it anywhere on the screen, at the current coordinate?

Are the real games objects sent down the road using a timing system? Or actual 3d coordinates?

How are you going to handle hills?
Maybe use the live version running at a set speed, and alter controller to adjust as needed?

Is there a maximum hill size on the original arcade game? :)

Can roads intersect? That could be fun, especially with traffic added ;) or at very least, look cool. Hmm, railroad tracks could be cool too...

yt said...

I thought I'd covered the visualization in a previous post, but maybe it was unclear.

You would run the editor in one window, Cannonball in another. You click an export option in the editor. Cannonball is running in a debug mode and immediately displays the track at the point you edited. You can either scroll around the track with the cursor keys, or play it from that point.

I'm assuming by live editing, you mean you could almost create the track by driving through it, steering to set direction and pressing some other controls to create the width and hills etc.

Although this sounds fun on paper, it wouldn't give you the flexibility you needed in creating the tracks. You would quickly find that creating anything beyond basic was a complete nightmare and took way longer than having a 'proper' GUI based editor.

I did toy with the idea when starting the project, but dismissed it, because I could think of hundreds of edge cases. If you think I'm wrong about this, then you need to back up your case with solid ideas based on the reality of the OutRun game engine rather than the limit of your imagination ;)

For the objects, they work by defining chunks of sprites, and configuring a specific length of road section to index that chunk with various placement specific properties.

You couldn't really just drop a sprite anywhere as you suggested, as the level data you produced would be massive and not fit back in the original ROMs.

You would setup the chunks in the editor in a view that was similar to in-game (dragging the sprites around with the mouse) and then apply the chunk to a stretch of road.

Maximum hill size: there is no real limitation here, beyond what looks good. I have a plan for creating hills, but will discuss it in a later post.

Mr. Rockgovsky said...

Wow, I thought the progress would be a lot slower! :)

Some ideas about the editor:
-tunnels (they were there in SMS version)?
-higher/lower tracks (Outrun 2019?)
-road bumps?

Again, yt, cannonball project is going insanely fast imho. I like that. :)

yt said...

Road bumps, higher roads, tunnels and similar would require some changes to the core game code not simply changes to the level data.

This could be done in Cannonball, but would get messy in terms of bringing it back to the original hardware.

For now, I want to focus on levels that work on the original hardware as-is, but who knows what the future holds. Data changes not code/engine changes essentially.

With regard to the earlier road intersection question, with the existing level format you can split a road into two lanes, but both both lanes must follow the same core path. You can't, for example, have two simultaneous roads that follow a different path.

The raw hardware could support this, but OutRun's engine doesn't.

The end of stage road split is handled with a lot of specific code, and the path for both roads is the same (just inverted!)

There is lots of weird stuff in terms of the existing level format. For example, you cannot assign a height map and a width change to the same starting position of road.