News:

Herr Otto Partz says you're all nothing but pipsqueaks!

Main Menu

Editing tracks in a browser

Started by dreadnaut, September 24, 2012, 10:05:33 PM

Previous topic - Next topic

dreadnaut

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.

CTG

Do a favour and give me a perfect replay editor. ;D

zaqrack

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.

CTG

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

dreadnaut

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.

Duplode

#5
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, 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.

dreadnaut

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!

dreadnaut

#7
Status: I'm not going forward with this, it fails on multiple sides.

  • Reading local binary files in javascript is easy, as long as you don't have to deal with IE. It's still possible, but a pain
  • Reading remote binary files in javascript is fine, but with IE is a major double problem with side PITA for everyone. Don't go that way.
  • IE10 will solve all these problems, cure cancer, end famine, etc. Only, it will take years to reach enough users
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.

  • Writing files in javascript is just not possible (sandboxing, security, etc), so you would have to "download" the file every time you want to save it. More pain.
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.

zaqrack

I don't think you should care about IE compatibility. If anyone wants to edit tracks only, he can launch a proper browser.