Author Topic: Big Map - Slow Game - Improvements?  (Read 1209 times)

0 Members and 1 Guest are viewing this topic.

Offline Jon120

Big Map - Slow Game - Improvements?
« on: July 09, 2017, 11:22:43 AM »
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

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 4870
  • Total likes: 202
  • Helpful: 108
  • Languages: EN, NO
Re: Big Map - Slow Game - Improvements?
« Reply #1 on: July 09, 2017, 12:49:33 PM »
"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?

Offline Jon120

Re: Big Map - Slow Game - Improvements?
« Reply #2 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

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.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 4870
  • Total likes: 202
  • Helpful: 108
  • Languages: EN, NO
Re: Big Map - Slow Game - Improvements?
« Reply #3 on: July 09, 2017, 05:11:23 PM »
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.

Offline jamespetts

  • Simitrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 15858
  • Total likes: 407
  • Helpful: 177
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Big Map - Slow Game - Improvements?
« Reply #4 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.

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.

Online Vladki

Re: Big Map - Slow Game - Improvements?
« Reply #5 on: July 09, 2017, 07:47:25 PM »
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.

Offline An_dz

  • Web Admin
  • Administrator
  • *
  • Posts: 2594
  • Total likes: 290
  • Helpful: 89
  • D'oh
    • by An_dz
  • Languages: PT, EN, (it, de)
Re: Big Map - Slow Game - Improvements?
« Reply #6 on: July 09, 2017, 09:21:50 PM »
Just some solutions to stop these two:
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.

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.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 8823
  • Total likes: 323
  • Helpful: 229
  • Languages: De,EN,JP
Re: Big Map - Slow Game - Improvements?
« Reply #7 on: July 10, 2017, 03:20:49 AM »
If it is no the autosave issue, you can try to use an optimised relase built. The latest stable will do that.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 4870
  • Total likes: 202
  • Helpful: 108
  • Languages: EN, NO
Re: Big Map - Slow Game - Improvements?
« Reply #8 on: July 10, 2017, 05:22:58 AM »
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.

Offline DrSuperGood

Re: Big Map - Slow Game - Improvements?
« Reply #9 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.

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

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 4870
  • Total likes: 202
  • Helpful: 108
  • Languages: EN, NO
Re: Big Map - Slow Game - Improvements?
« Reply #10 on: July 10, 2017, 02:25:07 PM »
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.

Offline DrSuperGood

Re: Big Map - Slow Game - Improvements?
« Reply #11 on: July 10, 2017, 09:24:27 PM »
Quote
Unless 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.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 4870
  • Total likes: 202
  • Helpful: 108
  • Languages: EN, NO
Re: Big Map - Slow Game - Improvements?
« Reply #12 on: July 11, 2017, 05:15:03 AM »
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.

Offline Antarctica

Re: Big Map - Slow Game - Improvements?
« Reply #13 on: July 23, 2017, 12:09:09 PM »
Quote
which 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.

Offline Frank

Re: Big Map - Slow Game - Improvements?
« Reply #14 on: July 23, 2017, 01:05:27 PM »
... play the game using the Great British Isles, which is 2440x3816 tiles. ...

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.
« Last Edit: July 23, 2017, 01:21:46 PM by Frank »

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 4870
  • Total likes: 202
  • Helpful: 108
  • Languages: EN, NO
Re: Big Map - Slow Game - Improvements?
« Reply #15 on: July 23, 2017, 02:25:59 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.

Offline Frank

Re: Big Map - Slow Game - Improvements?
« Reply #16 on: July 23, 2017, 03:21:48 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
« Last Edit: July 23, 2017, 03:44:57 PM by Frank »

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 4870
  • Total likes: 202
  • Helpful: 108
  • Languages: EN, NO
Re: Big Map - Slow Game - Improvements?
« Reply #17 on: July 23, 2017, 03:46:48 PM »
That indicates that most of the memory is used by the pak set, as the map itself should consume just as much memory regardless.