News:

Simutrans Tools
Know our tools that can help you to create add-ons, install and customize Simutrans.

Performance of Simutrans?

Started by jorrit, October 21, 2008, 09:49:46 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

jorrit

Hi all, I'm a new Simutrans player (and I think I like it so far  :) ) but I have a bit of a performance problem. Using simutrans 100.0 with either pak64 or pak128 I get very bad performance: only about 10-11 fps. With pak64 I have even worse problems like not being able to drag a window for more then about a few centimeters before it seems to 'let go' of the window. At least with pak128 that doesn't happen.

BTW, I'm using the native windows version. I tried SDL before but that seemed even worse.

I come from OpenTDD and there I don't have any performance problems at all. That game is very fast.

My computer is a Dual Core Intel with 2 gigabytes ram and Intel Graphics 945 chipset. It is not the best 3D hardware but I guess that's not really needed for Simutrans.

Any tips?

Greetings and thanks in advance,

jorrit

Ah, seems the SDL version *is* faster if I use it with pak128.

Now I get about 25 fps which is very playable.

Greetings,

jorrit

But the SDL version does again seem to have the problem of not being able to drag windows. I can only drag them for a short distance and then it is as if my mouse is released. Or at least Simutrans thinks that it is released.

Greetings,

jorrit

This feels a bit like a monologue :-)

Anyway, I found out the performance bottleneck. It appears that if you pause Simutrans it only gets 8-10 fps while in normal mode it is about 25 fps. Why is pause that demanding on framerate? I don't see anything special on screen that would clarify that.

Greetings,

jbode

Quote from: jorrit on October 21, 2008, 11:12:34 AM
This feels a bit like a monologue :-)

Please imagine that your finding might need some testing ... AND most of the contributors here are working in RL - Simutrans is still based on voluntary work! Even though the response times here are much shorter than in 99% of the commercial software manufactures support pages ...

Patience please!

Jörg

jorrit

Quote from: jbode on October 21, 2008, 11:19:31 AM
Please imagine that your finding might need some testing ... AND most of the contributors here are working in RL - Simutrans is still based on voluntary work! Even though the response times here are much shorter than in 99% of the commercial software manufactures support pages ...

Patience please!

Jörg

Ah sorry, that was not my intention. I was just remarking on myself that I was just producing one message after another instead of just waiting until I had sufficient information to make a slightly bigger and more accurate post.

Greetings,

vilvoh

Have you seen this topic,  V100.0: Slow performance? It may help you ...

Escala Real...a blog about Simutrans in Spanish...

jorrit

Quote from: vilvoh on October 21, 2008, 11:42:44 AM
Have you seen this topic,  V100.0: Slow performance? It may help you ...

I hadn't seen it. I installed a nightly as instructed there and it is better. But there is still a slowdown when entering 'pause' mode. From 27 fps to about 15 fps. I wonder why that is? I'm a programmer and I can't think of a reason why entering pause would cause framerate to go down?

Greetings,

DirrrtyDirk

I don't know why either - but since there is no movement in pause mode, a reduced fps rate shouldn't be a problem, right?
  
***** PAK128 Dev Team - semi-retired*****

jorrit

Quote from: DirrrtyDirk on October 21, 2008, 12:50:59 PM
I don't know why either - but since there is no movement in pause mode, a reduced fps rate shouldn't be a problem, right?

Well it is a problem. I like to build my complete network in pause mode so that when I unpause it all starts (to earn) at once. But with the lower fps it is a bit sluggish to manipulate controls and dialogs to build everything.

Greetings,

vilvoh

#10
Have you said the complete network? Wow, I guess nobody has done such a hardcore test with pause mode. Indeed, if I'm not wrong, in previous versions you can't do anything while you were in pause mode.

Escala Real...a blog about Simutrans in Spanish...

jorrit

Quote from: vilvoh on October 21, 2008, 01:25:30 PM
Have you said the complet network? I guess nobody has done such a hardcore test with pause mode. Indeed, if I'm not wrong, in previous versions you can't do anything while you were in pause mode.

Well not really the *complete* network. I mean an entire supply chain. i.e. wood to sawmill, then planks to the furniture builder and so on. I create the tracks, make the stations and depot, build the trains and setup the schedule and then I press start on each of the vehicles. Then when I unpause they all start driving at once.

Greetings,

Zeno

Actually in your example doesn't make many sense to start all the trains together: until the first train reaches the sawmill (and it processes all the wood), you won't get enough planks to fill the second train. So the planks train will be stucked at the station waiting to be loaded, if it's said to; if not, it will be running without getting any revenue but losses! :o

vilvoh

#13
@Jorrit: in Simutrans world, that's doing all.... :D

Just curious, have you tried to do all this without using pause mode? Have you notice the same loss of performance?

I've realized that this loss of performance has happened with dual core machines.
Quote from: oybon on September 13, 2008, 12:37:51 PM
This occurs across both my core 2 based xp pro machines.
Quote from: jorrit on October 21, 2008, 09:49:46 AM
My computer is a Dual Core Intel with 2 gigabytes ram and Intel Graphics 945 chipset.

Is their architecture 32 or 64 bits? As far as I remember, simutrans does not support 64 bits, does it?

Escala Real...a blog about Simutrans in Spanish...

jorrit

Quote from: vilvoh on October 21, 2008, 01:37:51 PM
@Jorrit: in Simutrans world, that's doing all.... :D

Just curious, have you tried to do all this without using pause mode? Have you notice the same loss of performance?

If I do the same while not paused I have about 26 fps now and dialogs/building stuff goes smooth.

Greetings,


vilvoh

#15
That's the quick solution, not to use the pause mode!! ....

As I said before, I think the pause mode is not prepared to deal with so many tasks at the same time. I think its intended use is focused on small pauses. Anyway, let's wait to see what people from dev team may say about this.

Escala Real...a blog about Simutrans in Spanish...

Combuijs

QuoteWow, I guess nobody has done such a hardcore test with pause mode

Well, since this feature is available I use it always! It's wonderful and works really good. The only moment I "unpause" is when convois are sent from a depot.

When you have a big map (3000x2000) with lots of convois (>500) building in "normal" mode is difficult due to performance problems. But building in "pause" mode still works more or less, far better than in "normal" mode. So my experience is quite opposite to Jorrit. I don't think the fps-rate is playing a role here.

The way I play nowadays is building in "pause" mode (in January of every year), playing in "fast" mode and solving problems in "normal" mode (the rest of the year). The main advantage is that when you redesign stations and tracks, you are not hampered by moving trains and trucks. Just freeze the game at the right moment and start your (re)design. Absolutely handy.
Bob Marley: No woman, no cry

Programmer: No user, no bugs



jorrit

Quote from: Combuijs on October 21, 2008, 02:01:46 PM
When you have a big map (3000x2000) with lots of convois (>500) building in "normal" mode is difficult due to performance problems. But building in "pause" mode still works more or less, far better than in "normal" mode. So my experience is quite opposite to Jorrit. I don't think the fps-rate is playing a role here.

Well I like to build in pause mode too but when fps drops below 10 fps the user interfaces becomes very sluggish and it is very annoying to do that. In the nightly build that I'm using fps is about 14-15 which is just usable but if I unpause I get 26 fps which is a lot better.

Greetings,

prissi

Since actually pause means pausing the application to give the power to other program, it does roughly one update every 100ms. (I even thought to make it slower, but just left it like this.) Depending on your windows flavour, this will often pause for much less, especially when you click or release with the GDI binary.

Given the purpose of pause is to pause and freeze it, and building there is only secondary, I think I will not change the frame rate while pausing. But you can do it easily. Change simworld.cc line 4098 to some smaller value.

EDIT: I just saw: It is already 50ms, which should give 19-20fps. Seeing less means that most of the other time your system is already taking time to refresh just the image. But also the fps counter is not working any real good with the pause mode, thus also this value might be wrong.

jorrit

Quote from: prissi on October 21, 2008, 04:43:38 PM
Since actually pause means pausing the application to give the power to other program, it does roughly one update every 100ms. (I even thought to make it slower, but just left it like this.) Depending on your windows flavour, this will often pause for much less, especially when you click or release with the GDI binary.

Given the purpose of pause is to pause and freeze it, and building there is only secondary, I think I will not change the frame rate while pausing. But you can do it easily. Change simworld.cc line 4098 to some smaller value.

EDIT: I just saw: It is already 50ms, which should give 19-20fps. Seeing less means that most of the other time your system is already taking time to refresh just the image. But also the fps counter is not working any real good with the pause mode, thus also this value might be wrong.

Well whatever the fps value says I also experience severe sluggishness while in pause mode and that sluggishness is not present if I unpause (or at least a lot less).

Greetings,

prissi

I could suggest to built in slow motion. (0.06 timestretch) Then the simloop should act as normal but everything else is slowed down very much.

Spike

Originally pause just halted everything. I considered building in pause mode cheating so I didn't support that at all.

It's a feature that was lately introduced as a favor for those who want to build during pause. I'd like to ask for some understanding if a feature that was originally not meant to exist, works not quite as smooth as you are used to from games that had it from the beginning. Prissi listened to the requests of the players, and tried to to help as good as he can.

But, as others pointed out, I also think it is better to build networks in normal mode, since the incremental completion of a network goes hand-in-hand with the transport of goods.

jorrit

Quote from: Hajo on October 22, 2008, 10:44:12 AM
Originally pause just halted everything. I considered building in pause mode cheating so I didn't support that at all.

It's a feature that was lately introduced as a favor for those who want to build during pause. I'd like to ask for some understanding if a feature that was originally not meant to exist, works not quite as smooth as you are used to from games that had it from the beginning. Prissi listened to the requests of the players, and tried to to help as good as he can.

Well I don't have a big problem with it. I was only curious from a technical viewpoint. I assumed that a program in pause mode needed to do less work then a program in non-pause mode so I found it weird that it went slower.

Greetings,