News:

Use the "Forum Search"
It may help you to find anything in the forum ;).

The underground signal box does not work in underground mode

Started by Junna, July 07, 2018, 12:43:15 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Junna

The underground signal box cannot be placed in underground mode, nor can it be placed in sliced mode unless the sliced mode is one-level under ground, at all other levels, it says it cannot be placed. This makes placing the underground box extremely difficult and bothersome, and renders it almost worthless. It is less of a hassle to demolish and place ground-level boxes even in an urban environment, than it is to bother getting to the appropriate level (esp. with the slow rendering whenever sliced level is changed).

jamespetts

The underground signalbox is intended to be placed in sliced underground mode one tile beneath the surface. May I ask what the difficulty is in thus locating it?
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

Quotethan it is to bother getting to the appropriate level (esp. with the slow rendering whenever sliced level is changed).
This is something I am working on... If my current intended solution will be good enough is hard to tell but getting to that stage might take another week or so.
QuoteMay I ask what the difficulty is in thus locating it?
Every time one changes a slice on the server game it freezes the game for 5-7 seconds. It then takes an additional 20-40 seconds to catch up with the server as you have fallen 5-7 seconds behind it. If one needs to change 3+ slices or toggle between underground modes this quickly becomes unplayable. Let us not forget that it loads ones CPU at near 100% during the change, my cooling fans go all crazy lol!

This is a problem inherited from standard. It is because every time one changes underground mode or slice level the game is forced to recompute the tile back wall and tile texture cache of every single tile on the map. With a map like the demo game at the start of Simutrans Extended this is no problem as the map is small. However get to a huge map like the server game which has 27,045,056 tiles and even a fast modern PC will freeze for 2+ seconds during the change. The only reason it is as fast as it is currently is thanks to multi threading.

The simplest solution would be to update the back wall and tile texture caches every time the tile is drawn. However some of the standard developers said this might slow down drawing code unacceptably, especially for water which is redrawn frequently.

My intended solution is a "prepared map" attached to each view port. This tracks which tiles have been prepared for a view port. Tiles that are not prepared will have their ground texture and back wall calculated. Tiles that are prepared will not have it calculated again. The prepared map will only be tested if the view port area has changed, including marking everything as dirty (eg due to slice change) or during a panning operation. Panning the view port would only cause the newly visible edge to be prepared. Additionally since the prepared map is power of 2 aligned for performance (can use shifts and masks instead of multiply and modulus) there is some caching behaviour for moving the camera around without having to re-prepare already prepared tiles. There will be some redundancy if 2 view ports overlap where the same tiles will be prepared multiple times unnecessarily but avoiding this by sharing information between the view ports might be slower due to overhead and require more complex data structures. Originally each tile would be prepared in a single threaded way, which should still be fast seeing how few need to be prepared, however there may be room to move preparation into the drawing code later to allow preparation to occur multi threaded for even more speed gains.

jamespetts

Dr. Supergood - that is very helpful and interesting: thank you. I shall look forward to your patch.
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 made a patch for standard that appears to greatly improve the performance of underground view mode changes on large maps at the cost of slightly slower (not sure how much, hopefully trivial) rendering per frame. I do know how easy incorporating it into extended will be.

The patch is currently not in the trunk for standard because it needs testing. I cannot be sure that it is bug free but I did run a variety of test cases and did not see any artefacts.

https://forum.simutrans.com/index.php/topic,18338.new.html

jamespetts

Thank you very much for the update. I shall look forward to being able to incorporate this when it is ready.
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

The coding for it is done, at least so that it can solve the issue with underground mode/slice changes. Only bug testing, profiling and eventual merger remains.

Profiling I am not too good at which is why I posted the patch to the thread. Additionally although I did bug test it during development, additional bug testing may be required in case I overlooked a problem.

jamespetts

Splendid, thank you. Do let me know when you believe that it is ready for incorporation into Extended.
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

EDIT: Hold off for now currently there seems to be some performance and bug difficulties associated with the patch. Sigh.

jamespetts

Thank you for letting me know of the difficulties. Do let me know when it is ready to incorporate.
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

Fast underground mode/slice change has now been merged into standard. It is probably worth porting from standard to extended as it should greatly help people play on the server game.

jamespetts

Thank you for mentioning that. I know that A. Carlotti is working on porting a lot of changes from Standard to Extended. I am not sure when he will get around to this, as he is working in chronological order. How separated is this code from parts of the code changed by Extended?
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 imagine a lot of it is quite separate. The main problem would be grund_t since that has recently had a lot of cosmetic stuff done to it as part of making of this change to try and improve readability.

jamespetts

It may be better to wait for A. Carlotti's merge, in that case.
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.