The International Simutrans Forum

 

Author Topic: TOOL - Pak analyzer  (Read 3670 times)

0 Members and 1 Guest are viewing this topic.

Offline Milko

  • Devotee
  • *
  • Posts: 828
TOOL - Pak analyzer
« on: January 15, 2014, 04:45:45 PM »
Hello

I 'm working on a tool that takes the source files of a pak and transforms them into an Excel spreadsheet .
This tool is very useful if you want to extract statistics from the massive pak .
This tool is still in its infancy but to me it was very useful for checking errors in pak , I do not know if it works with the locale as I tried it with only the Italian version .
To use it you must enable macros , launched the macro will need to select (then press ok) the folder where the files (*.dat) . The question " Cerco nelle sottocartelle", in English, is equivalent to "search subfolders" and enable the macro to scan all subfolders in the folder specified initial.
The macro also creates a file " file.log " ( in the home folder you specified) in the file you'll find all the rows of the files inspected and you will be told whether or not the parameters indicated are recognized ( this is useful for identifying errors in text entry , for example when you miss a character or if it add one more ) , " Riconosciuto "= recognized, "NonRiconosciuto" = not recognized .
I am attaching the macro so that it can try and use, I do not assume responsibility for its use , I've used it several times without any problems . I am available (within the limits of the time I have available ) to improve it.
The macro is compatible with all pakset and not only with the britain.
Excuse me for English.
Giuseppe

Online jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 18393
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: TOOL - Pak analyzer
« Reply #1 on: January 15, 2014, 06:18:05 PM »
This looks very interesting! That must have taken a lot of effort, too.

Offline Milko

  • Devotee
  • *
  • Posts: 828
Re: TOOL - Pak analyzer
« Reply #2 on: January 16, 2014, 09:23:45 AM »
Hello

I am attaching an example of the results obtained.
This is the section of the air pak britain experimental, converted into a table. In addition to the excel file I put its log files.

Giuseppe

Online jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 18393
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: TOOL - Pak analyzer
« Reply #3 on: January 16, 2014, 10:26:33 AM »
That is one rather large spreadsheet! Very interesting indeed.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9409
  • Languages: De,EN,JP
Re: TOOL - Pak analyzer
« Reply #4 on: January 16, 2014, 10:31:28 AM »
Some listings and statistics can be also gained from the simutranslator ...

Offline The Hood

  • Moderator
  • *
  • Posts: 2889
  • pak128.Britain developer
Re: TOOL - Pak analyzer
« Reply #5 on: January 16, 2014, 08:47:31 PM »
Haven't had time to look at this properly but this looks like it could be really useful, especially for balancing projects. All we need now is something that can take the contents of the excel file and write out the dat files so you can import to excel, make changes, then export to dat quickly and easily. Should be easy enough with a VBA script?

Offline isidoro

  • Devotee
  • *
  • Posts: 1128
Re: TOOL - Pak analyzer
« Reply #6 on: January 16, 2014, 11:46:57 PM »
Just in case it can help: some times I am forced to work with spreadsheets, which I deeply and quite irrationally hate.  I use to read them (and possibly write to them) this Python package:

http://sourceforge.net/projects/pyexcelerator/

Once in Python, I can convert, modify, etc. the data without as much pain...


Online jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 18393
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: TOOL - Pak analyzer
« Reply #7 on: January 16, 2014, 11:57:37 PM »
What we really need is some sort of game that will take the data from the spreadsheet and let us play in a sort of simulated environment with these vehicles...

Offline Ves

  • Devotee
  • *
  • Posts: 1611
  • Languages: EN, SV, DK
Re: TOOL - Pak analyzer
« Reply #8 on: January 18, 2014, 05:50:47 PM »

What we really need is some sort of game that will take the data from the spreadsheet and let us play in a sort of simulated environment with these vehicles...


James, i started in excel a sheet where I tried to simulate income for vehicles. I looked in simuconf.cfg, goods.pak and other places to find all relevant input (that I could find) and created rules in the sheet. I set it up so I could easily make changes to see what would result. However the sheet is incomplete and I have probably missed something too.
If you want it I could send it to you. Since you know the game engine you maybe can complete it to an extent I can not :-)


Sent from my iPhone using Tapatalk

Online jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 18393
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: TOOL - Pak analyzer
« Reply #9 on: January 18, 2014, 06:03:12 PM »
Interesting. What exactly was your spreadsheet intended to do?

Offline Ves

  • Devotee
  • *
  • Posts: 1611
  • Languages: EN, SV, DK
Re: TOOL - Pak analyzer
« Reply #10 on: January 18, 2014, 06:21:04 PM »
I try to create pak.sweden eventually, and some month ago I decided to try a basic test balancing, or at least start to.
I don't precisely remember here on the go, but you write in the distance and some info on the vehicle, and it would calculate how much profit the vehicle would do. I also had plans to calculate the investment cost needed in vehicle and infrastructure and after that the ROI (return on investment) but it never made it so far.
I stopped working on it, when I realized you would change the passenger code.


Sent from my iPhone using Tapatalk

Online jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 18393
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: TOOL - Pak analyzer
« Reply #11 on: January 18, 2014, 06:32:37 PM »
Interesting. Ahh, yes, forthcoming changes might alter balance somewhat: see here for a discussion of that issue as applied to Pak128.Britain-Ex.

Offline Milko

  • Devotee
  • *
  • Posts: 828
Re: TOOL - Pak analyzer
« Reply #12 on: January 18, 2014, 07:39:52 PM »
Hello The Hood

Haven't had time to look at this properly but this looks like it could be really useful, especially for balancing projects. All we need now is something that can take the contents of the excel file and write out the dat files so you can import to excel, make changes, then export to dat quickly and easily. Should be easy enough with a VBA script?

I can update the macro to convert the sheet in *.dat file, but you would lose all the comments and any parameters that are not recognized.

Giuseppe