News:

SimuTranslator
Make Simutrans speak your language.

Finances window: maintenance, profit, running costs... per each type of tranport

Started by jk271, February 26, 2011, 11:29:17 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

jk271

Hello, I am working on a patch that enables to see running costs, maintenance, profit, etc. per each type of transport:
monorail, train, tram, truck, ship, air, powerlines, others (warehose, posts, etc.).  I used departmentalisation from line management window.

I am running around 200 lines and it is hard to distinguish profit or loss of types of transport. Main motivation for writing patch was:
a)      find out powerline maintenance. --> Does my powerline make profit or loss?
b)      see profit/loss of tram transport (tram rail maintenance is quite height high).
c)      ...

This or something similar has been discussed here:
http://forum.simutrans.com/index.php?topic=1506.0
http://forum.simutrans.com/index.php?topic=6813.msg65858#msg65858

This patch is not ready for merging yet.

I would like to ask you a question:

* Where (in which category) should I include manglev?
 a) with monorail (in same tab as one type of transport)
 b) separate tab
 c) in "others" tab

This patch changes will change saved game structure, so some new features can be implemented too. (To minimize number of different saved game formats.)

* fixed (per time) maintenance costs of vehicles in money_frame
 (discussed here http://forum.simutrans.com/index.php?topic=1920.0 )

*toll - satelite system (no toll gates), not for citycars, only for player's vehicles
       - pay for distance cost = k*wehicle_weight*distance, where k is a parameter, e.g. 0.01c per tile per one tonne. If k is small, it should not affect pakset's setting. This feature could be easily disabled - set k=0.00c
       - it would make player to consider building his/her own roads instead of using public infrastructure
       (discussed here  http://forum.simutrans.com/index.php?topic=6404.0 and http://forum.simutrans.com/index.php?topic=6888.msg66398#msg66398 )

Feel free to add your comments.
                                         
P.S. This patch was made against d681184b83fb214dc60abc447ef1dfc8940f2bb8 (from 19.2.2011)

Dwachs

nice idea!

Quote from: jk271 on February 26, 2011, 11:29:17 PM
I am running around 200 lines and it is hard to distinguish profit or loss of types of transport. Main motivation for writing patch was:
a)      find out powerline maintenance. --> Does my powerline make profit or loss?
b)      see profit/loss of tram transport (tram rail maintenance is quite height).
To have some statistics for these questions is indeed very helpful.

Quote
* Where (in which category) should I include manglev?
  a) with monorail (in same tab as one type of transport)
  b) separate tab
  c) in "others" tab
(b) - you can look in gui/schedule_list.*, where the tabs are implemented for the line management window (you can even use the truck/train/etc symbols in the tabs).

The tabs in the line management window use the same instance of a list. After changing the active tab, the list gets refilled. You could use the same too: After changing active tab, only change the numbers to be displayed. This would reduce code duplication in you patch.

You use a lot of named constants COST_xx_ROAD etc. I think it would be better to have an array for these statistics indexed by waytype directly (with special treatment of powerline_wt).
Parsley, sage, rosemary, and maggikraut.

prissi

The top space in the window is already used for scenarios messages. Some other statistics (like the number of pas, mail, goods) is not shown, although those are recorded for some time. It would be very good if those things can be taken into account too, without exceeding 640x416 pixel size.

Probably the built headquarter tool needs to go away for those changes.

And you can easily check for the availability of certain modes of transport (like no costs, not transport, no number of cars) and only show tabs for the ones in use.

jk271

Quote from: Dwachs on February 27, 2011, 01:26:37 PM
(b) - you can look in gui/schedule_list.*, where the tabs are implemented for the line management window (you can even use the truck/train/etc symbols in the tabs).

The tabs in the line management window use the same instance of a list. After changing the active tab, the list gets refilled. You could use the same too: After changing active tab, only change the numbers to be displayed. This would reduce code duplication in you patch.
It is excellent suggestion! I do not know internal of source code of game well yet. I will have to explore line management more to find out how it works.

Quote from: prissi on February 27, 2011, 07:57:50 PM
The top space in the window is already used for scenarios messages. Some other statistics (like the number of pas, mail, goods) is not shown, although those are recorded for some time. It would be very good if those things can be taken into account too, without exceeding 640x416 pixel size.
Thank you for writing about messages. I have not known it. I also did not known exact dimension of window.

I would like to include statistics but I am not decided where to localize it in the window - between money and chart or in a new subtab. It would depend on place (rows that fit into the window).

I found extension request http://forum.simutrans.com/index.php?topic=6951.0 to consider - proceeds split up by passanger, mail, freight. I think, that freight categories are pack dependent so I would not split them up.

Quote from: prissi on February 27, 2011, 07:57:50 PM
Probably the built headquarter tool needs to go away for those changes.
I hope it would be let as it is.

Quote from: prissi on February 27, 2011, 07:57:50 PM
And you can easily check for the availability of certain modes of transport (like no costs, not transport, no number of cars) and only show tabs for the ones in use.
Good idea !

Thank for comments. It will take me some time to implement it.

IgorEliezer

Quote from: prissi on February 27, 2011, 07:57:50 PMProbably the built headquarter tool needs to go away for those changes.
Small idea: transfer "Build Headquarter" to "Special Construction" toolbar. It's not an issue since there already are "Found a new city" and other more expensive/non-essential tools.

BTW, topic renamed. :)

jk271

I
Quote from: IgorEliezer on March 10, 2011, 01:54:59 AM
Small idea: transfer "Build Headquarter" to "Special Construction" toolbar. It's not an issue since there already are "Found a new city" and other more expensive/non-essential tools.
Good idea. It's logical to have it in some other place. On the other hand I don't know how to make menus (and handle it too) from program (source code) yet. So I let HQ button unchanged (in tab 'all'). Patch is growing up (124KiB now) and it only one around half of work. Moving HQ button can be implemented in some another patch in future.

Edit: I omited that there is a picture of HQ on finance window. Space of  the picture of HQ might be needed for statistics of transported passenger, mail, goods and all.
New screenshot of finance window attached.

The Transporter


prissi

In one moves the scenario completion message to the status line (where it anyway should go, same as the month with minus warning) such a restructuring of the dialog would be good.

dom700

About the powerlines.
How are you supposed to identify how much money you make with them? Lets imagine the most basic beginning: An oil producer, a refinery and a petrol station as well as any kind of powerplant. If you connect the power plant to the petrol station you will loose money (most definately) for the power alone, but the needs for fuel go drastically up, adding lots of transports without any additional maintenance costs, except for vehicles.


jk271

Firstly I have apollogize for not replying for such a long time. The patch is quite huge and I was not sure whether I am able to finish it.


Since some time I have began to rewrite it from scratch and today you can see result.
Fortunately there are patches now. The first one (master1857_ ...) changes logics and can be applied without anything else. This patch is appliable to current master  branch (commit 1857c856... from 16 th December 2011).
The another one changes graphics and needs first one having applied.


I was not sure about comment of functions in cases when I copied a fuction from file money_frame.cc to file money_tab and when I changed the function. Some of these functions contained string "@author ..." and I was not sure what exactly do with this.


Feel free to change to code, rename variables to more suitable names, etc. I hope there are not many unnecessary changes introduced by patches.


The thing I am not happy about is size of a chart in the bottom. On the other hand I did not found better place for it.


I hope that this is final version from my side. I have tested it. And now it needs testing by someone more aware of simutrans source code.

Fabio

A few sparse thoughts

~ charts like this are little more than useless. They could be made resizable. If you can make the window bigger than default the chart will get bigger too. See new minimap on townhall details.

~ Chart shows only last 10-20 yrs. It could have more sub tabs with scale 1 month, 1 year, 3 years, 5 years, 10 years (showing up to 200 years).

~ Button to export financial data in csv

~ scenarios should go away and have a window of their own, with goals, messages etc.

~ HQ should go away too, best in other bldg menu

~ in charts different units should have different scales. E.g. Margin in % with 0 in the middle of y axis, regardless if it'shown together with values in cash

jk271


Thank you for your coments

Quote from: fabio on December 16, 2011, 09:49:10 PM
A few sparse thoughts

~ charts like this are little more than useless. They could be made resizable. If you can make the window bigger than default the chart will get bigger too. See new minimap on townhall details.


It is excelent idea. I hope that I can find out, how it works. The window is 410px high, because there was wiritten not to exceed 640x416 pixel size.


Quote from: fabio on December 16, 2011, 09:49:10 PM
~ Chart shows only last 10-20 yrs. It could have more sub tabs with scale 1 month, 1 year, 3 years, 5 years, 10 years (showing up to 200 years).
Showing more years can be changed by setting macro variable MAX_PLAYER_HISTORY_YEARS to higher values. But it arises problem with loading old games. So more coding in spieler_t::rdwr is needed.
Another issue is performance issue. When new year or new month comes, the whole content of table is shifted. Bigger table (or more tables) need more memory too. There are 3 table for year's finance history introduced by this patch having 8-byte items: 7*12, 9*34*12 and 7*12. And the month's finance history needs same amount of memory. It is around 60kiB per player.  And there is not only one player.


Quote from: fabio on December 16, 2011, 09:49:10 PM
~ Button to export financial data in csv

~ scenarios should go away and have a window of their own, with goals, messages etc.

~ HQ should go away too, best in other bldg menu
Good idea for some future work.


Quote from: fabio on December 16, 2011, 09:49:10 PM
~ in charts different units should have different scales. E.g. Margin in % with 0 in the middle of y axis, regardless if it'shown together with values in cash
This is useful, but I do not know how to make it yet.

Dwachs

QuoteThe thing I am not happy about is size of a chart in the bottom. On the other hand I did not found better place for it.

Yes this window looks much too crowded now. What about the following idea: Let the 'All' tab show the same content in the finance window as now. Then add tabs for waytypes (like you did), and one or more extra tabs for goods. The number of good categories is not fixed, it may vary from pakset to pakset.

are you on github?
Parsley, sage, rosemary, and maggikraut.

VS

Narrow gauge waytype is missing, while already present in pak128.Britain...

My projects... Tools for messing with Simutrans graphics. Graphic archive - templates and some other stuff for painters. Development logs for most recent information on what is going on. And of course pak128!

falconne

Like Dwachs said, I reckon the revenue from different categories should be moved to new tab. The current tabs should only contain one total revenue figure for the relevant way type.

jk271

Quote from: Dwachs on December 17, 2011, 07:55:39 AM
Yes this window looks much too crowded now. What about the following idea: Let the 'All' tab show the same content in the finance window as now. Then add tabs for waytypes (like you did), and one or more extra tabs for goods.

Quote from: falconne on December 17, 2011, 10:56:40 AMLike Dwachs said, I reckon the revenue from different categories should be moved to new tab. The current tabs should only contain one total revenue figure for the relevant way type.
Excellent suggestion. I will split up each tab into two subtabs as can be seen on the picture. I drew tabs as a red and a blue rectangles in the left top corner.
Red one (=first tab) will contain labels and buttons from a red rectangle in the bottom and  HQ. The blue one will contain buttons and labels from a blue polygon in the middle. Chart will be left on tab "All".

Quote from: Dwachs on December 17, 2011, 07:55:39 AM

The number of good categories is not fixed, it may vary from pakset to pakset.
The code in the patch distinguishes 8 cathegiries (from 0 to 7). Cathegory 0 is split up into three parts: passenger, mail, other items from cathegory 0.
Each another cathegory and COST_TRANSPORTED_GOODS (from old save game format) are mapped onto cathegory 7.
Are there any paks using some another cathegories than 0, 1, ..., 7 ?

Quote from: Dwachs on December 17, 2011, 07:55:39 AM
are you on github?

Not yet. I am using git on my computer. I will consider using github

Quote from: VS on December 17, 2011, 10:38:19 AM
Narrow gauge waytype is missing, while already present in pak128.Britain...
Thank you for reporting this bug. I am using mostly pak64 with food addons.

prissi

1) I do not think it would be wise to discreminate all income for each good categories and mode of transport (if this was your aim) as often chains could use more than one mode of transport. Thus, better do not use subtabs in tabs. This is really very bad GUI design. (Normal tabs are only very bad ... )

2) You cannot really merge all goods with catg. 0; Those are cars, paper, and many different kinds of goods in severl pak sets. Each of them should get their own line. There is actually an uinique catg index counter in simware.cc (which goes to 12 or so for a typical pak), which tells how many different non-interchangable good categories you have. If out of space, I would rather use a scrollbar.


falconne

Quote from: jk271 on December 17, 2011, 02:22:46 PM
Excellent suggestion. I will split up each tab into two subtabs as can be seen on the picture. I drew tabs as a red and a blue rectangles in the left top corner.
Actually I meant the goods don't need to be broken down by way type at all, so you may as well just have a new tab for "Goods Income", that shows total revenue per good.

jk271

Quote from: prissi on December 18, 2011, 09:25:22 PM
1) I do not think it would be wise to discreminate all income for each good categories and mode of transport (if this was your aim) ...


Yes, it was my aim to display each good category for each mode of transport.
Quote from: prissi on December 18, 2011, 09:25:22 PM

... as often chains could use more than one mode of transport.

I tried out this fact in the game using the most recent build from code of master branch ( = no my code was included): I have build two lines. First line (ship) transports crude oil from oil rig to harbour. The second line (truck) transports crude oil from harbour to Chemical Plant. Each transported item was counted twice. Firstly when reached harbour and secondly when reached final stop. Unless this behavior is changed, I will be able to get mode of transport of thansported item.


So the way, how my code counts number of transported items, does not change this behavior. It only marks transported amount to the 2-dimensional table with first index of transport mode and second index of transported category.


Quote from: prissi on December 18, 2011, 09:25:22 PM
Thus, better do not use subtabs in tabs. This is really very bad GUI design. (Normal tabs are only very bad ... )
Do you mean how does it look like or source code of it (or both)?


There are some suggestion, how to solve it:
1) tabs by type/mode of transport and the whole window is realizable (but i has tabs)
2) two level tabs (not acceptable)
3) tabs by mode of transport and scrollbars
4) something another, suggestions welcomed


Quote from: prissi on December 18, 2011, 09:25:22 PM
2) You cannot really merge all goods with catg. 0; Those are cars, paper, and many different kinds of goods in severl pak sets. Each of them should get their own line. There is actually an uinique catg index counter in simware.cc (which goes to 12 or so for a typical pak), which tells how many different non-interchangable good categories you have. If out of space, I would rather use a scrollbar.


I am merging all goods from catg0 only in finance history statistics. There are (in current master branch) all transported goods counted up in "COST_TRANSPORTED_GOOD".
In my patch amount of goods is split up into catg0 up to catg7.  I tried to be pak-independent, therefore catg0 is not split up into cars, steel, etc. Imagine playing pak64. After some simutrans years you have decided to install food addon (or some another). It would be difficult to implement saving statistics of transported goods distinguished by each single item (steel, paper, ...), because number of item can change.

prissi

About saving: You can easily save what kind of goods "name" and its statistics one by one. Using a predefined set will always be not compatible enough.

Personally I still find statistics for each good and waytype too much.

Tabs are bad UI design by ergonomic, since the hide a lot information without giving any hint what might be missing. Subtab, which are only seen on some tab, are even worse, since before you even did not know there was an UI element on that position.

Thus a global statistic of income by goods would be enough for me. For other purposes you could filter the vehicle list by goods to see which vehicle are doing will with a certain good and which not and need replacement.

jk271


I am stopping development of some huger change of finance statistics from my side for some time. I have to read and try out more simutrans code to understand it better, mostly graphical user interface. It takes me some time.

I made a little patch, which only displayed collected statistics of amount of transported passenger mail and good. These data were collected by simutrans for a long time. The patch changes only graphics, savegame format is not affected.


Quote from: prissi on December 20, 2011, 09:46:38 AM
Personally I still find statistics for each good and waytype too much.
....
Thus a global statistic of income by goods would be enough for me. For other purposes you could filter the vehicle list by goods to see which vehicle are doing will with a certain good and which not and need replacement.


If finance window was as it is now in master branch and there was a filter enabling  to display same information, as is displayed now, by type of transport, would it be more acceptable? My motivation for work on financial statistic was to enable distinguish infrastructure maintenance by type of transport.

Dwachs

Quote from: prissi on December 20, 2011, 09:46:38 AM
Tabs are bad UI design by ergonomic, since the hide a lot information without giving any hint what might be missing.
If there in finance window there is a tab called 'trains' then one usually expects train related numbers there. (Good design - it meets user expectations). If under the train tab in finance window you find for example a list of trains or numbers related to powerlines this would be bad design.

Personally, I like the idea of statistics per good category and per transport type.

What about the following proposal:
-- have tabs like:
------- 'All' - contains the same numbers as of now,
------- one tab per transport type (train, ships etc), here the icons as in the line management window can be used (schedule_list.cc)
------- 'Powerlines'
------- 'Goods'
------------ with a drop-down menu to filter for a specific good or goods category.
------- 'Misc' here the informaiton on headquarter and scenario could be hidden


Edit: I would like to suggest to proceed first with the collecting part of your patch. Here I have the following comments:

(1) Please remove the transport_type. There is a unique mapping between waytype_t and transport_type. The mapping from waytype to index in statistics array can happen within the member functions of spieler_t. This would reduce the footprint of the patch. This removes also the need to define an extra array for income of powerlines.

(2) Do not use fixed number of goods ATV_REVENUE_0 .. ATV_REVENUE_7 etc. Make another array to collect statistics of goods, where you collect income. Goods are index by ware_t::index, I suggest to use this index. Saving/loading should then happen based on goods name.
Parsley, sage, rosemary, and maggikraut.

jk271


Firstly I have to thank you for yours comments to source code.


Quote from: Dwachs on December 21, 2011, 06:47:59 AM
(1) Please remove the transport_type. There is a unique mapping between waytype_t and transport_type. The mapping from waytype to index in statistics array can happen within the member functions of spieler_t. This would reduce the footprint of the patch. This removes also the need to define an extra array for income of powerlines.
The reason, why a made transport_type I was not sure about trams, overheadlines and buildings. I tried to assign buildings like railway station to transport_type railway. When the mapping between transport type and waytype_t is bijective, it is clear.



Quote from: Dwachs on December 21, 2011, 06:47:59 AM

(2) Do not use fixed number of goods ATV_REVENUE_0 .. ATV_REVENUE_7 etc. Make another array to collect statistics of goods, where you collect income. Goods are index by ware_t::index, I suggest to use this index. Saving/loading should then happen based on goods name.

It was revenue from good category. I found somewhere on wiki, that there are 8 categories used. This made me to assume fixed number. I agree, that using index is better. On the other it would need to make some indices (of finance_history_year, resp. month) having one dimesion more and some not.



Quote from: Dwachs on December 21, 2011, 06:47:59 AM
Personally, I like the idea of statistics per good category and per transport type.

What about the following proposal:
-- have tabs like:
------- 'All' - contains the same numbers as of now,
------- one tab per transport type (train, ships etc), here the icons as in the line management window can be used (schedule_list.cc)
------- 'Powerlines'
------- 'Goods'
------------ with a drop-down menu to filter for a specific good or goods category.
------- 'Misc' here the informaiton on headquarter and scenario could be hidden


In my initial intention was not distinguish revenue and amount of transported goods per good. Maintenance by transport type was for me more important.


My proposal is: (I used yours with my changes in blue)
-- have tabs like:
------- 'All' - contains the same numbers as of now,
------- one tab per transport type (train, ships etc), here the icons as in the line management window can be used (schedule_list.cc)
---------- same content as has window today (except revenue from powerlines), figures concern to transport type
----------   optionally rows containing : revenue from:
------------- passenger
------------- mail
------------- goods (all goods together)
------- 'Powerlines'
Edit 28.12.2011 :
------- 'no waytype (or some better name)'  - everything, that can not be assigned to particular transport_type (waytype_t==ignore_wt)
----------- maintenance costs of buildings
----------- construction costs of terrain changes, ...
----------- also usefull for testing - to look up objects having not correctly accounted waytype_t
----------- possibly can be merged with following one - 'Misc'
------- 'Misc' here the information on headquarter and scenario could be hidden
----------- Excellent suggestion - scenarios needs more space for texts.


I would put off implementation of tab "goods". It would take a lot of time. It can be done in future.

jk271

I am resuming an effort to implemet more detailed finance window. I had not clue, how to avoid tabs.
Several months later I came up to an idea of combo box. Screenshot is provided below. Tabs has been transformed into items of combo box. Any other graphical changes are not needed.

Is this graphical design acceptable?

P.S. I am rebasing my devel brancg onto current master. I will provide patches some time later.

greenling

Opening hours 20:00 - 23:00
(In Night from friday on saturday and saturday on sunday it possibly that i be keep longer in Forum.)
I am The Assistant from Pakfilearcheologist!
Working on a big Problem!

Fabio

Great you're back, jk271

The combo box idea seems quite elegant. :thumbsup:




I'm moving this thread to larger projects.

greenling

Good day
I have with paint as I made a proposal to provide funding under Comenius to encourage the best for me would be arranged.
Opening hours 20:00 - 23:00
(In Night from friday on saturday and saturday on sunday it possibly that i be keep longer in Forum.)
I am The Assistant from Pakfilearcheologist!
Working on a big Problem!

prissi


jk271

greenling, Fabio: Firstly I have to thank you for your support. It very nice to read, that effort of making this set of patches is welcome.

I will describe my plans with this project:

I have split up project into following steps. Each step results in at least one patch.
1) MODEL
    - A lot of changes, mostly in player/simplay.{cc|h}
      Class spieler_t has been partially split up - new inner class finances_t containing new finance statistic and some olderly present variables has been created.
    - No changes of graphical interface. (Except new version of savegame in settings - 111.5).
    - Having applied this patch old money_frame can be used as well as new one (if "view" patch is applied).

    * Mostly done - waiting for testing ( step 2.1)
    * I am testing it now.
   

2) VIEW
    - Needed for testing of previous step
    - changes in /gui/money_frame.cc and .h
    - This step can be slit up into:
    2.1) MINIMAL CHANGES - Minimal changes needed to display newly collected statistic
    It is done.
    I am testing it now.
   
    2.2) GUI REDESIGN - More changes in interface design as suggested.
     I am considering this.

3) CODE CLEANUP
    - Removal of now unused functions etc.
    * optional - I have not searched them.

I am trying to test my patches now. I would like to release it in case it will have passed my tests.

My wish is to have parts 1) and 2.1) included in next release.

Redesigned money_frame looks well. On the other hand I would like to have applied and working parts 1 and 2.1. Than I can possibly work on redesign of money window.

jk271

I am happy to announce release of two patches adding more detailed statistic in finances_window!

First one (model.patch.zip) changes save game format (adds new tables for finance history per transport type).
I assumed, that new version (with patch) is 111005.
Most of finance statistics are stored in finance_t class. It is inner class of spieler_t. I consider is better than to have more variables spread out in spieler_t class.
This patch does not change graphical interface except addition of version 111.5 to setting window (gui/setting_stats.cc)
This patch can be applied as is without need of another code from my side as view.patch
Edit: This patch was done with revision 5684.

Second patch (view.patch) adds combobox to finance window (gui/money_frame.cc)
This patch needs to have applied first one (model.patch) as it uses some of new functions.
I had to move combobox above buttons on the right side because there is "company bankrupt message" in the bottom.
There is one small graphic bug - I do not know what to do with it - options of combobox are displayed below buttons. This is solved in patch view2.
See figure: view1

Second patch - alternative
There is an alternative view patch (view2.patch). It solves problem with combobox by small reorganizing of items on the finance window. I have been inspired by suggested changes.
I have moved "transported" line on top to move all content of left side down by one line as I needed space for combobox (if it is opened)
This patch is appliable if model.patch.zip is applied. This patch can not be applied with "view1"
See figure view2

I am providing both "view patches". Feel free to choose any of them.


I have tested it for several hours. So I think it is working well and is ready for testing by simutrans comunity or merge to current master branch to enable testing in nighties.

Notice: .patch file is normal .txt file

Edit 2: Link to compiled linux binary is:
http://simutrans-germany.com/files/upload/sim-money.zip
Unfortunately I am not able to crosscompile it fo windows.

jk271

FIX
#31
I have discovered two bugs since I have released last set of patches.
1) Monthly stats for transport_type "all" were not summed up
2) similar problem for revenue and toll when game is loaded from older savegame version
So I releasing a fix.
(file model_fix.patch)
This file has to be applied after model.patch from previous message was applied.

There is also another patch (file model_fix2_savegame_format.patch) with improvement in savegame format of model.patch from previous post. This improvement saves some space by not saving old COST_ array in games with version 111005 or grater. Old COST_ stats are acquired using functions export_to_cost_month() and export_to cost_year()
This patch changes format of savegame version 111005.

File money20120505_model_witch_fix_1_and_2.patch.zip is one patch having content of model.patch from previous post and two bug fixes.

Edit: During process of beta testing I have revealed a bug in current master branch. When game is being loaded, profit is not calculated correctly. Revenue from powerlines and revenue/expenditures from way toll are not taken in account.
File profit_calculation_bug_fix_in_master.patch contains fix. This bug has been in master for a long time.
Patch does not conflict with any of my patches in this or last post and is appliable in current master branch on revision 5690 or on top of them (patches applied).

prissi

Thanks for the bugfix.

I personally would prefer statistics per categorie, i.e. pas, mail, papr, coal, ... However, I am well aware that this would be messed up by mixed convois.

jk271

Thank you for reviewing of the patches.
In my opinion is, that statistics per pas, mail, coal, steel ... are doable even with mixed trains as amount of transported cargo and revenue for transported cargo can be acquired per vehicle. On the other hand I would like to have done this small step (released patches) and let stats per pas, mail, iron ore, ... to another step.

I am not sure, how to deal with changes in categories yet: User had played and had saved the game. Than (s)he  added some new addons, for example food addon in pak64. Now he playes again with addons enabled. I have to think it over, what to do exactly in such situations. The result solution has to be robust. I have rough idea, how to do it, but it needs to become more mature.

Edit:
Link to new linux binary:
http://simutrans-germany.com/files/upload/simulinux20120507.zip

Edit2:Link to windows binary:
http://simutrans-germany.com/files/upload/simuwin20120508.zip

jk271

Patch set complete
I have finished third (and the last) part - code cleanup patch. Set of patches is complete now.

model - adds new functions and enables more detailed stats -
view - changes money window - small change since last release
code_clean_up - removes old COST_-related functions   several bug fixes - new
all - all 4 patches as one patch

There are precompiled binaries for Windows and Linux for curious users.

http://simutrans-germany.com/files/upload/sim.exe.zip

http://simutrans-germany.com/files/upload/simulinux20120511.zip


So what to do to have it included?

Edit: image added