Author Topic: TFTD crash at 5120x2160  (Read 2845 times)

Offline Peter

  • Squaddie
  • *
  • Posts: 4
    • View Profile
TFTD crash at 5120x2160
« on: March 28, 2023, 05:49:53 pm »
Starting a new game of OpenXCom TFTD at resolution 5120x2160 crashes to desktop. The menu at the resolution is fine. Starting at 3440x1440 works fine. Log attached

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9055
    • View Profile
Re: TFTD crash at 5120x2160
« Reply #1 on: March 28, 2023, 06:06:59 pm »
Wow, that's an interesting one!

The log is actually useful in this case, but I can't see the problem at the first look.

I'll need to find someone with a huge monitor, or reproduce the issue by some hacking around.

Thanks for reporting, we will look into it.

Offline Peter

  • Squaddie
  • *
  • Posts: 4
    • View Profile
Re: TFTD crash at 5120x2160
« Reply #2 on: March 28, 2023, 06:34:33 pm »
You may be able to run at higher resolution than that of your monitor via DSR/VSR.

Online Yankes

  • Commander
  • *****
  • Posts: 3326
    • View Profile
Re: TFTD crash at 5120x2160
« Reply #3 on: March 28, 2023, 07:31:26 pm »
Some workaround is reduce base resolution, with this less memory will be allocated and game would not crash.
Overall lot of logic there were designed for 320x200 base resolution, this is 100 time less pixel that on your screen.

Offline R1dO

  • Colonel
  • ****
  • Posts: 441
    • View Profile
Re: TFTD crash at 5120x2160
« Reply #4 on: March 29, 2023, 12:40:43 am »
I am kinda wondering, are you using full-screen or windowed/borderless?

Reason for asking:
Full-screen requires a display that actually supports such a resolution. On some systems it is allowed to define windows that are larger than supported by the display.
If the crash occurs in windowed mode there might be no (or less) need for any hacks/workarounds.

Forcing the reported window size of 5120x2160 (on my 2560x1440 screen) i was not able to reproduce (e.g. game made it to the geoscape when starting a game).
Unfortunately i am using a different OS which makes such a 'cannot reproduce' kinda weak.

On a sidenote:
Even if able to run at this resolution you might not like the result though.
It seems that such a resolution is approaching the limit of numerical calculations (see attached '5120x2160globe_cutout.png').

For reference: the settings i used are shown in the 'settings.png' attachment.
Some further observations (valid for "being able to run" and "resulting image"):
* Displayfilters *raw/disabled/scale gave identical results
* Option "letterboxed" did not influence the result
* Globe returns to normal when using any geoscape scale bigger than "1x" (for this resolution)

Online Yankes

  • Commander
  • *****
  • Posts: 3326
    • View Profile
Re: TFTD crash at 5120x2160
« Reply #5 on: March 29, 2023, 02:20:58 am »
Can compile code you can try checkout this commit:
https://github.com/Yankes/OpenXcom/commit/2d7828f52ef36938044ee334f91f3efe653c4a70
it add new user option `globeSurfaceCache: true` that disable cache and allocation should be not problem.
(I see invert meaning of this config, should be opposite, in next version it would have more intuitive usage)

Offline Peter

  • Squaddie
  • *
  • Posts: 4
    • View Profile
Re: TFTD crash at 5120x2160
« Reply #6 on: April 09, 2023, 07:19:52 am »
On a repro retry I found, the crash happens on a new game at 5120x2160p when geo/battle scales are set to Full Display. I am running in Fullscreen mode. It doesn't crash when the scales are set to 2xOriginal, which I am actually using for a playthrough. Full Display scale at such high resolution is very tiny, at least the menu is so it's not too practical for a general gameplay.

Online Yankes

  • Commander
  • *****
  • Posts: 3326
    • View Profile
Re: TFTD crash at 5120x2160
« Reply #7 on: April 10, 2023, 12:04:01 am »
did you try last build from https://openxcom.org/git-builds/ ?
I added option I previous mentioned to allow skipping some allocations for globe.

Offline Peter

  • Squaddie
  • *
  • Posts: 4
    • View Profile
Re: TFTD crash at 5120x2160
« Reply #8 on: April 10, 2023, 03:03:41 am »
Yes, it crashes on 4/1 build as well
« Last Edit: April 10, 2023, 03:14:09 am by Peter »

Online Yankes

  • Commander
  • *****
  • Posts: 3326
    • View Profile
Re: TFTD crash at 5120x2160
« Reply #9 on: April 10, 2023, 03:31:26 am »
Yes, it crashes on 4/1 build as well
Ok, I probably give wrong value for new config, it should be `globeSurfaceCache: false`