News:

Do you need help?
Simutrans Wiki Manual can help you to play and extend Simutrans. In 9 languages.

Steam simutrans does not work

Started by prissi, September 07, 2016, 12:20:52 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

prissi

I tried to start simutrans from steam on five different computers, and on none of them it worked; instead it crashed after one second. It were two windows 7 x64 systems (one greman, und britisch english), and two Windows10 x64 computers, and a windows 10 i32 tablet.

I really think some library is not correctly installed or there is some other problem. But given failure on all systems I am surprised it works for somebody at all.

Yona-TYT


TurfIt

Is it simutrans crashing? or the preloader?
Are you launching from within Steam, or directly from the .exe(s)?  If from the .exe, with Steam running?  (I note the preloader.exe crashes immediately if Steam is not runnning)
Steam overlay enabled?  (Even with it enabled, I can't get it to open... Thought it used to work.)
Full screen or windowed? (and see Steam preloader for some isses I had with the selections in the preloader.)

HaydenRead

I will try doing a clean install of Steam & Simutrans on a Windows computer and see what happens, as it works fine for me at the moment on my computers (Win 10 Home, Win 10 Pro, and Ubuntu).
(Won't be able to do this till tomorrow, as I am currently away from home on a business trip).

prissi

#4
I downloaded it from steam and when I doobleclick the provided item the preloader comes up, but any combinations opens a window for a split second and closes it.

Also steams seems to hide the exe pretty well, as the icon is just a steamID link. Where would be the exe located?

EDIT: Found it. It is 6.9 MB large, why that size? Anyway, it does not start there too. And why include debug symbols but no debug messages? The only debug output I get is
Quote
Simutrans version 120.1.3 from Jun  8 2016 r7753
Preparing display ...

HaydenRead

Just one possibility, would all the computers you have used, be using Intel Graphics?
Can you check if going into properties / beta and changing to gdi_ resolves the issue.
I am looking at finding a way to automatically fall back to gdi_ if it doesn't launch with the SDL2 version (seems to be something strange in the Intel OpenGL support).
(The reason for using SDL2 in the first place is that it allows the Steam Overlay / Steam Screenshots, etc - the preloader also uses SDL2, but forces software render for more support, Simutrans quits out if it can't get an OpenGL render context for SDL2).

TurfIt

Do other opengl programs work on your computers? How about SDL2/opengl ones?

What you see output to stdout and stderr? (You'll have to redirect to file since SDL2 hijacks these, or self compile with the console enabled)
Should have:

Use work dir S:\g\SteamLibrary\steamapps\common\Simutrans\
Reading low level config data ...
parse_simuconf() at config/simuconf.tab: Reading simuconf.tab successful!
SDL Driver: windows
Preparing display ...
Renderer: direct3d, Max_w: 0, Max_h: 0, Flags: 14, Formats: 1, SDL_PIXELFORMAT_ARGB8888,
Renderer: direct3d11, Max_w: 0, Max_h: 0, Flags: 14, Formats: 4, SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_YV12, SDL_PIXELFORMAT_IYUV,
Renderer: opengl, Max_w: 0, Max_h: 0, Flags: 14, Formats: 1, SDL_PIXELFORMAT_ARGB8888,
Renderer: opengles2, Max_w: 0, Max_h: 0, Flags: 14, Formats: 4, SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_BGR888,
Renderer: software, Max_w: 0, Max_h: 0, Flags: 9, Formats: 8, SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_RGB565, SDL_PIXELFORMAT_RGB555,
Using: Renderer: opengl, Max_w: 16384, Max_h: 16384, Flags: 10, Formats: 5, SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_YV12, SDL_PIXELFORMAT_IYUV, SDL_PIXELFORMAT_NV12, SDL_PIXELFORMAT_NV21,
Loading font 'font/prop.fnt'
font/prop.fnt successfully loaded as old format prop font!
Init done.

although the Steam build is missing the direct3d11 renderer... perhaps Hayden used an old SDL2?

and from running Steam simutrans.exe -debug 3 -log

Simutrans version 120.1.3 from Jun  8 2016 r7753
Warning: simwin.cc themes_init(): Can't read themes from Simutrans (standard size)
Warning: simwin.cc themes_init(): Can't read themes from Simutrans (standard size)
Preparing display ...
parse_simuconf() at pak/config\simuconf.tab:
{snip}

so it seems your computers can't init the SDL2 backend.

prissi

Since 85% of the computer are currently with chipset graphics (almost any cheap laptop), that is almost a no go to deploy something that would not work there.
However at least one of them was using an ancient NVidia GPU Card (from 2007 with 64 MB ram) with the windows 7 default drivers, and one had AMD chipset graphics. Do you mean SDL2 does not run on any Laptop then?

The stderr messages on this laptop (other are not accessible right now) are
"Simutrans version 120.1.3 from Jun  8 2016 r7753
Couldn't create renderer: Couldn't load GL function glBlendFuncSeparate:

Error: can't open window!"
and
"Use work dir C:\PROGRA~2\Steam\STEAMA~1\common\SIMUTR~1\
Reading low level config data ...
parse_simuconf() at config/simuconf.tab: Reading simuconf.tab successful!
parse_simuconf() at C:\Users\prissi\DOCUME~1\SIMUTR~1\simuconf.tab: Reading simuconf.tab successful!
SDL Driver: windows
Preparing display ...
Renderer: direct3d, Max_w: 0, Max_h: 0, Flags: 14, Formats: 1, SDL_PIXELFORMAT_ARGB8888,
Renderer: opengl, Max_w: 0, Max_h: 0, Flags: 14, Formats: 1, SDL_PIXELFORMAT_ARGB8888,
Renderer: opengles2, Max_w: 0, Max_h: 0, Flags: 14, Formats: 4, SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_BGR888,
Renderer: software, Max_w: 0, Max_h: 0, Flags: 9, Formats: 8, SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_RGB565, SDL_PIXELFORMAT_RGB555,
Error: can't open window!
"

DrSuperGood

Some suggestions...
Try updating the intel graphic drivers on Windows computers. Default ones installed by the operating system might not come with any decent OpenGL support as OpenGL beyond deprecated functionality is not required by modern Windows operating systems (it is entirely optional and up to the driver manufacturer to install).
Try linking a newer/nightly version of SDL2. Maybe this issue was identified in the past and has been resolved between major releases.

prissi

I mean, i I cannot run them, then the chance a normal user can run them are next to zero. Of course I can linkt them myself, and at least an older version last year with SDL2 did start.

TurfIt

Anybody trying to run games on Windows should have it drilled into their heads by now to update their drivers.... and use the specific drivers for their graphics chip - default generic Windows drivers are just to let it boot enough to allow you to install the proper ones.

I can't find any documentation on SDL2's version requirements for opengl, but the function it's complaining about requires v1.4. So you're back to 2002 for AMD and Nvidia, and 2005 for Intel to support it. That's sufficiently ancient IMHO...

The whole point of having you try a self build version is simply to help narrow down if there's a problem we need to fix with Simutrans and/or the Steam build, or just a problem with your computer configuration.

Development of the SDL2 backend was focussed solely on fixing the OSX performance issue with SDL1. Testing on Linux was non-existant, and only minimal Windows testing. Especially when MinGW wouldn't work with it anymore, I stopped using it. The renderer is being forced to opengl becuase at the time, the directx renderer was giving a massive memory leak that would crash the game in short order. Forcing opengl was a quick hack that worked, and since SDL2 had only been released for OSX which has a working opengl by default - no problems. It's perhaps worthwhile to now check if the directx issues have been fixed. But, you'll still need proper video drivers installed.

prissi

SDL2 has full unicode IME support, which is the main advantage. And it properly uses the inline IME, so it is actually the best backend (imho). At that time (with windows XP in 32 bit mode) it worked nicely.

But for my GPU (it is a Radeon X700) there are no newer drivers. For my laptop I use the current Intel driver. Same for the other Windows7 desktop, which uses the latest stable intel driver.

It seems that opgengl rendering does not support RGB565 any more, but the driver selects the opengl renderer anyway. Docu for Win7 x64 is that is does not support 565 in GDI, even though it actually does.

Solution is to check that the requested driver can actually handle the format and otherwise fallback on a driver with support (usually the software renderer). See latest revision.


TurfIt

I trust you're using that X700 on XP or Vista? It's not supported on Win7 or newer...
The error you previously posted occurs before the 565 texture is even attempted, so that's not what your problem is. If you are running a X700 on Win7 using a generic MS driver, then you don't have proper opengl support at all.

The latest revision completely breaks this. Note the output I posted above with opengl only showing ARGB8888 when the render driver is queried. However upon creating the renderer, it then reports  SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_YV12, SDL_PIXELFORMAT_IYUV, SDL_PIXELFORMAT_NV12, SDL_PIXELFORMAT_NV21. There's still no RGB565 listed, yet creating the 565 texture works just fine.

With r7875:
SDL Driver: windows
Preparing display ...
Message: simmain:       simgraph_init disp_width=1600, disp_height=1200, fullscreen=0
Message: internal_create_surfaces():    Renderer: direct3d, Max_w: 0, Max_h: 0, Flags: 14, Formats: 1, SDL_PIXELFORMAT_ARGB8888
Message: internal_create_surfaces():    Renderer: direct3d11, Max_w: 0, Max_h: 0, Flags: 14, Formats: 4, SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_YV12, SDL_PIXELFORMAT_IYUV
Message: internal_create_surfaces():    Renderer: opengl, Max_w: 0, Max_h: 0, Flags: 14, Formats: 1, SDL_PIXELFORMAT_ARGB8888
Message: internal_create_surfaces():    Renderer: opengles2, Max_w: 0, Max_h: 0, Flags: 14, Formats: 4, SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_BGR888
Message: internal_create_surfaces():    Renderer: software, Max_w: 0, Max_h: 0, Flags: 9, Formats: 8, SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_RGB565, SDL_PIXELFORMAT_RGB555
Warning: internal_create_surfaces():    Using fallback render software instead of opengl: Performance may be low!
Message: internal_create_surfaces():    Using: Renderer: software, Max_w: 0, Max_h: 0, Flags: 9, Formats: 8, SDL_PIXELFORMAT_RGB565
Message: dr_os_open(SDL):       SDL realized screen size width=1600, height=1200 (requested w=1600, h=1200)
Loading font 'font/prop.fnt'
font/prop.fnt successfully loaded as old format prop font!
Init done.

Performance may be low is rather an understatement. It take 5 seconds to resize the screen! Instantaneous when using the gl renderer. Please revert and make sure your computer actually has opengl support before removing it from Simutrans.

DrSuperGood

It makes sort of sense that modern hardware does not support "SDL_PIXELFORMAT_RGB565" because nothing in its right mind should be using it in a day where 32bit colour is a requirement (Windows 8 and newer) and HDR is the talk of the future.

What if an internal adapter was made in the case of unsupported formats to translate the 565 output of Simutrans software renderer to more universally supported 8888? This would need an entire screen pass (memory I/O heavy) but should hopefully solve the problems.

Maybe there is some way to make SDL do the conversion on hardware? For a modern GPU to convert from 565 to 8888 or whatever is needed should be trivial.

prissi

TurfIt: I tested my patch on the computers I have and with it simutrans works and without it does not. Not on my developing machine (with the internal X700 also called X1200), not on my laptop nor the tablet, both using intel chipsets.

The function that fails is actually the creating of the renderer. I changed the code to use opengl, and only use the fallback if creating the renderer fails. It will try then all the other renderer, i.e. direct3d will be used otherwise.

Since opengles crashes upon calling SDL_CreateRenderer, the software renderer is probably never used.

HaydenRead

I am doing a bit of work on the preloader at the moment.
One of the items I am looking at including is a timer along the lines of "If Simutrans opens for less than 2 seconds set option to launch GDI version, and relaunch application."
The other item I am looking at is the possibility of capturing any errors generated, and feeding them back, so that it is easier to track down any issues (but documentation of Steams Error reporting system is pretty sparse).

prissi

I think the latest revision should avoid this, by just using the direct3d renderer if opengl fails. It might be still faster than GDI ...

prissi

The last changes to allow for SDL2 rendering even if OpenGL chooses wrongly is still not on steam, it seams. May I suggest a patch using the r7874-7876 patches . Because locally I can start an SDL2 game, but the steam games still crashes (now after flickering 5 times ...)

Also were is the Debug tab on steam for simutrans?

HaydenRead

Quote from: prissi on October 28, 2016, 09:20:22 PM
The last changes to allow for SDL2 rendering even if OpenGL chooses wrongly is still not on steam, it seams. May I suggest a patch using the r7874-7876 patches . Because locally I can start an SDL2 game, but the steam games still crashes (now after flickering 5 times ...)

Also were is the Debug tab on steam for simutrans?
Hi, I will take a look at applying these patches to Steam. Generally I am trying to keep the Steam version the same as the 'Stable Release', so had been waiting for the next 'Stable Release' before updating Steam, but I will get this updated with the listed patches.

prissi

Even the new release does not run on any of the five computers I tested it. (One tablet, two laptops and two desktops, either an old Nvidia in one of the desktops, otherwise chipset graphics.) Given how many people use laptop nowadays, I find this a little worrysome.