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://github.com/duplode/stunts-cartography/releases/download/1.0.0.0/stunts-cartography-1.0.0.0-windows-x86_64.zip)(updated in 2022-01-30)
Source code repository (https://github.com/duplode/stunts-cartography)

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. Edit: these features, and quite a few others, were added in subsequent releases.

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, and then to Github.
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
Quote from: zaqrack on July 30, 2013, 10:00:50 PM
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
Quote from: Duplode on July 30, 2013, 08:09:22 PM
[...]build under Windows [...] is not working

Quote from: Duplode on July 31, 2013, 05:04:24 AM
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
Quote from: Duplode on July 30, 2013, 08:29:12 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
Quote from: 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)

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
Quote from: Duplode on November 24, 2013, 04:17:36 AM
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
Quote from: 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?

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
Quote from: Duplode on September 01, 2013, 11:55:38 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... :-\
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
Quote from: CTG on December 09, 2013, 08:22:57 PM
Quote from: Duplode on September 01, 2013, 11:55:38 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... :-\

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
Quote from: CTG on December 09, 2013, 08:22:57 PM
Quote from: Duplode on September 01, 2013, 11:55:38 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
Quote from: 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.

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
Quote from: 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! :)

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).
Title: Stunts Cartography 1.0.0.0 released!
Post by: Duplode on January 30, 2022, 03:13:30 PM
I'm happy to finally announce the release of Stunts Cartography 1.0.0.0! This version includes the new features I have used in Cartography videos and maps over the last year, and also fixes several major annoyances. Here is the Windows binary download link (https://github.com/duplode/stunts-cartography/releases/download/1.0.0.0/stunts-cartography-1.0.0.0-windows-x86_64.zip) (let me know if you need a Linux binary as well). To use it, put the stcarto directory into your Stunts folder, and run the stcarto executable from a command line. You can use stcarto --help (or stcarto viewer --help, etc.) for brief usage guidance, check the readme (https://github.com/duplode/stunts-cartography/blob/master/README.md) for more detailed notes, or ask anything about it here  :)

Here is a list of changes since the previous release:

Title: Re: stunts-cartography - vectorial track visualization tools
Post by: alanrotoi on January 30, 2022, 06:24:59 PM
It works in windows 7 64 bits version and Chrome ;)
Title: Re: stunts-cartography - vectorial track visualization tools
Post by: Cas on January 31, 2022, 12:33:21 AM
Hey!  That's lots of improvements!  Does the option of not depending on GTK or Cairo mean that a Linux binary would likely run out of the box on any Linux distro?  And about support for Bliss metadata, does it use it or just accept it?  If you need quick details on the text and binary overlaid and split formats, just let me know. It's pretty simple anyway.
Title: Re: stunts-cartography - vectorial track visualization tools
Post by: Duplode on January 31, 2022, 02:20:11 AM
Quote from: Cas on January 31, 2022, 12:33:21 AM
Does the option of not depending on GTK or Cairo mean that a Linux binary would likely run out of the box on any Linux distro?

Linux isn't really a problem on that front, as Linux systems generally have GTK available already. Windows was the main reason for providing those alternatives, as I wanted to have a backup plan if I couldn't get GTK to play nicely there. It did work out all right in the end, and the Windows binary I have uploaded uses Cairo. Though the other backends work perfectly well, there is one advantage to using Cairo: the SVG build can only generate SVGs, and the Rasterific one, only PNGs; the Cairo build, on the other hand, supports both output formats.

Quote from: Cas on January 31, 2022, 12:33:21 AM
And about support for Bliss metadata, does it use it or just accept it?  If you need quick details on the text and binary overlaid and split formats, just let me know. It's pretty simple anyway.

For now it just accepts the files, ignoring anything after the 1801th byte. Now that you mention it, I think it wouldn't be difficult to parse binary overlay metadata if available (this is the format (http://wiki.stunts.hu/index.php?title=Track_file#Bliss_binary_metadata_format), right?), and to print it to the log of the viewer GUI. One more feature for a future release  :)
Title: Re: stunts-cartography - vectorial track visualization tools
Post by: Cas on January 31, 2022, 06:41:49 AM
I think that most Linux distros will have GTK installed. No guarantee, but almost. KDE-based desktops, if I know well, use Qt instead, but surely some of the programs installed in the system must use GTK and upon installation, must have installed it as well as a dependency, so the odds are the binary will find GTK. On the other hand, if one were to compile it, my guess is that the development library would be missing, yet if the binary can run, that's enough.

Yes, that is the format. I have seen with the years that mostly the title and author's name end up being of any use. Other information is important only for the registry. In the tournament field, I usually specify what the track was made for, which championship, which race, etc. Maybe which car.
Title: Re: stunts-cartography - vectorial track visualization tools
Post by: Daniel3D on January 31, 2022, 08:11:43 AM
I try to get my head around it. So much  :D
I'll have a look at it soon.
Title: Re: Stunts Cartography 1.0.0.0 released!
Post by: dreadnaut on February 01, 2022, 11:44:25 PM
Quote from: Duplode on January 30, 2022, 03:13:30 PM
I'm happy to finally announce the release of Stunts Cartography 1.0.0.0!

Ooooh, congratulations!

Quote from: Duplode on January 30, 2022, 03:13:30 PM
Alternative two-tone terrain style, inspired by dreadnaut's 4DOPEN terrain editor.

To think that my little '96 experiment would have an effect, any effect! I'm quite proud ;D
Title: Re: Stunts Cartography 1.0.0.0 released!
Post by: Duplode on February 02, 2022, 02:00:35 AM
Quote from: dreadnaut on February 01, 2022, 11:44:25 PM
Quote from: Duplode on January 30, 2022, 03:13:30 PM
Alternative two-tone terrain style, inspired by dreadnaut's 4DOPEN terrain editor.

To think that my little '96 experiment would have an effect, any effect! I'm quite proud ;D

That streamlined style looks just right for certain tracks  :)

(https://i.imgur.com/WcBvHoj.png)
Title: Stunts Cartography 1.1.0.0 released!
Post by: Duplode on January 14, 2024, 03:08:47 AM
I'm happy to announce the release of Stunts Cartography 1.1.0.0! Here is the Windows binary download link (https://github.com/duplode/stunts-cartography/releases/download/1.1.0.0/stunts-cartography-1.1.0.0-windows-x86_64.zip) (let me know if you need a Linux binary as well). To use it, put the stcarto directory into your Stunts folder, and run the stcarto executable from a command line. You can use stcarto --help (or stcarto viewer --help, etc.) for brief usage guidance, check the readme (https://github.com/duplode/stunts-cartography/blob/master/README.md) for more detailed notes, or ask anything about it here!

Here is a list of changes since the previous release:


Title: Re: stunts-cartography - vectorial track visualization tools
Post by: Erik Barros on January 14, 2024, 05:05:47 AM
Thanks for the update, I still need to explore some features that I don't know how to use. What is the application for trackdata binary dumps?
Title: Re: stunts-cartography - vectorial track visualization tools
Post by: Duplode on January 14, 2024, 03:03:06 PM
Quote from: Erik Barros on January 14, 2024, 05:05:47 AMWhat is the application for trackdata binary dumps?

For the moment, none (though I think it wouldn't be difficult to make a repldump-like tool with the Restunts tools). One way to get them is using a debugger (IIRC Insight (https://www.bttr-software.de/products/insight/#downloads) and the DOSBox debugger (https://www.vogons.org/viewtopic.php?t=3944) should both be helpful enough here) to dump the relevant slice of memory. The information in the Wiki article (https://wiki.stunts.hu/wiki/Trackdata) can be used to find where the bytes that need to be dumped are -- though the article might benefit from being expanded a bit...
Title: Re: stunts-cartography - vectorial track visualization tools
Post by: Cas on January 14, 2024, 05:03:12 PM
Great to see a new version of Cartography! :)
Title: Re: stunts-cartography - vectorial track visualization tools
Post by: Erik Barros on January 22, 2024, 02:58:01 AM
Quote from: Duplode on January 14, 2024, 03:03:06 PM
Quote from: Erik Barros on January 14, 2024, 05:05:47 AMWhat is the application for trackdata binary dumps?

For the moment, none (though I think it wouldn't be difficult to make a repldump-like tool with the Restunts tools). One way to get them is using a debugger (IIRC Insight (https://www.bttr-software.de/products/insight/#downloads) and the DOSBox debugger (https://www.vogons.org/viewtopic.php?t=3944) should both be helpful enough here) to dump the relevant slice of memory. The information in the Wiki article (https://wiki.stunts.hu/wiki/Trackdata) can be used to find where the bytes that need to be dumped are -- though the article might benefit from being expanded a bit...

cool, thanks for the explanation. Maybe this will be useful for me in the future, I see the possibility of obtaining information from the game and using it to move a motorized cockpit, but I still need to study and delve into how the game works to make this work.
Title: Re: stunts-cartography - vectorial track visualization tools
Post by: Duplode on January 22, 2024, 05:23:12 AM
Quote from: Erik Barros on January 22, 2024, 02:58:01 AMI see the possibility of obtaining information from the game and using it to move a motorized cockpit, but I still need to study and delve into how the game works to make this work.

Now that's quite the project! 🤯 And yes, there's a fair amount of data which might be of use -- the car state data structure (which you can get from the repldump output), for instance, includes the steering wheel position. Here (https://github.com/duplode/stunts-cartography/blob/master/src/Dump/GameState.hs) is a (still quite incomplete -- I should get back to refining it at some point) description of the game state/car state layout in the Cartography sources.