The International Simutrans Forum

PakSets and Customization => General Resources and Tools => Tools => Topic started by: VS on January 16, 2013, 02:15:55 PM

Title: Auto-generated documentation from dat files
Post by: VS 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
Title: Re: Auto-generated documentation from dat files
Post by: Combuijs on January 16, 2013, 02:26:39 PM
Nice!

(You almost want to edit the values immediately, which of course is not possible...)
Title: Re: Auto-generated documentation from dat files
Post by: HDomos on January 16, 2013, 02:40:32 PM
Wow this is good :) The tram tracks aren't in the overview mode though...
Title: Re: Auto-generated documentation from dat files
Post by: VS 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...
Title: Re: Auto-generated documentation from dat files
Post by: mEGa on January 16, 2013, 08:04:00 PM
Great ! it's a precious tool I mean

Title: Re: Auto-generated documentation from dat files
Post by: Sarlock on January 17, 2013, 01:54:47 AM
Wow, very useful tool!  I love it!
Title: Re: Auto-generated documentation from dat files
Post by: VS 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 :)
Title: Re: Auto-generated documentation from dat files
Post by: VS 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
Title: Re: Auto-generated documentation from dat files
Post by: Sarlock 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.
Title: Re: Auto-generated documentation from dat files
Post by: VS on January 20, 2013, 09:45:36 PM
Well, alpha 1 is ready!

script (http://128.simutrans.com/docs/test1/pakdoc-script.7z) (16 kB)
archive (http://128.simutrans.com/docs/test1/pakdocs.7z) (1.7 MB)
online version (http://128.simutrans.com/docs/test1/index.html)
Title: Re: Auto-generated documentation from dat files
Post by: Igorlizr on January 21, 2013, 03:08:11 AM
It's wonderful! No wonder why I'm learning Python.
Title: Re: Auto-generated documentation from dat files
Post by: mEGa on January 21, 2013, 11:00:53 AM
Very good work ! Brillant.
Title: Re: Auto-generated documentation from dat files
Post by: Sarlock on January 21, 2013, 03:39:32 PM
This is very nice... very well done!  Good job on the 3-D sorting logic.
Title: Re: Auto-generated documentation from dat files
Post by: VS 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!
Title: Re: Auto-generated documentation from dat files
Post by: VS 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.
Title: Re: Auto-generated documentation from dat files
Post by: VS on January 28, 2013, 08:31:03 PM
New version of documentation with vehicles. (http://128.simutrans.com/docs/test2/index.html) 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)...
Title: Re: Auto-generated documentation from dat files
Post by: mEGa on January 31, 2013, 02:35:32 PM
For me it is perfect !