Modified Track Path Editor + Tracks/Discussion

Here is a preview of upcoming changes to the elevation editor. It's not ready to be shared yet, but I'm working on it!
  • The slope graphs got their own canvas (dark grey) with some guidelines to help you estimate the magnitude. It scrolls in the x direction together with the main canvas.

  • The canvas showing the height data recieved the following changes:
    • Zooming in/out in the z-direction
    • An origin line is plotted, showing the original elevation of the track when it was loaded.
    • The brush data is now displayed in the column to the left, instead of underneath the mouse.
  • Lots of streamlining and getting rid of old inefficient code.

  • Future plans:
    • Zooming in/out in the x-direction
    • Zooming of the slope graph
    • Adding guidelines showing the distance
    • Adding guidelines showing the height
    • Adding an options panel
    • Adding a track map (so help me God).
    • An "undo" and "redo" function would be nice.

ee107a.png
 
One question I have as far as the image import goes. Can zoom, move and rotate the image at all?

No, but you can do all that with the track itself. Select the whole track by dragging a rectangle with the right mouse button pressed and move by dragging a control point or segment, rotate by dragging while pressing Shift and right mouse button and scale by holding Ctrl instead of Shift.
The image adds a lot of rendering overhead so the zooming and dragging is more sluggish, sorry for that. So it's best to import the image, create you track using the image backdrop, then discard the image and then select the track and drag it where you want it to be in the scenery and scale it to it's original track length.
Incidentally i made some optimizations regarding scaling and rotation of the track (it should work more fluently now) but it's not in the repository yet. Stay tuned, will add it later.

A big weakness of tkinter, the native GUI of python (which is just a wrapper around TK, the GUI part of TCL) is the image handling support. It supports only GIF/PBM image format out of the box, the image library Pillow takes care of the rest. And images are always displayed unzoomed and cannot be scaled by tkinter, you have to take care of that yourself. It's already a major hassle to make sure the image display works with the canvas zoom, in theory you could add image scaling and dragging support but since it's easy to just scale, rotate and drag the whole track i was lazy and left it out.
 
No, but you can do all that with the track itself. Select the whole track by dragging a rectangle with the right mouse button pressed and move by dragging a control point or segment, rotate by dragging while pressing Shift and right mouse button and scale by holding Ctrl instead of Shift.
The image adds a lot of rendering overhead so the zooming and dragging is more sluggish, sorry for that. So it's best to import the image, create you track using the image backdrop, then discard the image and then select the track and drag it where you want it to be in the scenery and scale it to it's original track length.
Incidentally i made some optimizations regarding scaling and rotation of the track (it should work more fluently now) but it's not in the repository yet. Stay tuned, will add it later.

A big weakness of tkinter, the native GUI of python (which is just a wrapper around TK, the GUI part of TCL) is the image handling support. It supports only GIF/PBM image format out of the box, the image library Pillow takes care of the rest. And images are always displayed unzoomed and cannot be scaled by tkinter, you have to take care of that yourself. It's already a major hassle to make sure the image display works with the canvas zoom, in theory you could add image scaling and dragging support but since it's easy to just scale, rotate and drag the whole track i was lazy and left it out.

Instead of zooming and rotating the image (which would also distort it somewhat, as it's pixel graphics), how about zooming and rotating the world*?
💡

If Muhammad won't come to the mountain, then the mountain must go to Muhammad ;)

(*Well, essentially it would be like zooming and rotating a camera looking at the world, but it sounds more fun to rotate and zoom the actual world)
 
Instead of zooming and rotating the image (which would also distort it somewhat, as it's pixel graphics), how about zooming and rotating the world*?
💡
That would be the right approach, and the tkinter canvas has a coordinate system separate from the window coordinates already, but it lacks scaling and rotation of this coordinate system. For example the scale method scales all coordinates of all objects, but for zooming the view i'd like to think of a camera that moves instead of moving all objects. I created the CanvasX class just to keep track of the scaling and being able to work with a fixed object coordinate system even while scaling underlying object coordinates. In principle the CanvasX contains everything to enable rotation of the view too, even a perspective transformation would be possible if the track heights are added to make the track path coordinates 3d.
That said, the images in a tk canvas aren't scaled, they are nothing more than a point to attach the image pixels and on scaling the pixels aren't scaled. So even if we move the camera back and forth the image wouldn't become bigger or smaller, only the point would move. The scaling of the image has to be done manually, in fact i use the Pillow Library to create a scaled image and move it to the right spot at every step of a zoom, all that while making sure only a portion of the zoomed image is actually created. Otherwise the memory requirements for a full scaled image at a large zoom value would blow up the program. All this new image creation takes more time than it would need if the image would be scalable in tk itself as part of the canvas rendering. :indiff:
 
That would be the right approach, and the tkinter canvas has a coordinate system separate from the window coordinates already, but it lacks scaling and rotation of this coordinate system. For example the scale method scales all coordinates of all objects, but for zooming the view i'd like to think of a camera that moves instead of moving all objects. I created the CanvasX class just to keep track of the scaling and being able to work with a fixed object coordinate system even while scaling underlying object coordinates. In principle the CanvasX contains everything to enable rotation of the view too, even a perspective transformation would be possible if the track heights are added to make the track path coordinates 3d.
That said, the images in a tk canvas aren't scaled, they are nothing more than a point to attach the image pixels and on scaling the pixels aren't scaled. So even if we move the camera back and forth the image wouldn't become bigger or smaller, only the point would move. The scaling of the image has to be done manually, in fact i use the Pillow Library to create a scaled image and move it to the right spot at every step of a zoom, all that while making sure only a portion of the zoomed image is actually created. Otherwise the memory requirements for a full scaled image at a large zoom value would blow up the program. All this new image creation takes more time than it would need if the image would be scalable in tk itself as part of the canvas rendering. :indiff:

But if you can scale the world you don't need to scale the image. Instead of adjusting the image to the scale of the world, you adjust the world to the scale of the image.
 
Where are the contour lines derived from? They seem to handle the zooming and moving much better than the image import. At times the image would even disappear but the contours seemed to stay locked in position and lined up properly while scaling and moving the track.

It was still better than the tpe since I could have the turn image zoomed in on half the screen and the track layout of the turn on the other. Was able to see in better detail and fix some turns but having the overlay would certainly take out the guess work.

I'm gonna try an external program like http://imageoverlayutility.bitbucket.org to just overlay it on the whole screen, though a more precise solution would be to just overlay Google maps somehow. Since I'm trying to focus on a single segment at a time I think it could help. Zoom to section of Google map, print screen, overlay, match in editor and perfection.
 
Last edited:
But if you can scale the world you don't need to scale the image. Instead of adjusting the image to the scale of the world, you adjust the world to the scale of the image.

But what if your image is 100x100 pixels? Wouldn't you want to make it bigger? :)

Where are the contour lines derived from? They seem to handle the zooming and moving much better than the image import. At times the image would even disappear but the contours seemed to stay locked in position and lined up properly while scaling and moving the track.

They are extracted from the height map, using a python library that's not easy to install on windows -- that's why i prebaked them. While lines are much faster to draw and handle, finding the relevant contours in an ordinary image is hard...

I'm gonna try an external program like http://imageoverlayutility.bitbucket.org to just overlay it on the whole screen, though a more precise solution would be to just overlay Google maps somehow. Since I'm trying to focus on a single segment at a time I think it could help. Zoom to section of Google map, print screen, overlay, match in editor and perfection.

Neat little program! :D:tup: I'll try to commit my image backdrop optimizations this evening, right now there are several bugs in the image backdrop handling... :guilty:
 
It was still better than the tpe since I could have the turn image zoomed in on half the screen and the track layout of the turn on the other. Was able to see in better detail and fix some turns but having the overlay would certainly take out the guess work.

New version available at https://github.com/tarnheld/ted-editor, please download the zip again and tell me if it works better now. :)👍
 
I think the latest version of the elevation editor is good enough to be shared now. It's not 100% complete, for instance the scrollbars look like they're disabled, except for the one scrolbar that actually is disabled... But for the most part it appears to run as it is supposed to.

Changes from 1.0.6:
  • The slope graphs got their own canvas, running parallell with the main canvas.
  • Zooming enabled in the Z dimension:
    • To zoom in, press z
    • To zoom out, press alt+z
  • Scrolling with the mouse enabled: Right-click and drag to scroll.
  • Guides and rulers added. They are dynamic and adapt to the zoom level.
  • The elevation profile of the original file is plotted with a dark line.
  • The brush data is now displayed in the column to the left.
  • A bit of streamlining has been done to make the application run smoother.
  • Some tweaks to the graphics were done (mostly colors and line widths).
107a.png
 

Attachments

  • elevation editor 1.0.7a.zip
    11.8 KB · Views: 42
I think the latest version of the elevation editor is good enough to be shared now. It's not 100% complete, for instance the scrollbars look like they're disabled, except for the one scrolbar that actually is disabled... But for the most part it appears to run as it is supposed to.

Changes from 1.0.6:
  • The slope graphs got their own canvas, running parallell with the main canvas.
  • Zooming enabled in the Z dimension:
    • To zoom in, press z
    • To zoom out, press alt+z
  • Scrolling with the mouse enabled: Right-click and drag to scroll.
  • Guides and rulers added. They are dynamic and adapt to the zoom level.
  • The elevation profile of the original file is plotted with a dark line.
  • The brush data is now displayed in the column to the left.
  • A bit of streamlining has been done to make the application run smoother.
  • Some tweaks to the graphics were done (mostly colors and line widths).
Pressing alt+z will make it keep on zooming in instead of zooming out for me, weird. I tried both left and right alt btw.
 
Wow, this Editor is still going, eh?
Good job guys! Also have a happy but late 30th page celebration!
(I was thinking about should GTPlanet have an article about this Editor, then i remembered
it's not really legal to modify Gran Turismo sooo....?)

Anyway, Eran, i think it would be better (and more cool) if you make the colour of the
height data canvas the same dark grey as the slope graph. And make the surrounding
white into a lighter version of that dark grey. So it would look like a menu in GT.
That would also mean changing the font colour into white or light grey.
Also also, the line for original height data appears either too thin or too transparent.
 
Wow, this Editor is still going, eh?
Good job guys! Also have a happy but late 30th page celebration!
(I was thinking about should GTPlanet have an article about this Editor, then i remembered
it's not really legal to modify Gran Turismo sooo....?)

Anyway, Eran, i think it would be better (and more cool) if you make the colour of the
height data canvas the same dark grey as the slope graph. And make the surrounding
white into a lighter version of that dark grey. So it would look like a menu in GT.
That would also mean changing the font colour into white or light grey.
Also also, the line for original height data appears either too thin or too transparent.
We haven't modified Gran Turismo in any way, shape or form, it is still the same GT6 you can buy today (albeit 25gig of updates).
I see what we do as the same thing when a 3rd party creates a new track for PC driving sims when the original developers don't include a certain track that the players want.
I see no harm in it, infact when done in a professional manner it can increase the replay value of any game. :)

Edit: However if modding the game was allowed & encouraged, I'm pretty damn sure the first thing that alot of people would do is replace all the engine sound files :)
 
Last edited:
From page 17:

And no, so far i didn't see anyone post a comment saying that they replicated Seattle circuit.
Seattle should be easy to make with what we have at our disposal. I would do it if I had a computer to download the tools. The only thing that would be off would be the scenery
 
Big update for the TED Editor, as always download here: https://github.com/tarnheld/ted-editor
  • added a Banking Editor, opens up in new Window when pressing key 'b'
  • embedded @eran0004's Elevation Editor (thanks a lot! :bowdown:), opens up when pressing key 'e'
  • both editors save the data when closing the window, this takes you back to track modification mode
  • both editors show the position where you are modifying by a black circle in the track window
  • imported height data is now preserved as long as you don't modify the track
  • If you modify the track, only affected segments get their height data recalculated
Banking transitions seem to go from the segment banking angle (change by dragging the dark blue line) given to the angle midpoints between the angle of a segment and the next resp. previous, all over the given transition lengths (change by dragging the end points). The banking is still strange on straights, the transition lengths seem not to work correctly there. Watch out, you can make the banking angle up to 180 degree or more, but you have to adjust heights too to make some form of barrel roll, haven't succeeded on this one.

The height calculation is still different from PD's heights, so there are height jumps when modifying, but with @eran0004's Editor it's a breeze to smoothen it out. Plus if you open the Banking or Height Editor there is a small circle moving along the track to show you where you are editing.

I have added @eran0004's editor in my repo for the moment as we work out the changes to make it embeddable and still working standalone. There is a problem with resizing atm, but i'm sure there is an easy fix. Thanks a lot @eran0004 for letting me embed the editor!

In case i haven't done already: Thanks to all contributors and TED dissectors that made this editor possible: @Razerman, @PR1VATEJ0KER, @Outspacer, @eran0004, @Mr Grumpy (thanks for the Road and Deco descriptions, hope to use it soon...) and all i forgot. Tell me if you want me to add attribution of your work in my code in case i forgot, will definitely add a big About Box naming all contributors when i'm done. :bowdown:

There might be bugs lurking, as i have cleaned up and restructured a lot, but for banking and height retouching it should be ok. The roadblocks on the path to tackle the road and decoration geometry seems now out of the way, so i hope to present you a standalone TED creation tool Soon... :D
 
Big update for the TED Editor, as always download here: https://github.com/tarnheld/ted-editor
  • added a Banking Editor, opens up in new Window when pressing key 'b'
  • embedded @eran0004's Elevation Editor (thanks a lot! :bowdown:), opens up when pressing key 'e'
  • both editors save the data when closing the window, this takes you back to track modification mode
  • both editors show the position where you are modifying by a black circle in the track window
  • imported height data is now preserved as long as you don't modify the track
  • If you modify the track, only affected segments get their height data recalculated
Banking transitions seem to go from the segment banking angle (change by dragging the dark blue line) given to the angle midpoints between the angle of a segment and the next resp. previous, all over the given transition lengths (change by dragging the end points). The banking is still strange on straights, the transition lengths seem not to work correctly there. Watch out, you can make the banking angle up to 180 degree or more, but you have to adjust heights too to make some form of barrel roll, haven't succeeded on this one.

The height calculation is still different from PD's heights, so there are height jumps when modifying, but with @eran0004's Editor it's a breeze to smoothen it out. Plus if you open the Banking or Height Editor there is a small circle moving along the track to show you where you are editing.

I have added @eran0004's editor in my repo for the moment as we work out the changes to make it embeddable and still working standalone. There is a problem with resizing atm, but i'm sure there is an easy fix. Thanks a lot @eran0004 for letting me embed the editor!

In case i haven't done already: Thanks to all contributors and TED dissectors that made this editor possible: @Razerman, @PR1VATEJ0KER, @Outspacer, @eran0004, @Mr Grumpy (thanks for the Road and Deco descriptions, hope to use it soon...) and all i forgot. Tell me if you want me to add attribution of your work in my code in case i forgot, will definitely add a big About Box naming all contributors when i'm done. :bowdown:

There might be bugs lurking, as i have cleaned up and restructured a lot, but for banking and height retouching it should be ok. The roadblocks on the path to tackle the road and decoration geometry seems now out of the way, so i hope to present you a standalone TED creation tool Soon... :D

Really impressive stuff! Being able to see where you are editing the elevation for is huge let alone all of the other goodness in this update.

Sebring bump test is going pretty well, though I think more height points are needed the existing ones make for a drastic improvement over the original. tarnheld I do seem to have run into a bug however. It seems like the elevation editor is only picking up 1/3 of the track when using the included version, standalone version is fine.

eran0004 Can you look into adding a feature that will raise or lower the entire track by x amount via dialog box we can enter a value in?
 
Last edited:
@NingDynasty dialog boxes and a translate command added!

Changes in 1.0.8:

Transform commands:
  • Translate was added to the transform commands. This feature raises / lowers the entire track by an amount specified by the user (enter a positive value to raise, and a negative to lower).

  • The Flatten command had its name changed to Contrast, since it now multiplies the height data by an amount specified by the user (enter 0 to make the track flat). Negative values will flip the track so that uphills become downhills and vice versa.

  • The user can now specify the settings for the Smoothen and Roughen commands:
    • Smoothen works by first splitting the height data in a number of segments based on the slope. Then each segment is flattened and finally the corners between all the segments are rounded. The settings for Smoothen are:
      • Delta slope tolerance: The slope variation that is allowed within a segment. If the tolerance is exceeded, the segment ends there and a new segment is created.
      • Min segment length: The smallest number of height data points that can be in a segment (regardless of their slope).
      • Max segment length: The greatest number of height data points that can be in a segment. When this number is reached, the segment ends and a new segment is started.
    • Roughen works by generating a random floating point number between 0 and 1 for every height data point. The number is then raised by an exponent to determine the final factor. This factor is then multiplied by a magnitude to determine the final elevation change for this specific height point. The settings for Roughen are:
      • Potencia: This is the exponent used to raise the factor. Since the factor is a floating point between 0 and 1, all the values at 0 and 1 are preserved (0^n = 0; 1^n = 1) but the ranges in between are either pushed towards 0 (if the exponent is greater than 1) or pushed towards 1 (if the exponent is between 0 and 1). Use a high value for Potencia if you want mostly small bumps, and a low value if you want mostly big bumps. An exponent of 0 will force all the values to be 1, and a negative exponent will probably turn your track into a disaster zone, so I'd advice against that...
      • Magnitude: This is the size of the bumps. The size is multiplied by the factor for each bump to determine the final size.
      • Variation: This determines the chance to randomly generate a 0 or a 1. A variation of 10 means that the chance is 1/10 to generate a 0 and 1/10 to generate a 1. A variation of 1000 means that the chance is 1/1000, etc. Since 1 and 0 are the only factors that remains unchanged by the exponent, the variation can be used to specify how common the biggest bumps will be.
Other changes:
  • The feather options were added as radiobuttons to the Brush Data panel, for increased visibility and quicker access.

  • A list of commands were added to the left panel.

  • The scrollbars are now connected to the horizontal and vertical rulers (yes, I kind of missed that earlier...)

  • A number of obsolete functions were removed from the transformations.py script.

108.png
 

Attachments

  • elevation editor 1.0.8.zip
    11.7 KB · Views: 26
Last edited:
Back