The International Simutrans Forum

 

Author Topic: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)  (Read 52873 times)

0 Members and 1 Guest are viewing this topic.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 17573
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #140 on: February 20, 2018, 12:03:26 PM »
I have noted some feedback suggesting that people are having performance problems (i.e., a large lag between input and action, caused by the clients not keeping up with the server). When we last had this issue, I managed to optimise performance a little, and also reduced the server's target framerate from 30fps to 20fps to make it easier for clients to keep up. It seems that this is again becoming more of an issue as the map expands.

May I ask what people's views would be on further reducing the target framerate from 20 to 15fps? The movement of graphics will be noticeably less smooth, but there will be a reduced tendency to lag behind the server.

Offline DrSuperGood

  • Dev Team
  • Devotee
  • *
  • Posts: 2463
  • Languages: EN
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #141 on: February 20, 2018, 04:09:07 PM »
I would recommend reducing the frame rate to 15. I pretty much have to play at maximum zoom level and even still start to lag behind with enough windows open.

For future tests I recommend using a map half the size. As good as these massive maps are I think experimental is just too demanding for them, especially in a multiplayer environment.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 17573
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #142 on: February 20, 2018, 11:12:27 PM »
Thank you for letting me know. I have now adjusted the frame-rate - the change will take effect on the next server restart.

Edit: As to the performance generally, about 75% of all CPU time accross all cores is taken by the passenger generation code. Just finding a destination for passengers takes 23.3% of CPU time accross all cores. The issue is not the geographical size of the map, but rather the population density. The computational intensity of generating passengers increases with the square of the population, since, as the population increases, so too does the number of alternative destinations that passengers must search before finding a suitable destination. Adding alternative destinations for mail would exacerbate this, but only modestly, as there are far more passengers generated than mail.

It may be better for future maps thus to have fewer towns (perhaps 500?), but leave the land area large and use the clustering setting to have large wilderness areas (similar to the Scottish highlands, perhaps). Also, the population grows too quickly, I think - not as much too quickly as in the past, but too quickly all the same. This should be dealt with when revising the town growth algorithm.

In the meantime, if anyone can think of a more efficient weighted vector implementation (I have checked - this is not in STD or the STL), that would be very helpful.
« Last Edit: February 21, 2018, 12:12:32 AM by jamespetts »

Offline ACarlotti

  • *
  • Posts: 221
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #143 on: February 21, 2018, 07:35:32 AM »
If passenger generation is the main performance issue, then I'll add that code to my list of things to investigate, and see if I can find any improvements to it (although at my current rate someone else may get there first). It seems like the sort of code that would be easy to write inefficiently, and hard to fully optimise.
Incidentally, this sort of thing would probably be easier for me to investigate once I have a more powerful laptop (in particular, with more RAM) and can actually run the server game myself.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 17573
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #144 on: February 21, 2018, 12:33:21 PM »
That would be very helpful, thank you. I suspect that the biggest inefficiency is in the use of the weighted vector: the at_weight function has a computation time which increases with the number of elements in the vector, which, of course, is quite different from an ordinary vector, where performance is constant no matter the number of elements.

I did look into this, but there is no standard weighted vector, and all the suggestions for writing algorithms for this that I can find use precisely the same sort of iterate through everything in the list mechanic used by the current system. In theory, I imagine it would be possible to have a system with multiple entries in a vector, the number of entries representing the weight. This would then greatly improve access time, but probably at the cost of much higher insertion/removal time for elements and higher memory overhead (although all that would be stored would be 64-bit pointers).

Do not worry about the time, incidentally, as it takes me a long time to get around to things to, and the code is complex.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9196
  • Languages: De,EN,JP
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #145 on: February 22, 2018, 07:19:15 AM »
at_weight uses a binary search. There is nothing faster than that so far, and the access increases only with the square root of elements. Even for 4 billion entries less than 32 iterations are needed. (Inserting and deleting from it are of course much more time intensive.)

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 17573
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #146 on: February 22, 2018, 10:33:23 AM »
Interesting: thank you for that information.

Offline Rollmaterial fi

  • Devotee
  • *
  • Posts: 501
  • Languages: EN, FR, DE, FI, SE
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #147 on: March 21, 2018, 02:15:04 PM »
Arlspike Fisherman, if you are reading this: you have a vehicle with no route in Crandon blocking the whole traffic!

Offline Speedbus

  • *
  • Posts: 6
  • Languages: DE, EN
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #148 on: March 22, 2018, 06:24:59 AM »
It should be fixed now. I am very sorry, and I apologize for any inconvenience.

The cause was that there is no public right of way anymore between (1765,2686) and (1765,2689). In other words you managed to interrupt the public route. As far as I understand the concept of public rights of way this should not have been possible.

Offline DrSuperGood

  • Dev Team
  • Devotee
  • *
  • Posts: 2463
  • Languages: EN
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #149 on: March 22, 2018, 07:21:49 AM »
The server game is starting to hit the point where we are going to run out of viable trains. Only the very early trains have been balanced, with the ones being introduced now all having insane running costs.

For example the 59km/h train costs just 0.08c/km where as the new 80km/g train costs 7.70c/km. Seeing how they also lack monthly maintenance costs this points towards their data not being rebalanced.

I would be willing to hack together some reasonable sounding numbers that would work with the gameplay, however they would not be historically sourced.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 17573
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #150 on: March 22, 2018, 11:00:32 AM »
Dr. Supergood - as an interim measure until full balancing can be put together after the new features are added, that would be very helpful.

Offline DrSuperGood

  • Dev Team
  • Devotee
  • *
  • Posts: 2463
  • Languages: EN
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #151 on: March 23, 2018, 12:36:02 AM »
I have put a merge request for the engines up to 1835. I will do more in the future.

Generally I have tried to scale per km cost with engine power, factoring in engines becomming more fuel efficient due to scale and better designs. Per month costs have been scaled representing the realitive complexity of the engine and number of crew needed.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 17573
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #152 on: March 23, 2018, 12:40:06 AM »
Splendid, thank you. I have now incorporated this.

Offline DrSuperGood

  • Dev Team
  • Devotee
  • *
  • Posts: 2463
  • Languages: EN
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #153 on: March 25, 2018, 07:02:10 AM »
Server failed to migrate nightly at the correct time. It should have done so ~1 hour before making this post, but still is using the previous nightly. All other servers seemed to have migrated as expected.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 17573
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #154 on: March 25, 2018, 01:21:31 PM »
Oddly, the control script seems to have lost control of the Simutrans-Extended instance. I am in the process of restarting the server now.

Edit: This is now running the correct version.

Offline DrSuperGood

  • Dev Team
  • Devotee
  • *
  • Posts: 2463
  • Languages: EN
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #155 on: March 29, 2018, 11:18:35 PM »
Server has just this moment crashed due to index out of bounds error. Also crashed my client immediately after out of sync (as the server crashed so sync was lost).

For example index 66 of 0...0.

Seems fairly reproducible with the server game. Crashes after a few minutes.
« Last Edit: March 29, 2018, 11:37:11 PM by DrSuperGood »

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 17573
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #156 on: March 30, 2018, 01:26:50 AM »
Thank you for the report. Connecting with a debug version, I get the desync, but not the crash. Can you let me know the exact text of the error message that you get so that I can at least try to narrow down the problem?

Offline DrSuperGood

  • Dev Team
  • Devotee
  • *
  • Posts: 2463
  • Languages: EN
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #157 on: March 30, 2018, 06:31:19 AM »
Crashes very reliably with same error each time. Server is basically unplayable at the moment.

Attached is image of the thrown error.

Not sure how useful it is though. It is a typical vector index out of bounds. What is interesting is the vector has 1 element and it is trying to read index 66 and it is of type world coordinates. Possibly related to routing or pathing?
« Last Edit: March 30, 2018, 07:51:51 AM by DrSuperGood »

Offline Speedbus

  • *
  • Posts: 6
  • Languages: DE, EN
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #158 on: March 30, 2018, 06:34:26 AM »
I got this error message just a few minutes ago:

Offline ACarlotti

  • *
  • Posts: 221
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #159 on: March 30, 2018, 06:53:40 AM »
There are many different vector types, so it is useful knowing which one it is. In this case, even without examining a backtrace, we further know that it is vector_tpl of koord3d, which appears in about 24 places in the code (search for "vector_tpl<koord3d>"). Given recent discussion, this one in particular stands out to me:

simhalt.h-422-  * Used for the time interval system
simhalt.h-423-  */
simhalt.h:424:  vector_tpl<koord3d> station_signals;
simhalt.h-425-
simhalt.h-426-#ifdef USE_QUOTE

Also, the vector is not empty - '0..0' actually means that the vector contains one element (so the valid indices are 0 to 0 inclusive).

Offline DrSuperGood

  • Dev Team
  • Devotee
  • *
  • Posts: 2463
  • Languages: EN
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #160 on: March 30, 2018, 08:00:38 AM »
Quote
Also, the vector is not empty - '0..0' actually means that the vector contains one element (so the valid indices are 0 to 0 inclusive).
Ops my bad.

Anyway it is currently a fatal error that is preventing one from progressing on the server game. I would not be surprised if it is related to the timed interval system as there are at least 3 known bugs with that.
  • Distant stop locations count as junctions when there is only 1 way to them limiting passing speed to half. One needs to place any other reservation behaviour signal directly before the stop location for the intended behaviour to occur for most of the line.
  • Overly long platforms with timed interval signal at end of platform will apply timed interval behaviour to all trains in the platform. Since neither train passes the signal it will keep applying this behaviour to both trains. Since the train behind is trying to stop at the end of the platform it will constantly bump into the one in front. The result is an infinite deadlock of stationary trains performing emergency stops. Current fix is to manually alter the schedule of the front train before the back train completes its emergency breaking so it can leave the platform. I have not reported this as it is low priority and hard to recreate reliably, as well as is avoidable by some signalling practices.
  • Timed interval flags appear to default to junction behaviour for the first passing train, even if future trains will pass with the non junction behaviour. I have not reported this as it is trivial and other bugs need to take precedence.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 17573
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #161 on: March 30, 2018, 06:35:38 PM »
I think that I have fixed this now - I am just deploying the fixed version on the server. This should be running again in ~15 minutes. Sorry for the trouble.

Offline Rollmaterial fi

  • Devotee
  • *
  • Posts: 501
  • Languages: EN, FR, DE, FI, SE
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #162 on: March 30, 2018, 07:33:05 PM »
The server still seems to be running the previous version.

Offline DrSuperGood

  • Dev Team
  • Devotee
  • *
  • Posts: 2463
  • Languages: EN
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #163 on: March 30, 2018, 09:12:27 PM »
Seems fixed, no crashes on the server so far.

That said the server did freeze for a very long time (do not know if it stopped). However that could be because of someone with a slow internet connection joining but I did not have the time to wait and find out.

Offline Rollmaterial fi

  • Devotee
  • *
  • Posts: 501
  • Languages: EN, FR, DE, FI, SE
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #164 on: March 30, 2018, 09:25:04 PM »
That said the server did freeze for a very long time (do not know if it stopped). However that could be because of someone with a slow internet connection joining but I did not have the time to wait and find out.
That might be me.

Also, the server seems to crash right after the first month shift.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 17573
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #165 on: March 30, 2018, 09:28:53 PM »
I have been attempting to update the server to the latest correct version following Rollmaterial's earlier report, apparently without success; but perhaps it did succeed and I was testing with the wrong version...? I am rebuilding and restarting now.

Edit: This is now back: apologies for the difficulties.
« Last Edit: March 30, 2018, 09:50:33 PM by jamespetts »

Offline DrSuperGood

  • Dev Team
  • Devotee
  • *
  • Posts: 2463
  • Languages: EN
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #166 on: April 09, 2018, 09:04:40 AM »
Server is down. Been down since it was scheduled to restart with nightly.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 17573
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #167 on: April 09, 2018, 08:27:01 PM »
Thank you for the report, and apologies for the difficulties. The saved game appears to have become corrupted for reasons that are not clear. I have restored what I think is the latest backup of the saved game and restarted the server, but I should be grateful if you could check whether this is recent enough or whether this appears to lost a significant amount of progress so that I can restore the other backup if this appears to be too old.

Offline Ves

  • Devotee
  • *
  • Posts: 1509
  • Languages: EN, SV, DK
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #168 on: April 09, 2018, 08:33:25 PM »
I dont know about how old the savegame is, I have not been so active lately, however, all the passwords have been reset, so people might consider go in and reset their passwords.

Offline Rollmaterial fi

  • Devotee
  • *
  • Posts: 501
  • Languages: EN, FR, DE, FI, SE
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #169 on: April 09, 2018, 09:14:23 PM »
It is quite old, I recall being in October or November 1842 when I connected yesterday.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 17573
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #170 on: April 09, 2018, 09:26:07 PM »
Thank you for letting me know - I am now restarting with the later saved game, which appears to be in February 1843.

Offline Ves

  • Devotee
  • *
  • Posts: 1509
  • Languages: EN, SV, DK
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #171 on: April 09, 2018, 09:35:13 PM »
Did you accidentally take the wrong savegame? Just returning to the server, I am looking at the very changes I did right before you restarted it.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 17573
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #172 on: April 09, 2018, 09:59:01 PM »
It seems so, although I am not quite sure how. I am restarting again with hopefully the correct version: apologies for the trouble.

Offline DrSuperGood

  • Dev Team
  • Devotee
  • *
  • Posts: 2463
  • Languages: EN
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #173 on: April 12, 2018, 12:05:22 AM »
Server game is stuck in an infinite crash loop.

Error:
7koord3d index out of bounds: 111 not in 0...110.

Cannot get screenshot because the game is in a fatally crashed state and trying to do so results in the dialog being missing.

Will try later when new nightly is up. However if it still crashes that means feedback on the various bug reports will be delayed until it is fixed.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 17573
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)
« Reply #174 on: April 12, 2018, 01:07:33 AM »
Thank you for your report: the crash should be fixed in the next nightly. Apologies for the trouble.