Stunts Forum

Stunts - the Game => Stunts Related Programs => Topic started by: Duplode on July 30, 2013, 08:29:12 AM

Title: stunts-cartography - vectorial track visualization tools
Post by: Duplode on July 30, 2013, 08:29:12 AM
Back in February, when we were discussing automated replay logging (http://forum.stunts.hu/index.php?topic=2862.0), at some point I mentioned the Micro Machines-style video of the Z70 winning lap was done using a vectorial track viewer. Thanks to a stroke of good fortune, I am now able to make available a very rough preview of that viewer. The most interesting thing about it is that there are rendering parameters, as you can see in the attached screenshot. You can, for instance, generate images of different sizes, or adjust the proportions according to which the key track elements are drawn.

The links to the files are provided below. Before that, usage instructions for those of you who wish to test it:

And now, the links:
Windows executable bundle  (https://bitbucket.org/duplode/stunts-cartography/downloads/stunts-cartography-0.4.0.1-win32.zip)(updated in 2014-02-23)
Source code repository (https://bitbucket.org/duplode/stunts-cartography) (Mercurial)

Incidentally, by digging into the repository you can figure out how that Z70 animation was generated. The really tricky parts related to getting the lap data from DOSBox are, of course, obsolete thanks to dstien's restunts-powered logger. In any case, I will at some point add support for overlaying lap traces to the viewer. I also plan to create an annotation system - that is, overlaying cars, icons, split markers, etc. over the map.

Feedback appreciated, as ever  :)

Edit: the link will keep being updated to point at the latest Windows bundle.
Edit 2: the repository was moved to bitbucket.
Title: Re: stunts-cartography - vectorial track visualization tools
Post by: CTG on July 30, 2013, 08:33:22 AM
W O W ! ! !   :o  :o  :o  :o  :o

Damn, I have to wait ~10 hours before trying!  >:(
Title: Re: stunts-cartography - vectorial track visualization tools
Post by: Duplode on July 30, 2013, 08:09:22 PM
I just managed to run the Windows build under Windows only to realize it is not working due to a few missing data files of the interface library  >:( I will try to fix it ASAP... Edit: now fixed.
Title: Re: stunts-cartography - vectorial track visualization tools
Post by: zaqrack on July 30, 2013, 10:00:50 PM
wow wow wow . please fix :)
Title: FIXED: stunts-cartography
Post by: Duplode on July 31, 2013, 05:04:24 AM
wow wow wow . please fix :)

This should work: http://scr.stunts.hu/files/outrascoisas/stunts-cartography-20130731.zip . By the way, in the first post I had originally told you to navigate to http://0.0.0.0:10000 to open the interface, but that doesn't work on Windows - go to http://localhost:10000 instead.
Title: Re: stunts-cartography - vectorial track visualization tools
Post by: Chulk on July 31, 2013, 06:48:02 AM
[...]build under Windows [...] is not working

I had originally told you to navigate to http://0.0.0.0:10000 to open the interface, but that doesn't work on Windows
You might want to make your Windows sabotage a bit less obvious...
Title: Re: stunts-cartography - vectorial track visualization tools
Post by: CTG on July 31, 2013, 07:52:55 AM
It's a revenge on Microsoft. :D
Title: stunts-cartography - NEW VERSION of vectorial track visualization tools
Post by: Duplode on August 10, 2013, 07:15:32 AM
I have just prepared a second preview build of the stunts-cartography track viewer, with quite a few niceties for you to play with:
Download link: http://scr.stunts.hu/files/outrascoisas/stunts-cartography-latest.zip
Usage instructions remain the same given in the first post.

Waiting for your opinions!  :) As usual, I couldn't test in a real Windows system, so please let me know if it doesn't work for you.
Title: Re: stunts-cartography - vectorial track visualization tools
Post by: Duplode on August 14, 2013, 05:44:39 AM
I also plan to create an annotation system - that is, overlaying cars, icons, split markers, etc. over the map.

First tests with track map annotations are being done as we speak. A new release with initial support for them is likely within this week(end)...
Title: Re: stunts-cartography - vectorial track visualization tools
Post by: Duplode on August 25, 2013, 06:59:48 PM
I delayed the next preview release of stunts-cartography because I needed to reorganize the code a bit so that I wouldn't get lost in it as I added the new features. In any case, the announced annotations feature is already working in the latest development version. So that you don't think I am making up vaporware, annotation support means that there will be a text box in which you type a few instructions like these:

Car @6.5 13 ^270 #lightgray "Chulk"{#gray}
Split 2 @5 11 ^N *3

And get something like this as output:
(http://i49.photobucket.com/albums/f283/Duplode/sc-track-viewer-ann-teaser-2.png)
I should be able to get a new Windows release with that and some other improvements later this week, so stay tuned.
Title: Re: stunts-cartography - vectorial track visualization tools
Post by: Friker on August 27, 2013, 04:45:59 PM
What have I missed?! WOW! :) This looks great.
Title: Return of the Micro Machines: stunts-cartography 0.3.0.0
Post by: Duplode on September 01, 2013, 11:55:38 AM
No more delays: the third release of stunts-cartography is now available! The big new feature this time is, as previously announced, initial support for annotations. In practice, that means you can decorate your track maps with labelled cars, lines and section markers without needing an image editor. There were also a few improvements to the interface, plus several others under the hood. Waiting for your comments - I will particularly appreciate feedback on whether the commands for setting up the annotations are convenient or annoying (they are explained, with some examples, in a help page accessible from the program). And of course, as usual I need you to tell me whether the Windows build works in a real Windows or not  :)

Links
Win32 executable: https://bitbucket.org/duplode/stunts-cartography/downloads/stunts-cartography-0.3.0.0-win32.zip
Source code repository (I moved it since the last release): https://bitbucket.org/duplode/stunts-cartography
Title: Re: stunts-cartography - vectorial track visualization tools
Post by: CTG on November 22, 2013, 08:22:39 AM
How many different cars can you handle for the same track? (it would be nice to put the Top Gear replays together - of course only when all of them are already published)
Title: Re: stunts-cartography - vectorial track visualization tools
Post by: Duplode on November 24, 2013, 04:17:36 AM
How many different cars can you handle for the same track? (it would be nice to put the Top Gear replays together - of course only when all of them are already published)

There is no hard limit. We might run into RAM consumption issues by trying really hard, but I believe even 30 cars would be fine. Your idea sounds perfectly feasible; the main issue to consider probably being distinguishing the cars cleanly. As there won't be enough good distinct colours, we will have to resort to captions (and work out how to keep them legible). Overlapping cars might become an annoyance as well, but it would be easy to e.g. replace the default car picture with a bare rounded rectangle outline.

The next version of Cartography, with lap trace and flipbook support, is currently in the "first 90% done" stage: things generally work, but a significant amount of polish is needed before the release. I will resume work on it over the following days in order to, hopefully, get it ready by the time the Z149 LTB counter is started.
Title: Re: stunts-cartography - vectorial track visualization tools
Post by: Duplode on December 02, 2013, 10:47:45 PM
I will resume work on it over the following days in order to, hopefully, get it ready by the time the Z149 LTB counter is started.

Make that Z150. Sorry  ::)
Title: ZCT 149 is an awful track!
Post by: CTG on December 06, 2013, 08:29:18 AM
How precise is the game in re-generating the coordinates of your cars? Does it calculate only with 1/1024 part of each squares or any fractional numbers are possible? I mean: is it possible that my car seems to be exactly in the middle of the road (midpoint is 512-512 units from left and right side of the square), but in real it's 511.95346 and 512.04654?
Title: Re: stunts-cartography - vectorial track visualization tools
Post by: Duplode on December 06, 2013, 10:25:54 PM
How precise is the game in re-generating the coordinates of your cars? Does it calculate only with 1/1024 part of each squares or any fractional numbers are possible?

The car state data used for the physics calculations (and Cartography traces) holds the coordinates in 32-bit integers, each unit being 1/65536 (1/2^16) of a tile. Not arbitrary precision, but a lot higher than that of the graphics coordinates, and so what you describe does happen. The game also keeps the coordinates in 1/1024ths of a tile, presumably for updating the graphics. I don't know/remember which set of coordinates is used for path and penalty detection, though...
Title: Re: stunts-cartography - vectorial track visualization tools
Post by: CTG on December 09, 2013, 08:22:57 PM
Win32 executable: https://bitbucket.org/duplode/stunts-cartography/downloads/stunts-cartography-0.3.0.0-win32.zip

Norton Internet Security says "SONAR Heuristic 112" danger for that download... :-\
Title: Re: stunts-cartography - vectorial track visualization tools
Post by: dreadnaut on December 09, 2013, 09:41:43 PM
There's still people with Norton installed?! Was it there when you bought the computer and forgot to remove it?

Go, time to uninstall it: you're old enough to use a computer without (deflated) training wheels.
Title: Re: stunts-cartography - vectorial track visualization tools
Post by: Duplode on December 09, 2013, 11:00:23 PM
Win32 executable: https://bitbucket.org/duplode/stunts-cartography/downloads/stunts-cartography-0.3.0.0-win32.zip

Norton Internet Security says "SONAR Heuristic 112" danger for that download... :-\

Must be a false positive. Norton doesn't have the grace to explain what that heuristic means in their knowledge base, but I wouldn't put beyond it being scared by web server launching.
Title: Re: stunts-cartography - vectorial track visualization tools
Post by: zaqrack on December 10, 2013, 06:59:29 AM
Win32 executable: https://bitbucket.org/duplode/stunts-cartography/downloads/stunts-cartography-0.3.0.0-win32.zip

Norton Internet Security says "SONAR Heuristic 112" danger for that download... :-\

damn we are busted. that was a virus coded by Duplode to fetch RPL files from all who install the cartography tool :)
Title: Re: stunts-cartography - vectorial track visualization tools
Post by: CTG on December 11, 2013, 03:36:56 PM
Another question: what does define your / your opponent's exact starting position? The replay file or the game engine? I know, the replay also defines the track (and the start/finish line), but I mean the left or right lane.
Title: Re: stunts-cartography - vectorial track visualization tools
Post by: Duplode on December 11, 2013, 06:53:02 PM
Another question: what does define your / your opponent's exact starting position? The replay file or the game engine? I know, the replay also defines the track (and the start/finish line), but I mean the left or right lane.

The engine. The replay file does not contain coordinates, only keystrokes. I don't think we got to pinpoint exactly where the starting offset from the centreline is applied during the 2010 restunts studies, but I guess it wouldn't be too difficult to find out.
Title: Re: stunts-cartography - vectorial track visualization tools
Post by: Duplode on February 16, 2014, 07:30:15 AM
I finally brought myself to do some work on Cartography. This time I won't dare to announce a release date; however, I am quite optimistic after working around (https://bitbucket.org/duplode/stunts-cartography/commits/99554e03d1a78f1679d4d5e23b567fa06970a9b1) the most annoying issue standing in the way of the 0.4 release. Other good news include that a recent new version of the drawing library gave us a noticeable speedup (up to 30% in some cases), and that some technical adjustments are making the annotations/lap trace code a lot less repulsive.
Title: Stunts Cartography 0.4 released!
Post by: Duplode on February 23, 2014, 06:53:32 AM
Stunts Cartography 0.4.0.0 is now available! New stuff includes:
As of now, it is possible to generate a video animation of one or several replays, like the Z147 one I prepared a while ago (http://www.youtube.com/watch?v=eaGYBrxrHmA), using just the tools mentioned above (repldump, repldump2carto and the track viewer) plus a video tool like FFmpeg to combine the PNG frames into a video. The provided documentation (README.txt, REPLDUMP.txt and the annotations help page linked from the track viewer) explains in broad strokes the necessary steps; if you have any doubts or would like a proper tutorial, just ask here.

Links
Win32 executable: https://bitbucket.org/duplode/stunts-cartography/downloads/stunts-cartography-0.4.0.1-win32.zip
Source code: https://bitbucket.org/duplode/stunts-cartography

Technical note: You will need a reasonably recent version of your browser for the track viewer to run (Firefox 11+, Chrome 16+, Internet Explorer 10+).

Looking forward for your opinions and suggestions. Enjoy!

Edit: The donwload link now points at the 0.4.0.1 zip. The bugfix release was needed due to a subtle bug which led flipbook zips created on Windows to look wonky on Linux.
Title: Re: stunts-cartography - vectorial track visualization tools
Post by: RacerBG on March 20, 2014, 09:58:45 PM
I have followed this from a long time and I think that the progress is great! Keep up with the excellent work and happy racing! :)
Title: Re: stunts-cartography - vectorial track visualization tools
Post by: Duplode on March 21, 2014, 03:02:44 AM
I have followed this from a long time and I think that the progress is great! Keep up with the excellent work and happy racing! :)

Thank you :) I do not have concrete plans for a new release at the moment, though there are a few features I would like to add eventually, such as independent captions (by "independent" I mean not attached to a car).