News:

Simutrans Wiki Manual
The official on-line manual for Simutrans. Read and contribute.

Big Map - Slow Game - Improvements?

Started by Jon120, July 09, 2017, 11:22:43 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Jon120

Hi All

I was wanting to challange myself, so I was trying to play the game using the Great British Isles, which is 2440x3816 tiles. Most of it is water. Just when you are playing the game it will just completely stop for about five seconds then go again. I am runing it on a old computer which might be a problem, but I thought the computer can cope still.

I was just wondering if anyone had any thoughts on how to get the game to run smoother

Jon

Ters

"Old computer" doesn't really say much. As far as Simutrans is concerned, computers have not improved much the last ten years. Simutrans has also had cases of running slow on newer computers, but fine on older. We need some more detailed computer specifications to make a judgement about it.

Five second stops doesn't really sound like any performance problem I've experienced or heard about in Simutrans. Simutrans usually just becomes generally sluggish, where the frame rate becomes quite low and it takes time to respond to input.

Is there anything particular happening when Simutrans freezes? Any particular vehicle heading out from a stop on a complicated or long trip? A new piece of background music playing, or maybe some other sound?

Jon120

My spec for my pc is:

AMD Athlon 64 X2 Dual Core Processor 4000~+ 2.10 GHz
3.00 GB RAM
64 bit Operating System

When I mean it freezes. You can be on fast forward looking at a factory. Then the speed just drops below 1x speed. Stalls a bit then picks itself back up to fast forward speed.

Ters

My CPU isn't much faster, and it runs a 2048x2048 map just fine, unless I zoom far out. It has more cores, but Simutrans only runs on one of them (for me anyway), so that shouldn't make a difference. I don't have much experience with fast-forward, though, since I do not use it for various reasons.

jamespetts

You mention that your map is mostly water - do you have a large quantity of shipping over long distances? This can take a great deal of CPU power for the routing algorithm, and would explain the behaviour that you describe.

I wonder whether Standard might benefit from adopting the multi-threading of vehicle routing that I implemented last year in 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.

Vladki

1. If you have too much water, you may want to disable water animation.
2. Short freezes can occur during autosave
3. Short freezes can occur when the game wants to spawn new industry chain, but the map is already quite full.

An_dz

Just some solutions to stop these two:
Quote from: Vladki on July 09, 2017, 07:47:25 PM
2. Short freezes can occur during autosave
You can increase the time required between autosaves so it happens less times - though this can be dangerous as a crash might destroy too much things - or remove autosave compression - though autosaves will be pretty big in size.

Quote from: Vladki on July 09, 2017, 07:47:25 PM
3. Short freezes can occur when the game wants to spawn new industry chain, but the map is already quite full.
You can set cities to stop growing to stop this.

prissi

If it is no the autosave issue, you can try to use an optimised relase built. The latest stable will do that.

Ters

Quote from: jamespetts on July 09, 2017, 05:34:08 PM
You mention that your map is mostly water - do you have a large quantity of shipping over long distances? This can take a great deal of CPU power for the routing algorithm, and would explain the behaviour that you describe.

It think that no longer is true. Ships are probably among the two cheapest things to route, which was demonstrated recently by someone having thousands of ships. The other would be aircraft, which might be slightly cheaper.

DrSuperGood

About 5 seconds is also the time it takes a mechanical hard disk to go from parked/sleep/off to running. Laptops do this quite a lot as they turn off hard disks to save power. Simutrans does not pre-load everything it needs into memory and will still perform some I/O when running.

However I would say auto save is more than likely the cause.

Ters

Quote from: DrSuperGood on July 10, 2017, 07:40:21 AM
About 5 seconds is also the time it takes a mechanical hard disk to go from parked/sleep/off to running. Laptops do this quite a lot as they turn off hard disks to save power. Simutrans does not pre-load everything it needs into memory and will still perform some I/O when running.

Pak files are all loaded at start-up and the entire map is loaded at once. The only thing Simutrans might load at need should be sound and/or music. Unless you are thinking about paging.

DrSuperGood

QuoteUnless you are thinking about paging.
Which is still technically IO.

All I know is that if my hard disk is parked and I bring up the in game help, eg hitting a wrong hot key, then Simutrans freezes until the hard disk spins up. This might be because of it having to page in more of the executable from the hard disk, or because it loads some localization files or something. Certainly not paging in the conventional sense as my page file is on another drive and have more than enough memory anyway.

Ters

Ah, yes, bringing up help is terribly slow, which is annoying when I keep doing it by hitting the wrong key. Checking the code, it seems the help texts are loaded on demand and thrown away when done. But I think Jon120 would have noticed if it was bringing up help that slowed things down, and I haven't noticed anything else behaving that way.

Paging could still be a possibility, despite standard Simutrans not being able to use more than 3 GB RAM anyway. That's why I wondered if that was what you had in mind. How likely that is depends not only on map size, the pak set used and the number of in game objects (vehicles, buildings, roads, trees, etc.), but also what else is running alongside Simutrans.

Antarctica

Quotewhich was demonstrated recently by someone having thousands of ships
That was me. I can confirm that one hundred thousand ships on a line  of twenty thousand tiles is not causing performance problems on a normal gaming PC.

Five seconds sounds to me as if the engine is trying to spawn a long new industry chain but not finding enough space; I regularly have similar issues with industry increase. I have circumvented that by setting industry_increase_every to 50k or even 100k.

Frank

#14
Quote from: Jon120 on July 09, 2017, 11:22:43 AM
... play the game using the Great British Isles, which is 2440x3816 tiles. ...

Quote from: Jon120 on July 09, 2017, 03:25:48 PM
My spec for my pc is:

AMD Athlon 64 X2 Dual Core Processor 4000~+ 2.10 GHz
3.00 GB RAM
64 bit Operating System
....

mmh

3 GB RAM by Map 2440x3816

I think it has to do with the size of the RAM at this map size.

And it is not the entire RAM for Simutrans available.

edit
Due to the double heights, the memory requirement (HDD / RAM) has also increased compared to the simple heights.

Ters

Quote from: Frank on July 23, 2017, 01:05:27 PM
I think it has to do with the size of the RAM at this map size.

I have a 2048x2048 map, and Simutrans uses only about 300 MB running that. As I have already written, I have no performance issues with it. Map size by itself should therefore not be a problem. Of course, if other processes on the system use up more than 2.7 GB RAM, then there will be problems, but then you might get problems with smaller maps as well.

Frank

#16
Quote from: Ters on July 23, 2017, 02:25:59 PM
I have a 2048x2048 map, and Simutrans uses only about 300 MB running that. ....

mmh

I testet on my PC: Windows 10 - 1703 64bit ; 8 GB RAM

1. start Simutrans 120.2.2 r8162
2. start Pakset
3. load Relief britishisles2440x3816.ppm from maps.simutrans.com
4. change water level to -6
5. start map

After finished loading the map the following RAM was occupied

pak64 120.2 r1872-> 673.808 KB
pak64.german 0.112.3.7 -> 656.400 KB
pak128.britain 1.17 -> 821.240 KB
pak128 2.6 -> 1.135.504 KB ( option 'Maximize height levels' on )


Simutrans 112.3 r6520
pak128 2.3.0 -> 1.008.912 KB


screen = option 'Maximize height levels' off

Ters

That indicates that most of the memory is used by the pak set, as the map itself should consume just as much memory regardless.