News:

SimuTranslator
Make Simutrans speak your language.

Simutrans in 4k?

Started by jamespetts, April 09, 2016, 05:54:37 PM

Previous topic - Next topic

0 Members and 3 Guests are viewing this topic.

jamespetts

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.
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.

Ters

Quote from: jamespetts on April 09, 2016, 05:54:37 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.

jamespetts

Quote from: Ters on April 09, 2016, 07:16:50 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.
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.

prissi

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.

Ters

Quote from: prissi on April 09, 2016, 08:10:46 PM
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.

jamespetts

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?
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.

Ters

Quote from: jamespetts on April 10, 2016, 11:02:04 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.

Quote from: jamespetts on April 10, 2016, 11:02:04 AM
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.

jamespetts

Quote from: Ters on April 10, 2016, 11:44:05 AM
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?

QuoteThose 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?
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.

Ters

Quote from: jamespetts on April 10, 2016, 01:51:49 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.

prissi

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.

TurfIt

Quote from: jamespetts on April 10, 2016, 01:51:49 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.


Quote from: jamespetts on April 10, 2016, 01:51:49 PM
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.

jamespetts

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).
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.

Ters

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.

sdog

Quote from: Ters 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.
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.

el_slapper

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.

Ters

Quote from: sdog on May 02, 2016, 07:32:03 AM
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.

gmc

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 :)

jamespetts

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.

Ters

Quote from: gmc on September 23, 2016, 08:50:50 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.

prissi

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.

An_dz

Unfortunately the user is on Linux, so the next nightly is still useless for gmc.

DrSuperGood

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.

gmc

Quote from: Ters on September 23, 2016, 09:56:35 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.

Ters

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.

prissi

ANd added autoscaling for SDL2 (was quite straight forward, but requires SDL2.0.4 for getting DPI informations).

prissi

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.

Ters

Quote from: prissi on October 08, 2016, 01:22:56 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.

DrSuperGood

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.

prissi

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.

RandallRay

#29
Quote from: Ters on October 08, 2016, 05:46:33 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.

Ters

Quote from: RandallRay on October 01, 2018, 03:45:59 PMSo, 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.

jamespetts

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.
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 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.

JamesWolfe

#33
Quote from: jamespetts 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 good phenq review much of the resolution to be use-able. 4k is only sensible for a large monitor.

Yes, this is the correct analysis of 4K. You need 4k only where 1080p is not sufficient. Otherwise, 4k is just a show-off (in my opinion) and you have to compromise with losing the beauty of some software and games due to 4k resolution.

prissi

Again adding that simutrans can do the scaling (if you request "-autodpi" on the commandline) or uses the windows compatibly settings. But for me (I have a 4k display on a 11" laptop) 4k is a nuisance, really.