Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display statistics for waypoints (# of trains passed) #2620

Closed
DorpsGek opened this issue Feb 7, 2009 · 17 comments
Closed

Display statistics for waypoints (# of trains passed) #2620

DorpsGek opened this issue Feb 7, 2009 · 17 comments
Labels
component: interface This is an interface issue flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) patch from FlySpray This issue is in fact a Patch, but imported from FlySrpay

Comments

@DorpsGek
Copy link
Member

DorpsGek commented Feb 7, 2009

Roujin opened the ticket and wrote:

This patch adds some statistics that are saved and displayed for each waypoint:

# of trains passed this month
# of trains passed last month
highest # of trains passed during a month

Due to the saving of the variables, it bumps the savegame version (to currently 114).
This patch is a rewrite of the original patch found here: http://www.tt-forums.net/viewtopic.php?f=32&t=24393

Attachments

Reported version: trunk
Operating system: All


This issue was imported from FlySpray: https://bugs.openttd.org/task/2620
@DorpsGek
Copy link
Member Author

DorpsGek commented Feb 7, 2009

Roujin wrote:

Here's a screenshot :)

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/2620#comment5537

@DorpsGek
Copy link
Member Author

DorpsGek commented Feb 7, 2009

Roujin wrote:

New version with two fixes (thanks to Swallow)
* Changed the text color to black
* Use InvalidateWindowClasses instead of multiple InvalidateWindow calls (more efficient)

+ new screenshot with black text attached ;)

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/2620#comment5538

@DorpsGek
Copy link
Member Author

DorpsGek commented Feb 8, 2009

peter1138 wrote:

Is uint8 enough?


This comment was imported from FlySpray: https://bugs.openttd.org/task/2620#comment5550

@DorpsGek
Copy link
Member Author

Belugas wrote:

Can there be anything else than trains passing at waypoints?
If not ( and I think it's the case ), i would change the name of the variables to something less redundant.
Like passage(or traffic or else)_this_month etc...

And maybe i'd add a reset button somewhere..


This comment was imported from FlySpray: https://bugs.openttd.org/task/2620#comment5569

@DorpsGek
Copy link
Member Author

Roujin wrote:

peter: I think so. I tried getting a top score with the 6xx kmh maglev engine, and got nowhere near 255. I cannot be absolutely sure of course because my trains had some space between each other; maybe the openttdcoop guys know some fancy setups to cram those together with minimum distance to each other, but I doubt one can reach 255 trains in a month.
Without changing something like the daylength of course...
Should I change it to uint16 nevertheless?

Belugas: point taken, will change it to traffic_... (sounds good imo). Will also look into a reset button...


This comment was imported from FlySpray: https://bugs.openttd.org/task/2620#comment5574

@DorpsGek
Copy link
Member Author

Progman wrote:

You can hit the limit 255 with a testing case (see screenshot, 255 trains in 18 days), however it will never be used in a real game.

  1. Why does the max() value doesn't count the current month? (see in the screenshot, too)
  2. Why is the counter saved in the savegame (and so increase the savegame version)? Imho its enought if it is calculated only during a game and shows something like "N/A" if the game isn't run at least one game-month.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/2620#comment5576

@DorpsGek
Copy link
Member Author

Roujin wrote:

I had a talk with Rubidium on IRC and he suggested to cap it at 255, so I've done that.
Also Ammler tested the patch on some real game from openttdcoop, and it seems that in normal games (where you actually try to transport something; not to reach the limit of this patch) no more than a throughput of about 60 trains/month is archieved.
Technically, it is possible to reach this limit though - I'm attaching the savegame where I did this (just unpause (may lag quite a bit) and watch). 300 trains go through the waypoint in about 20 game days there. Had to set all of them to "ignore signals" though - with signals inbetween I doubt that it's possible to reach the limit.

I've also renamed the variables (and also the strings) to *traffic, and added a reset button for the "maximum traffic" counter, and "maximum traffic" is now updated during a running month (if "traffic this month" exceeds all prior records), not only on month change.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/2620#comment5577

@DorpsGek
Copy link
Member Author

Roujin wrote:

Progman (didn't see your post before..):

  1. fixed/done in above patch :)
  2. I took that over from the old patch this is based on (see url in original task description). Appearently the original patch author did not save the values first either, but then peter came with a revised version that saved the values. So I thought saving those values is preferred, and did so in my patch.
    Personally, I'd save them (why not?). Just to prevent any bug reports a la "Waypoint stats not working after loading game"...

This comment was imported from FlySpray: https://bugs.openttd.org/task/2620#comment5578

@DorpsGek
Copy link
Member Author

Belugas wrote:

Plus, I'd say that savegame revisions is not a bad thing, if it brings a bonus.
PLus, users would certainly complain about the fact that their data are lost. And the will complain, for sure..
So it's the best path, in my mind :)


This comment was imported from FlySpray: https://bugs.openttd.org/task/2620#comment5583

@DorpsGek
Copy link
Member Author

Roujin wrote:

Well, everything fine then? Everyone agree on "cap at 255"? Any other issues left?


This comment was imported from FlySpray: https://bugs.openttd.org/task/2620#comment5653

@DorpsGek
Copy link
Member Author

Belugas wrote:

1- Both Rubidium and me (at least) are not confortable with the 255 cap.
2- I spent about half an hour with the window opened and i found out what I do not like about it. The multiplication of "traffic" . It's redundant. So i suggest something like this:

Traffic
This month : xxxxx
Last month : xxxxx
Most in a month : xxxxx

that way, me, personnaly, it willl be ready for trunk


This comment was imported from FlySpray: https://bugs.openttd.org/task/2620#comment5660

@DorpsGek
Copy link
Member Author

DorpsGek commented Mar 1, 2009

Roujin wrote:

Here's a new version with the mentioned changes.

1- data type changed from uint8 to uint16 --> cap raised from 255 to 65535
2- changed drawing code and strings according to Belugas' proposal.

Screenshot included.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/2620#comment5688

@DorpsGek
Copy link
Member Author

DorpsGek commented Mar 1, 2009

frosch wrote:

(as already said on IRC)

+ this->wp->traffic_highest = this->wp->traffic_this_month;

That won't work in multiplayer. It only sets the value on a single client. And as it is stored in savegame elsewise, that is generally a bad idea.


This comment was imported from FlySpray: https://bugs.openttd.org/task/2620#comment5689

@DorpsGek
Copy link
Member Author

DorpsGek commented Mar 2, 2009

Roujin wrote:

Of course.. what a silly mistake. I did not think about multiple companies / multiplayer at all.

Here's a new version that uses a command instead, and also assures that no one can reset the counter of another company's waypoint.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/2620#comment5690

@DorpsGek
Copy link
Member Author

Belugas wrote:

little upgrade... and addons

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/2620#comment5769

@DorpsGek
Copy link
Member Author

Belugas wrote:

and here we go again.
P.S.: It's not in trunk yet, since after some discussions, we agreed on a bigger better wider feature, based on this idea.
But i though of updating it just to be sure work is not going to die

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/2620#comment5845

@DorpsGek
Copy link
Member Author

andythenorth closed the ticket.

Reason for closing: Won't implement

Mass closure of patch tickets with no commentary for >5 years. Goal is to reduce patch queue as an experiment to see if it aids faster reviewing and rejection/acceptance (it may not). If this offends you and the patch is maintained and compiles with current trunk, discuss with andythenorth in irc. (andythenorth has no ability to review patches but can re-open tickets).


This comment was imported from FlySpray: https://bugs.openttd.org/task/2620

@DorpsGek DorpsGek added component: interface This is an interface issue flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) wontfix patch from FlySpray This issue is in fact a Patch, but imported from FlySrpay labels Apr 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: interface This is an interface issue flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) patch from FlySpray This issue is in fact a Patch, but imported from FlySrpay
Projects
None yet
Development

No branches or pull requests

1 participant