Stunts Forum

Stunts - the Game => Stunts Chat => : dreadnaut September 24, 2012, 10:05:33 +02:00

: Editing tracks in a browser
: dreadnaut September 24, 2012, 10:05:33 +02:00
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.
: Re: Editing tracks in a browser
: CTG September 24, 2012, 11:12:58 +02:00
Do a favour and give me a perfect replay editor. ;D
: Re: Editing tracks in a browser
: zaqrack September 25, 2012, 04:07:30 +02:00
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.
: Re: Editing tracks in a browser
: CTG September 25, 2012, 10:05:26 +02:00
: zaqrack  September 25, 2012, 04:07:30 +02:00
built-in editor has its limitations

It's a gift, because you can't build on the water. ;D
: Re: Editing tracks in a browser
: dreadnaut September 25, 2012, 01:41:32 +02:00
: zaqrack  September 25, 2012, 04:07:30 +02:00Using 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.
: Re: Editing tracks in a browser
: Duplode September 25, 2012, 04:50:12 +02:00
: dreadnaut  September 25, 2012, 01:41:32 +02:00
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:

: 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.
: Re: Editing tracks in a browser
: dreadnaut September 26, 2012, 01:44:51 +02:00
: Duplode  September 25, 2012, 04:50:12 +02:00Attached 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!
: Re: Editing tracks in a browser
: dreadnaut January 24, 2013, 06:53:44 +01:00
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.
: Re: Editing tracks in a browser
: zaqrack January 25, 2013, 03:17:00 +01:00
I don't think you should care about IE compatibility. If anyone wants to edit tracks only, he can launch a proper browser.