The International Simutrans Forum

 

Author Topic: Simutrans in 4k?  (Read 10166 times)

0 Members and 1 Guest are viewing this topic.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 17636
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Simutrans in 4k?
« on: April 09, 2016, 05:54:37 PM »
May I ask whether anyone has tried playing Simutrans in 4k? I recall reading Prissi having written that dpi scaling would probably need to be implemented to make this work well (or else things would look too small and performance would be poor). If any of the Standard developers are reading this, are there any immediate plans to implenent dpi scaling?

I ask because I am considering upgrading my main monitor, an Eizo FlexScan S2000 from 2007, which is a 20.1" 1600x1200 monitor whose resolution is now somewhat poor in comparison with my smartphone and tablet (both circa 1440p), and the colour rendition is not as good as modern IPS panels. 4k seems to be the major standard: it can deal with 1080p content with multiple scaling to prevent scaling loss of sharpness (and the same will be so with 8k content if and when that ever becomes mainstream), it has significantly higher resolution than my nearly decade old system (which is a worthwhile thing for my other hobby of photography, where I am really not getting all that I might out of my camera's 16mp sensor with what is effectively a 2mp monitor) and a newer monitor generally will allow me to take advantage of all the improvements in monitor technology from the past decade or so. I had thought of having two new monitors, one of 4k the other of a lower resolution, but Windows does not cope well with having different dpi scaling on different monitors.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5315
  • Languages: EN, NO
Re: Simutrans in 4k?
« Reply #1 on: April 09, 2016, 07:16:50 PM »
Windows does not cope well with having different dpi scaling on different monitors.

Windows is supposed to since 8.1. I don't remember if applications must be written to support it as well.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 17636
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Simutrans in 4k?
« Reply #2 on: April 09, 2016, 07:23:36 PM »
Windows is supposed to since 8.1. I don't remember if applications must be written to support it as well.

I think that they must be: I have read reports (see here) of blurred text on all but certain applications (e.g. Edge) in Windows 10 with different dpi scaling on different monitors.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9238
  • Languages: De,EN,JP
Re: Simutrans in 4k?
« Reply #3 on: April 09, 2016, 08:10:46 PM »
We had disabled scaling for Simutrans recently (I think be changing the manifest). However, the font is tiny, so there is a need to support larger fonts using Unicode and Freetype. It is halfway in only so far.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5315
  • Languages: EN, NO
Re: Simutrans in 4k?
« Reply #4 on: April 10, 2016, 08:23:05 AM »
We had disabled scaling for Simutrans recently (I think be changing the manifest).

I kept Windows' not quite transparent automatic scaling for legacy applications at bay by telling Windows that Simutrans is a modern application that knows about DPI scaling itself. Windows' automatic scaling apparently doesn't work so well when dealing with non-client coordinates, which Simutrans does for tracking mouse movements when panning. What the manifest actually does is enable support for proper DPI scaling. Simutrans just ignores the new messages, for now. To recreate what Windows did, with the GDI backend, Simutrans would need to have the size of AllDibData not track the size of the window 1:1, but at the scale reported by Windows, and to similarly scale mouse coordinates. It would make Simutrans look more blurry, unless the scaling 200%, 300% or such, than it would look as if your screen had half, third or so on the resolution. The only solution to that is a total rewrite of Simutrans' graphics system, and much more pixels from the artists.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 17636
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Simutrans in 4k?
« Reply #5 on: April 10, 2016, 11:02:04 AM »
Thank you for that explanation: that is very interesting. I think that 200% scaling would be viable and sensible for 4k (4k being exactly 4x the number of pixels of 1808p HD for usually similar screen sizes). Could optional 200% scaling be implemented easily in the manifest (and, if so, how would one activate it; my apologies for being ignorant of the ways of the manifest)?

From what I understand, tiny text is not the only potential problem with Simutrans in 4k; another problem is likely to be performance from the CPU having to render so many pixels on screen at once. Has anyone tried this with a reasonably powerful computer (e.g. Core i5, Core i7) to see whether this is indeed a problem?

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5315
  • Languages: EN, NO
Re: Simutrans in 4k?
« Reply #6 on: April 10, 2016, 11:44:05 AM »
Could optional 200% scaling be implemented easily in the manifest (and, if so, how would one activate it; my apologies for being ignorant of the ways of the manifest)?

Nope. Windows either "transparently" fakes all the scaling for you, or you handle them all yourself.

Has anyone tried this with a reasonably powerful computer (e.g. Core i5, Core i7) to see whether this is indeed a problem?

Those names have been around for years. My impression is also that most of the performance enhancing developments in the last five years have been in GPU/VRAM, and in the switch from disks to solid state drives, neither of which benefit Simutrans.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 17636
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Simutrans in 4k?
« Reply #7 on: April 10, 2016, 01:51:49 PM »
Nope. Windows either "transparently" fakes all the scaling for you, or you handle them all yourself.

Ahh - could Simutrans handle internal 200% scaling, in that case without a major rewrite?

Quote
Those names have been around for years. My impression is also that most of the performance enhancing developments in the last five years have been in GPU/VRAM, and in the switch from disks to solid state drives, neither of which benefit Simutrans.

Yes, indeed; my own CPU is a first generation i7. There have been some improvements in memory bandwidth since then, I think, which is definitely relevant to Simutrans. However, does anyone have any idea how Simutrans performs in 4k on any machine?

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5315
  • Languages: EN, NO
Re: Simutrans in 4k?
« Reply #8 on: April 10, 2016, 03:14:14 PM »
Ahh - could Simutrans handle internal 200% scaling, in that case without a major rewrite?
I think that is the thing prissi mentioned. It is possible that isn't playing along with the DPI scaling set in the OS.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9238
  • Languages: De,EN,JP
Re: Simutrans in 4k?
« Reply #9 on: April 10, 2016, 10:04:36 PM »
You can scale the GUI bei using the right theme and scale the tools by changing menucof.tab (or do this in the themes as well). THe only thing not scalable to such a degree ist the font size.

Offline TurfIt

  • Dev Team, Coder/patcher
  • Devotee
  • *
  • Posts: 1301
Re: Simutrans in 4k?
« Reply #10 on: April 11, 2016, 07:27:46 PM »
Ahh - could Simutrans handle internal 200% scaling, in that case without a major rewrite?
The SDL2 backend can handle this scaling easily, simply create the render surface at a different size from the window. I tried this when the Macs were having performance problems, but the change to SDL2 itself solved the issue, so didn't continue.  IIRC the mouse coords need to be scaled by Simutrans for the UI to work.


However, does anyone have any idea how Simutrans performs in 4k on any machine?
3840x2160 is only ~2x the pixels of 2560x1600 which works just fine. I'd expect a single digit framerate at full zoom out, but that'd be so small at 4K anyway to be useful. And assuming 4 threads on a quadcore processor.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 17636
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Simutrans in 4k?
« Reply #11 on: May 01, 2016, 11:50:01 PM »
I have spent some considerable time researching and now upgrading my monitors. I did go for a 4k monitor in the end (together with a smaller 1440p monitor used in portrait format beside it).

I do not find the text in Simutrans too small on a 4k monitor at 100% scaling, but I went for a large monitor (32" diagonal) on the basis that anything smaller would be of such high resolution as to exceed that which can be perceived by the eye at normal viewing distances. The provisional conclusion from this is that finding the text too small in Simutrans at 4k is largely a function of having too small a 4k monitor (people are selling 27" and even 23" 4k monitors, which is insane).

As to performance, zoomed all the way out on a busy map is a little slow, but it is not unserviceably slow, at least on my computer (Core i7 950).

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5315
  • Languages: EN, NO
Re: Simutrans in 4k?
« Reply #12 on: May 02, 2016, 05:06:22 AM »
Others say buying a 32" desktop monitor is crazy, because you need to start turning your head to see the edges, which is bad ergonomics. Unless you put the monitor farther away, which mostly cancels the effect of having a bigger screen, which has an to me unknown effect on the well-being of the eyes.

Offline sdog

  • Devotee
  • *
  • Posts: 2039
Re: Simutrans in 4k?
« Reply #13 on: May 02, 2016, 07:32:03 AM »
Others say buying a 32" desktop monitor is crazy, because you need to start turning your head to see the edges, which is bad ergonomics. Unless you put the monitor farther away, which mostly cancels the effect of having a bigger screen, which has an to me unknown effect on the well-being of the eyes.
A larger distance to the monitor is, in general, better. To accommodate close the ciliary muscles stretch the lens, which is at least tiring, and at worst harmful when done extensively.

I am also not certain that turning the head is ergonomically bad. This could tempt the user to also change their posture. However, I doubt that tilting the head is even necessary, since our eyes are not fixed in our heads, and cover more than 180 degree. Even with a much smaller screen only  a small area is actually in the area of sharpest vision and an even smaller part in our perception. All this is just speculation, however.

Offline el_slapper

  • *
  • Posts: 210
  • Languages: FR, EN, DE
Re: Simutrans in 4k?
« Reply #14 on: May 02, 2016, 12:22:23 PM »
My professional laptop is a 15"3 with a 3200*1800 resolution. Some colleagues even have a 3800*???? for the same size. Simutrans works well on it...when I did set up Windows for everything being doublesized.

Of course, I don't play in the open space. Only when I'm away in an hotel room.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5315
  • Languages: EN, NO
Re: Simutrans in 4k?
« Reply #15 on: May 02, 2016, 03:26:15 PM »
I am also not certain that turning the head is ergonomically bad. This could tempt the user to also change their posture. However, I doubt that tilting the head is even necessary, since our eyes are not fixed in our heads, and cover more than 180 degree. Even with a much smaller screen only  a small area is actually in the area of sharpest vision and an even smaller part in our perception. All this is just speculation, however.

Well, that depends on how often you have to switch focus from side to side. Looking dead ahead for hours can't be too good either. And this small area of sharp vision means that out 180 degree total vision means little when it comes to Simutrans. I also feel a bit more strain if I read with my eyes turned too much from straight ahead.

In Simutrans, I've usually aligned my simu-windows around he edges of the viewport, leaving a viewport to the world in the middle. When I do that, I often need to switch focus from one side to another. I could chose to put all the windows to one side, but that would mean that go-to actions and follow vehicle won't center on the center of what I see of the world.

Offline Alley

  • *
  • Posts: 1
Re: Simutrans in 4k?
« Reply #16 on: August 22, 2016, 06:37:53 AM »
My professional laptop is a 15"3 with a 3200*1800 resolution. Some colleagues even have a 3800*???? for the same testogen bottles size. Simutrans works well on it...when I did set up Windows for everything being doublesized.

Of course, I don't play in the open space. Only when I'm away in an hotel room.

I didn't notice any difference in 4k to what it normally looks like.
« Last Edit: April 12, 2017, 01:24:27 PM by Alley »

Offline gmc

  • *
  • Posts: 3
  • Languages: EN, NL, DE
Re: Simutrans in 4k?
« Reply #17 on: September 23, 2016, 08:50:50 PM »
I haven't played simutrans in a year now, after having played it intensively for at least 10 years. I really miss it. However, once I had to replace my laptop and got a 4K screen the game became unplayable. The font is so small, I can't read anything without moving my eyes to a few cm from the screen (and that is with my glasses on :). I'm on linux, so none of the windows tricks above are any good for me.

If anyone knows how to make the game playable again, i'd be very happy to hear about it. Then again, now that I can't play simutrans i have tons of time again so maybe it is for the better this way :)

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 17636
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Simutrans in 4k?
« Reply #18 on: September 23, 2016, 09:14:59 PM »
Can you use scaling?

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5315
  • Languages: EN, NO
Re: Simutrans in 4k?
« Reply #19 on: September 23, 2016, 09:56:35 PM »
If anyone knows how to make the game playable again, i'd be very happy to hear about it.

Changing your display settings so that you only have a quarter of the number of pixels is the only thing I know that should work.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9238
  • Languages: De,EN,JP
Re: Simutrans in 4k?
« Reply #20 on: September 23, 2016, 11:20:49 PM »
The next nightly in GDI version will have a switch (-autodpi" to scale according to DPI setting. It will be ugly though, because it just scales the main display bitmap using the windows functions.

Offline An_dz

  • Web Admin
  • Administrator
  • *
  • Posts: 2831
  • D'oh
    • by An_dz
  • Languages: pt, en, it, (de)
Re: Simutrans in 4k?
« Reply #21 on: September 24, 2016, 07:34:26 AM »
Unfortunately the user is on Linux, so the next nightly is still useless for gmc.

Offline DrSuperGood

  • Dev Team
  • Devotee
  • *
  • Posts: 2496
  • Languages: EN
Re: Simutrans in 4k?
« Reply #22 on: September 24, 2016, 01:33:28 PM »
Maybe add a scaling setting? Simple nearest pixel scaling in natural number multiples. SDL and SDL2 should surely support hardware acceleration of such scaling as part of composition.

Offline gmc

  • *
  • Posts: 3
  • Languages: EN, NL, DE
Re: Simutrans in 4k?
« Reply #23 on: September 24, 2016, 07:09:25 PM »
Changing your display settings so that you only have a quarter of the number of pixels is the only thing I know that should work.

I feared as much. I guess i'll have to change the resolution whenever I want to play simutrans for now then. I've been looking at the code a bit, seems it would be rather straighforward to add some scaling to the SDL backend, as most of the relevant bits seem to be neatly together in the one .cc file. Might give that a go sometime if I can find some time.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5315
  • Languages: EN, NO
Re: Simutrans in 4k?
« Reply #24 on: September 24, 2016, 08:12:32 PM »
That would be appreciated. You can probably look at what has been done for the GDI backend. I suspect that something similar should be possible for the other backends, but as I neither have the actual problem, nor have SDL available for my build system, plus a lot of other changes I'm still playtesting (I've just recently started playing again after almost a year of almost nothing), it isn't so easy for me to look into this.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9238
  • Languages: De,EN,JP
Re: Simutrans in 4k?
« Reply #25 on: September 25, 2016, 09:33:05 PM »
ANd added autoscaling for SDL2 (was quite straight forward, but requires SDL2.0.4 for getting DPI informations).

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9238
  • Languages: De,EN,JP
Re: Simutrans in 4k?
« Reply #26 on: October 08, 2016, 01:22:56 PM »
To this thread: Simutrans now support automatic scaling according to the DPI set in GDI and SDL versions when using the switch -autodpi on the commandline. Having said that, on my computer both SDL and GDI only used simple pixel doubling routinges, which were ugly.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5315
  • Languages: EN, NO
Re: Simutrans in 4k?
« Reply #27 on: October 08, 2016, 05:46:33 PM »
Having said that, on my computer both SDL and GDI only used simple pixel doubling routinges, which were ugly.
On a 4K screen or a "regular"/HD screen?

I'm not sure other scaling methods, such as bilinear filtering, will look any better. In fact it might just become a blur. Simply scaling up the pixels by an integer factor is what I prefer for old games, and it is what is used by retro games. ScummVM has several options for scaling, but I find the only one worth using other than simply scaling the pixels, is one that does some rather fancy edge detection and enhancement.

Offline DrSuperGood

  • Dev Team
  • Devotee
  • *
  • Posts: 2496
  • Languages: EN
Re: Simutrans in 4k?
« Reply #28 on: October 08, 2016, 07:55:40 PM »
The DPI scaling is mostly needed for the UI. One can use normal mouse scroll zoom for the actual game play to keep it a usable size.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9238
  • Languages: De,EN,JP
Re: Simutrans in 4k?
« Reply #29 on: October 08, 2016, 09:54:03 PM »
I used the stretching blitting routines, and it seems that (at least on this computer) for 16 bit modes no bilinear or any other filtering is in place; while with no dpi scaling enabled windows itself scaled the 32 bit output in a filtered way.

Offline RandallRay

  • *
  • Posts: 1
  • Languages: EN, FR
Re: Simutrans in 4k?
« Reply #30 on: October 01, 2018, 03:45:59 PM »
On a 4K screen or a "regular"/HD screen?

I'm not sure other scaling methods, such as bilinear filtering, will look any better. In fact it might just become a blur. Simply scaling up the pixels by an integer factor is what I prefer for old games, and it is what is used by retro games. ScummVM has several options for taking this supplement called phenq and it can  scaling, but I find the only one worth using other than simply scaling the pixels, is one that does some rather fancy edge detection and enhancement.

So, will it look good on a 4K monitor or not? I'm planning to buy one but only if I'm able to enjoy the graphics.
« Last Edit: October 13, 2018, 02:27:16 PM by RandallRay »

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5315
  • Languages: EN, NO
Re: Simutrans in 4k?
« Reply #31 on: October 01, 2018, 04:10:20 PM »
So, will it look good on a 4K monitor or not? I'm planning to buy one but only if I'm able to enjoy the graphics.
What looks good is a matter of opinion. In any case, Simutrans won't automatically look better. You will need a higher resolution pak set, GUI theme and font for that. And it will put a greater strain on your computer as the CPU will have to process a lot more pixels. Otherwise, whether scaling artifacts are bothersome depends on how big your 4K monitor is, I guess.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 17636
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Simutrans in 4k?
« Reply #32 on: October 01, 2018, 06:56:06 PM »
With my large (31") 4k monitor with a 128 sized pakset, I find that it looks good. If you have a smaller 4k monitor (e.g. 27"), it may not look so good - but I do not recommend a 27" 4k monitor in any event, as the dot pitch is too small for much of the resolution to be use-able. 4k is only sensible for a large monitor.

Offline DrSuperGood

  • Dev Team
  • Devotee
  • *
  • Posts: 2496
  • Languages: EN
Re: Simutrans in 4k?
« Reply #33 on: October 01, 2018, 09:23:41 PM »
The point of 4k is that the pixel elements are so small you cannot resolve them... For real time graphics it reduces the necessity of anti aliasing, to the point that simple efficient full screen filters are enough. Our eyes operate using filters so we are effected by visual features smaller than what we can reliably resolve.

The problem is that there is a maximum zoom limit that does not factor in display density. For 4k displays one should have an extra 2x zoom. Additionally one should have an option to reduce the resolution Simutrans is drawn at to 1080p (2k) and up scale to 4k. As long as nearest scaling is used it should look pretty good even on smaller 4k displays.