News:

SimuTranslator
Make Simutrans speak your language.

[ENDED GAME] Bridgewater-Brunel no. 1 - Great Britain sized map (no. 2)

Started by jamespetts, December 05, 2017, 09:03:46 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

jamespetts

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.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

DrSuperGood

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.

jamespetts

#142
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.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

ACarlotti

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.

jamespetts

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.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

prissi

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.)

jamespetts

Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Rollmaterial

Arlspike Fisherman, if you are reading this: you have a vehicle with no route in Crandon blocking the whole traffic!

Speedbus

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.

DrSuperGood

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.

jamespetts

Dr. Supergood - as an interim measure until full balancing can be put together after the new features are added, that would be very helpful.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

DrSuperGood

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.

jamespetts

Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

DrSuperGood

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.

jamespetts

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.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

DrSuperGood

#155
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.

jamespetts

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?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

DrSuperGood

#157
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?

Speedbus

I got this error message just a few minutes ago:

ACarlotti

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).

DrSuperGood

QuoteAlso, 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.

jamespetts

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.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Rollmaterial

The server still seems to be running the previous version.

DrSuperGood

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.

Rollmaterial

Quote from: DrSuperGood on March 30, 2018, 09:12:27 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.

jamespetts

#165
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.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

DrSuperGood

Server is down. Been down since it was scheduled to restart with nightly.

jamespetts

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.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Ves

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.

Rollmaterial

It is quite old, I recall being in October or November 1842 when I connected yesterday.

jamespetts

Thank you for letting me know - I am now restarting with the later saved game, which appears to be in February 1843.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Ves

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.

jamespetts

It seems so, although I am not quite sure how. I am restarting again with hopefully the correct version: apologies for the trouble.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

DrSuperGood

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.

jamespetts

Thank you for your report: the crash should be fixed in the next nightly. Apologies for the trouble.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.