Stunts Forum

Stunts - the Game => Stunts Chat => Topic started by: dreadnaut on September 24, 2012, 10:05:33 PM

Title: Editing tracks in a browser
Post by: dreadnaut on September 24, 2012, 10:05:33 PM
I am working on it ;)

I wrote a track viewer which should work in most recent browser, here: http://dreadnaut.altervista.org/test/stunts/
The idea is to expand it first into a landscape editor, and then into a full track editor.
Title: Re: Editing tracks in a browser
Post by: CTG on September 24, 2012, 11:12:58 PM
Do a favour and give me a perfect replay editor. ;D
Title: Re: Editing tracks in a browser
Post by: zaqrack on September 25, 2012, 04:07:30 AM
I would so much welcome a web-based track editor. Using TrackBlaster on a laptop is painful and the built-in editor has its limitations we all are familiar with.
Title: Re: Editing tracks in a browser
Post by: CTG on September 25, 2012, 10:05:26 AM
Quote from: zaqrack on September 25, 2012, 04:07:30 AM
built-in editor has its limitations

It's a gift, because you can't build on the water. ;D
Title: Re: Editing tracks in a browser
Post by: dreadnaut on September 25, 2012, 01:41:32 PM
Quote from: zaqrack on September 25, 2012, 04:07:30 AMUsing TrackBlaster on a laptop is painful and the built-in editor has its limitations we all are familiar with.

Suffering with TrackBlaster was also my main reason for starting this, but I haven't used it extensively. Apart from building anything on any terrain, are there any important features?

I have also never found a good explanation for illusion tracks, btw, so I don't know how an editor would allow those.
Title: Re: Editing tracks in a browser
Post by: Duplode on September 25, 2012, 04:50:12 PM
Quote from: dreadnaut on September 25, 2012, 01:41:32 PM
I have also never found a good explanation for illusion tracks, btw, so I don't know how an editor would allow those.

For illusion tracks you need, beyond the ability to place anything anywhere, to be able to break apart multi-tile track elements, placing its component tiles separately. That allows us to mix-and-match track elements (thus creating the illusion effects) and to fool the track continuity checks. Attached to this post is ZCT106, which is a good example of some of these techniques. View it in TrackBlaster to see how the bridge chicane and other sepcial effects were produced.

Edit: A quote from the wiki (http://wiki.stunts.hu/index.php/Track_file#Fillers), which helped to refresh my memory:

Quote from: Stunts Wiki on filler tiles

Element     Orientation reference     Orientation
                                      NW  SW  SE  NE
Filler      Tile position             **   FE  FD  FF


Filler tiles are necessary for multi-part track elements to be built correctly. The proper positioning of such tiles will be described using a 2x2 grid of tiles in which the NW tile contains the value of the actual track element. For 2x1 elements (loops and corks l/r), the track element tile is either the top or the left one (depending on orientation), and so the correct fillers are either SW or NE respectively. For 2x2 elements (corks u/d, chicanes and large corners) all three fillers should be used.

Editing track files with external tools such as Track Blaster gives the user liberty to omit filler tiles, either leaving the other tiles blank or filling them with other elements. That is the main trick deployed to build illusion tracks, as the space where the fillers would be will appear to contain the full NW tile track element except at very short viewing distances and yet the physical behaviour will be set by whatever element the designer put in its place.
Title: Re: Editing tracks in a browser
Post by: dreadnaut on September 26, 2012, 01:44:51 PM
Quote from: Duplode on September 25, 2012, 04:50:12 PMAttached to this post is ZCT106, which is a good example of some of these techniques. View it in TrackBlaster to see how the bridge chicane and other sepcial effects were produced.

Quite fun to drive, but now I'm worried there might be demons in my copy of Stunts.

If it's a matter of replacing filler tiles, it should not be a problem to add an option for that!
Title: Re: Editing tracks in a browser
Post by: dreadnaut on January 24, 2013, 06:53:44 PM
Status: I'm not going forward with this, it fails on multiple sides.

In short: reading tracks and replays in the browser is possible, but older browsers and current IE will fail. I would avoid it if possible.

A decent workaround is to encode files as text/base64 and read that —it will work decently with all browser, but requires some php on the server, and does not solve the problem with local files.

I now think that js is the wrong tool for this. The viewer works though :)


I'd still like a usable editor, so I'll consider other technologies. Java would work everywhere, but I got a bit sick of it, python+qt could also be nice and portable.
Title: Re: Editing tracks in a browser
Post by: zaqrack on January 25, 2013, 03:17:00 AM
I don't think you should care about IE compatibility. If anyone wants to edit tracks only, he can launch a proper browser.