The International Simutrans Forum

 

Author Topic: Auto-generated documentation from dat files  (Read 5967 times)

0 Members and 1 Guest are viewing this topic.

Offline VS

  • Senior Plumber (Devotee)
  • Devotee
  • *
  • Posts: 4855
  • Vladimír Slávik
    • VS's Simutrans site
  • Languages: CS,EN
Auto-generated documentation from dat files
« on: January 16, 2013, 02:15:55 PM »
Here is a proof of concept script for generating documentation from pakset sources, and its output. I will definitely continue work on this!

https://dl.dropbox.com/u/63534647/pakdocs-ways-pak128.7z

Offline Combuijs

  • Web Team
  • Devotee
  • *
  • Posts: 1391
  • Maintainer of maps.simutrans.com
    • Combuijs
  • Languages: EN, NL
Re: Auto-generated documentation from dat files
« Reply #1 on: January 16, 2013, 02:26:39 PM »
Nice!

(You almost want to edit the values immediately, which of course is not possible...)

Offline HDomos

  • *
  • Posts: 153
  • Languages: EN, DE, FR, HU
Re: Auto-generated documentation from dat files
« Reply #2 on: January 16, 2013, 02:40:32 PM »
Wow this is good :) The tram tracks aren't in the overview mode though...

Offline VS

  • Senior Plumber (Devotee)
  • Devotee
  • *
  • Posts: 4855
  • Vladimír Slávik
    • VS's Simutrans site
  • Languages: CS,EN
Re: Auto-generated documentation from dat files
« Reply #3 on: January 16, 2013, 02:46:18 PM »
That's because for some reason they still have the old-style dat (wt=track, system_type=7). If you take a better look, there will be lots and lots of these little quirks...

Offline mEGa

  • 2D painter
  • Devotees (Inactive)
  • *
  • Posts: 1041
  • Pak128 graphics
    • mEGa_Simutrans
  • Languages: FR, EN, ru
Re: Auto-generated documentation from dat files
« Reply #4 on: January 16, 2013, 08:04:00 PM »
Great ! it's a precious tool I mean


Offline Sarlock

  • Devotee
  • *
  • Posts: 1340
  • Languages: EN
Re: Auto-generated documentation from dat files
« Reply #5 on: January 17, 2013, 01:54:47 AM »
Wow, very useful tool!  I love it!

Offline VS

  • Senior Plumber (Devotee)
  • Devotee
  • *
  • Posts: 4855
  • Vladimír Slávik
    • VS's Simutrans site
  • Languages: CS,EN
Re: Auto-generated documentation from dat files
« Reply #6 on: January 17, 2013, 06:13:07 PM »
I have added stations and extensions to the report. (Not attached anywhere.)

Next up are vehicles. However, there is a "small" problem. Vehicles can be sorted filtered by waytype, or goods, or both, and to complicate things a bit more, usually there are engine-only units (locomotives, tractors, tugs...) which may be interesting to see along with a specified goods type.

So, I can have a 3-dimensional matrix of static tables, with goods, waytype, and with or without pushers. But... Is that the right way to approach this? Do you think such type of organization will be good?

I could probably go the other way round, only sanitize the data in Python, and partially generate the actual reports browser-side. Less data duplication, but yet more coding in three (or four?) layers.

Comment please :)
« Last Edit: January 17, 2013, 06:23:53 PM by VS »

Offline VS

  • Senior Plumber (Devotee)
  • Devotee
  • *
  • Posts: 4855
  • Vladimír Slávik
    • VS's Simutrans site
  • Languages: CS,EN
Re: Auto-generated documentation from dat files
« Reply #7 on: January 19, 2013, 10:56:31 PM »
Well! This warrants a doublepost:

Vehicle parsing works, and the unholy waytype-goodtype matrix is temporally stable along all unfolded dimensions :P Wait with the fireworks, though, there are still many stupid bugs littered through the code for images. The generated output is simply bigger than what I am willing to upload, so here's at least the updated yet buggy script instead...

TODO:
1) gfx bug hunt
2) alpha release of script + docs for paksets
3) fireworks ;)
4) vehicle constraints in details
5) translations
6) factories and goods

Offline Sarlock

  • Devotee
  • *
  • Posts: 1340
  • Languages: EN
Re: Auto-generated documentation from dat files
« Reply #8 on: January 20, 2013, 08:07:54 PM »
Awesome, VS!
Is the finished HTML able to be hosted on the pak128 web space?  It's a great resource... I've built some hand-made Excel spreadsheets for this exact same purpose, it would be so wonderful to have a way to generate that data directly from the DAT files and be able to updated whenever required.

Offline VS

  • Senior Plumber (Devotee)
  • Devotee
  • *
  • Posts: 4855
  • Vladimír Slávik
    • VS's Simutrans site
  • Languages: CS,EN
Re: Auto-generated documentation from dat files
« Reply #9 on: January 20, 2013, 09:45:36 PM »
Well, alpha 1 is ready!

script (16 kB)
archive (1.7 MB)
online version

Offline IgorEliezer br

  • Devotee
  • Administrator
  • *
  • Posts: 4072
  • Cake recipes are cool... REALLY!
    • Igor Eliezer Architect and Urban Planner/Arquiteto e Urbanista
  • Languages: PT, EN, AutoLISP, Python
Re: Auto-generated documentation from dat files
« Reply #10 on: January 21, 2013, 03:08:11 AM »
It's wonderful! No wonder why I'm learning Python.

Offline mEGa

  • 2D painter
  • Devotees (Inactive)
  • *
  • Posts: 1041
  • Pak128 graphics
    • mEGa_Simutrans
  • Languages: FR, EN, ru
Re: Auto-generated documentation from dat files
« Reply #11 on: January 21, 2013, 11:00:53 AM »
Very good work ! Brillant.

Offline Sarlock

  • Devotee
  • *
  • Posts: 1340
  • Languages: EN
Re: Auto-generated documentation from dat files
« Reply #12 on: January 21, 2013, 03:39:32 PM »
This is very nice... very well done!  Good job on the 3-D sorting logic.

Offline VS

  • Senior Plumber (Devotee)
  • Devotee
  • *
  • Posts: 4855
  • Vladimír Slávik
    • VS's Simutrans site
  • Languages: CS,EN
Re: Auto-generated documentation from dat files
« Reply #13 on: January 23, 2013, 05:52:26 PM »
Fortunately it is not 3D, I gave up on the 3rd dimension. That would have been a bit too much. This way, you can always open the list of engines in another tab...

I just found that some of Fabio's ways break, which means they use offsets. Well. Back to coding!

Offline VS

  • Senior Plumber (Devotee)
  • Devotee
  • *
  • Posts: 4855
  • Vladimír Slávik
    • VS's Simutrans site
  • Languages: CS,EN
Re: Auto-generated documentation from dat files
« Reply #14 on: January 26, 2013, 09:05:25 PM »
ARGH! I am so obsessed with this, I can't stop...

new TODO list:
* vehicle constraints
* ???
* economy - goods and factory
* more interlinking
* pretty output - dates as dates, capacity as "x units of y", translating all texts, etc.

Offline VS

  • Senior Plumber (Devotee)
  • Devotee
  • *
  • Posts: 4855
  • Vladimír Slávik
    • VS's Simutrans site
  • Languages: CS,EN
Re: Auto-generated documentation from dat files
« Reply #15 on: January 28, 2013, 08:31:03 PM »
New version of documentation with vehicles. Please comment - what would be a better layout, what data do you want to see in this?

Script is in svn since forever (or so it seems)...

Offline mEGa

  • 2D painter
  • Devotees (Inactive)
  • *
  • Posts: 1041
  • Pak128 graphics
    • mEGa_Simutrans
  • Languages: FR, EN, ru
Re: Auto-generated documentation from dat files
« Reply #16 on: January 31, 2013, 02:35:32 PM »
For me it is perfect !