The International Simutrans Forum

Development => Patches & Projects => Topic started by: hreintke on January 13, 2013, 11:23:55 AM

Title: Exporting gamedata (vehicles and other)
Post by: hreintke on January 13, 2013, 11:23:55 AM
LS,

I made a "proof of concept" patch which enables the export of all vehicle data to a csv file and which can be expanded to other "bauers" like roads, factories and other.

I do not yet understand the gui code enough to be able to add buttons etc. That is why I piggybacked to the "save game" button.

If you save the game, it also exports a file simu_gamedata.zip which includes a file simu_gamedata which is the actual export.
See the attachment for the export from my pak64+addons game.

I made this because I read several time people asking for "what is in a pakset".
Altough this does not directly this, you can open a game with any pakset/addon you wish and get the data.

Can you look at this patch and comment on usage and implementation ?

Herman
Title: Re: Exporting gamedata (vehicles and other)
Post by: Ters on January 13, 2013, 02:01:39 PM
Do the people asking "what is in a pakset" know what to do with CSV files? I'd expect a PDF would be more suited for those kinds of questions, as it can also show an image of the vehicles. CSV is more suited for analyses, which there is also a demand for.
Title: Re: Exporting gamedata (vehicles and other)
Post by: wlindley on January 13, 2013, 02:39:23 PM
CSV may be easily opened with LibreOffice or any other spreadsheet... much more useful (and simpler) than  PDF.

Although some pak-analysis might be better done by parsing the .dat files from which the paks are made, this approach could be most excellently used to save data about the game, or even to write the elusive "pak-set de-compiler" ...!
Title: Re: Exporting gamedata (vehicles and other)
Post by: Ters on January 13, 2013, 03:27:35 PM
Quote from: wlindley on January 13, 2013, 02:39:23 PM
CSV may be easily opened with LibreOffice or any other spreadsheet... much more useful (and simpler) than  PDF.

I know. You know. That doesn't mean most people know. A CSV inside a zip in some directory might be difficult enough. Having Simutrans open the file in the associated program would be helpful to them. I still think images would be a big plus.
Title: Re: Exporting gamedata (vehicles and other)
Post by: VS on January 13, 2013, 05:00:53 PM
Would there be a huge demand for this ("illustrated") kind of data? I have some collections of scripts that can do reports like this from sources. This documentation could be packed with the sets.
Title: Re: Exporting gamedata (vehicles and other)
Post by: Ters on January 13, 2013, 05:12:30 PM
Huge might be an exaggeration, but it could add some value. Players of the railway buff (or similar for road, air, sea) type would perhaps also like it if vehicles had short descriptions like buildings and attractions have, especially for paks with proper vehicles, unlike the half-real half-fictional vehicles in pak64.
(I also have a utility for making reports, but from the compiled files.)
Title: Re: Exporting gamedata (vehicles and other)
Post by: hreintke on January 13, 2013, 05:35:59 PM
Positive on this option is

1/ the "do not need to install any addtional software/scripts".

That makes it available for every non-technical player too.
Location and naming of the export file(s) can be made configurable. 

I saw a comment in the source "text mode no longer supported." but it would also be possible to export csv files directly instead on covered in zip file.

2/ Game specific export

It shows what is cofigured in your game. combinig the initial pakset and all addons which adds/removes specific items.

Herman
Title: Re: Exporting gamedata (vehicles and other)
Post by: VS on January 13, 2013, 06:29:19 PM
We have access to this kind of data easily. That said, people with less knowledge/power could find this very useful. Having a zipped csv enables processing in Excel etc, which are understood by far bigger user base than general computing and text manipulation (I believe).

Personally: The data is static and could be fetched earlier. This feels pointless. But perhaps it is just a programmer/power user feeling that it is not "right" to compile, load and then export the data when there can be only one step (overoptimization? :D ). And having it in game means that users do not need another program.

In the end... why not.
Title: Re: Exporting gamedata (vehicles and other)
Post by: prissi on January 13, 2013, 09:53:30 PM
Most of those data is even show on loading with debug level 3 ...
Title: Re: Exporting gamedata (vehicles and other)
Post by: hreintke on January 14, 2013, 09:46:04 PM
LS,

OK, no problem.
I keep this in my personal patch library for own usage.

Up to next experience.

Herman
Title: Re: Exporting gamedata (vehicles and other)
Post by: greenling on January 14, 2013, 09:51:35 PM
hreintke
A tool how can copy the Data from Vehiclepakfiles in a Textfiles it very useful.
Title: Re: Exporting gamedata (vehicles and other)
Post by: dennosius on January 23, 2013, 01:01:02 PM
What would be really useful in my eyes is a tools that illustrates vehicle timelines by loadtype and waytype, for example a timeline of all passenger road vehicles or all railway oil vehicles. This would make gaps in the timeline better visible.
Title: Re: Exporting gamedata (vehicles and other)
Post by: VS on January 23, 2013, 02:10:45 PM
In that case:

pak128 svn -> tools -> timeline-veh.py (or something similar)

IIRC I made it accept goods filters and such...