Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Story scenes do not render properly (black screen) #4245

Closed
Konrad22 opened this issue Aug 17, 2019 · 36 comments
Milestone

Comments

@Konrad22
Copy link
Contributor

@Konrad22 Konrad22 commented Aug 17, 2019

I'm stuck with a black screen. The window still reacts, I get my nice cursor. I just can't do anything with wesnoth except close it (which works as if everything else was fine as well).

Windows 10, 1.15.0
To reproduce: Load the savefile and try to proceed without using 'esc'.
https://cdn.discordapp.com/attachments/259976436490829825/612047813915705405/SotA-Mortality.gz
If you skip the talking by pressing esc when Ras-Tabahn speaks (for the first time, which is also the last things thats said) or earlier, then everthing works fine.

@sigurdfdragon

This comment has been minimized.

Copy link
Contributor

@sigurdfdragon sigurdfdragon commented Aug 17, 2019

Can't reproduce with the attached save or my own using either esc or not.
I get the game moving on as expected tested against current master

@sigurdfdragon sigurdfdragon self-assigned this Aug 17, 2019
@Konrad22

This comment has been minimized.

Copy link
Contributor Author

@Konrad22 Konrad22 commented Aug 20, 2019

As you can see, this bug is still present in 1.15.1 and is not just about SotA. (E.g. HttT, The Elven Council)
grafik
grafik

Apparently it does not actually turn unresponsive. It's just that everything turns black and the player becomes unable to see the dialog. I can make the message visible again by pressing any arrow key, at least until tabbing away.
grafik
This doesn't make any sense to me.

@Konrad22 Konrad22 changed the title 1.15, SotA S17 can result in an unresponsive black screen 1.15, Dialog scenarios can turn into black screen Aug 20, 2019
@Konrad22

This comment has been minimized.

Copy link
Contributor Author

@Konrad22 Konrad22 commented Aug 20, 2019

There is also this, which might be related.
grafik
Mousing over hexes or tabbing out 'fixes' it though.

@Konrad22

This comment has been minimized.

Copy link
Contributor Author

@Konrad22 Konrad22 commented Aug 21, 2019

I have exactly the same issues on a different pc of mine. @Wedge009 remembered encountering something like the last screenshot with a bad graphics driver bug.
I have Intel(R) HD Graphics 520 on one and NVIDIA GeForce 9600 GT on the other.

@grz0

This comment has been minimized.

Copy link

@grz0 grz0 commented Aug 29, 2019

I have an issue on Linux which may be related to this one
#4196

@Wedge009

This comment has been minimized.

Copy link
Member

@Wedge009 Wedge009 commented Aug 29, 2019

Haven't yet had time to test my various platforms but would be interesting to see if there are any common patterns here in terms of graphics hardware, drivers, operating systems, SDL libraries, or even something else entirely.

@Konrad22

This comment has been minimized.

Copy link
Contributor Author

@Konrad22 Konrad22 commented Aug 31, 2019

For some reason I do not encounter this bug when playing 1.15 on steam. But I am guaranteed to encounter it when using the sourceforge version.

@Wedge009

This comment has been minimized.

Copy link
Member

@Wedge009 Wedge009 commented Aug 31, 2019

I didn't realise 1.15 is on Steam already - do you need to opt-in to beta releases?

Would have to confirm with the packagers but I would expect that the Steam version should match the binaries distributed on Sourceforge.

@jostephd

This comment has been minimized.

Copy link
Member

@jostephd jostephd commented Aug 31, 2019

For some reason I do not encounter this bug when playing 1.15 on steam. But I am guaranteed to encounter it when using the sourceforge version.

That's just what you said on #4237. Did you mean to post this to both issues? If so, it's possible they have a common cause.

@Konrad22

This comment has been minimized.

Copy link
Contributor Author

@Konrad22 Konrad22 commented Sep 1, 2019

Yes, I did mean to do that.

@Wedge009
Yes, you have to opt in to beta-realease.

And according to loonycyborg:

sourceforge one is a 64-bit build made with msys2, steam is my old way using 32-bit cross-compiler

@Konrad22

This comment has been minimized.

Copy link
Contributor Author

@Konrad22 Konrad22 commented Sep 3, 2019

Referencing #4309 because this looks very similiar even though the steps are not the same.

@Wedge009

This comment has been minimized.

Copy link
Member

@Wedge009 Wedge009 commented Sep 13, 2019

I got this on Windows, confirmed with the save file attached in the original report but also - surprisingly - just by starting Secret of the Ancients and using debug->choose_level to skip to the Mortality scenario.

Edit: While #4309 looks similar I'd be inclined to treat it as a separate issue. I've seen this kind of thing on Linux before, but never on Windows.

Another edit: I can also replicate this on 1.14.8+dev. It's the same set of circumstances I'm observing for #4237, so I'm thinking there were some graphical changes in both branches since the 1.14.7 release - either that or there's something wrong with my Windows 64-bit compilations (which may well be the case).

@Wedge009

This comment has been minimized.

Copy link
Member

@Wedge009 Wedge009 commented Sep 13, 2019

Consolidated report. Tested:

  • Secret of the Ancients: Mortality (it looks like the screen is being redrawn prematurely, hence everything not being animated going to black)
  • Heir to the Throne: Elven Council (story scene only - I didn't get the black screen problem on the game map)
  • Git code repository pulled as at 2019-09-13 ~09:00 UTC (but problem appears to be have started well before this time)

Where I find the problem does occur:

  • Windows 1.14.8+dev
  • Windows 1.15.1+dev

Where I find the problem does not occur:

  • Windows 1.14.7 release
  • Linux 1.14.8+dev
  • Linux 1.15.1+dev
@Wedge009

This comment has been minimized.

Copy link
Member

@Wedge009 Wedge009 commented Sep 13, 2019

Another place where this occurs: Opening story scene of Delfador's Memoirs. The common thread seems to be that these are all story-only scenarios. I wonder if there's something specific done (or not done) in terms of graphics for story scenes only.

@Wedge009 Wedge009 changed the title 1.15, Dialog scenarios can turn into black screen Story scenes do not render properly (black screen) Sep 13, 2019
@Wedge009

This comment has been minimized.

Copy link
Member

@Wedge009 Wedge009 commented Sep 13, 2019

@Konrad22 From what I read in #wesnoth-dev, 1.15.1 release is 32-bit on Steam and 64-bit as stand-alone build (what you called 'sourceforge version'). Can you verify if you have different results with respect to 32-bit vs 64-bit, please?

@Wedge009

This comment has been minimized.

Copy link
Member

@Wedge009 Wedge009 commented Sep 13, 2019

1.14.7 release is 32-bit on Windows, so everything is fine there from what I can tell. But my 1.14.8+dev compilations are 64-bit on Windows. Will check the refresh command soon.

@Wedge009

This comment has been minimized.

Copy link
Member

@Wedge009 Wedge009 commented Sep 14, 2019

It's a story-only scenario where this happens - I don't think I can enter the :refresh command when a unit is 'speaking'... I had a moment where there was animations happening in SotA Mortality and I snuck in a :refresh then, but the screen kinda flickered between correct drawing and the black screen before the story scenario ended.

@soliton-

This comment has been minimized.

Copy link
Member

@soliton- soliton- commented Sep 15, 2019

Perhaps check if fb1e62c and ee35f6a have any effect on this.

@Wedge009

This comment has been minimized.

Copy link
Member

@Wedge009 Wedge009 commented Sep 16, 2019

Thanks for that, but doesn't appear to be a direct cause in this case. I took 1.14, reverted fb1e62c, and fixed the conflicts as best as I could but I still get the issue afterwards.

@Wedge009

This comment has been minimized.

Copy link
Member

@Wedge009 Wedge009 commented Sep 22, 2019

Just reporting that my brother downloaded the stand-alone 1.15.1 Windows release and also gets this issue as well as #4237. I suspect not many people download the development build (if they do, they probably do it via Steam) so it hasn't had much exposure.

@Pentarctagon Pentarctagon added this to the 1.16.0 milestone Sep 23, 2019
@Pentarctagon Pentarctagon added Blocker and removed Urgent labels Sep 23, 2019
@Wedge009

This comment has been minimized.

Copy link
Member

@Wedge009 Wedge009 commented Sep 24, 2019

Confirming SDL 2.0.10 x64 is responsible. SDL 2.0.9 is fine (though @stevecotton notes there are security issues in the older versions).

@Wedge009

This comment has been minimized.

Copy link
Member

@Wedge009 Wedge009 commented Sep 24, 2019

Disabling the batched renders feature that's default in SDL 2.0.10 seems to resolve this.

Wedge009 added a commit that referenced this issue Sep 24, 2019
* Rendering in batches is default behaviour as of SDL 2.0.10 but causes rendering issues in Wesnoth.
* Fixes #4237
* Fixes #4245
* Not sure if #4309 may benefit as well
@Wedge009 Wedge009 closed this in 6436f90 Sep 24, 2019
@bckpkol

This comment has been minimized.

Copy link

@bckpkol bckpkol commented Nov 1, 2019

On Windows (AMD Mullins+Hainan dual), everything works fine for me.
On two machines, with Arch Linux (Intel HD integrated) and its stable spin Manjaro (AMD Mullins+Hainan dual), 1.12.7 works fine. But not 1.14.9. I can confirm that in SotA black screen happens at the Meeting of the Minds, and in Hammer of Thursagan it happens in the scenario when Angarthing is introduced. But the Bad Moon Rising UMC fails right after the words "I - I have the rock.", which is the first speech ever. Just start the first chapter, skip "Lethal fatique", and it will fire.
Note that if I edit game files, and duplicate the phrase, the same code works for the first time and fails for the second time. I think the bug happens when user clicks to skip just a single sentence and not a whole dialogue (excuse me), and this is not a graphics, but rather an input issue.
And my SDL is exactly 2.0.10-1.

@Wedge009

This comment has been minimized.

Copy link
Member

@Wedge009 Wedge009 commented Nov 1, 2019

1.14.9 release does not have the work-around to disable the batched rendering that's set by default in SDL 2.0.10. This issue is related to story scenes - if you are finding rendering problems specific to input, that is, the issue does not occur in a story scene where dialogue is not skipped, that may be an issue which you should probably report separately. One way to confirm this is if neither downgrading to SDL 2.0.9 nor setting an environment variable to disable batched renders SDL_HINT_RENDER_BATCHING=0 resolves it.

@bckpkol

This comment has been minimized.

Copy link

@bckpkol bckpkol commented Nov 2, 2019

SDL_HINT_RENDER_BATCHING=0 does not solve this. But after downgrading sdl2 package to 2.0.9-1, the problem is gone. And it always occur in the story scene in mainline, and in a very long dialogs like in LotI. And in LotI, the problem usually goes away when I skip all the speech, regain control, and click on any unit. I can't exactly remember, in non-story it's rare. As Konrad22 pointed, moving over a hex restores a hex.
That bug makes Bad Moon Rising unusable on Linux and 1.14.9.
Снимок экрана_2019-11-02_17-18-25
I've attached how it looks like. But, in THoT, I don't have to click, merely moving the mouse is enough. I had to take a few shots, cause window becomes pitch black when it regains the focus.
Oh, and that has nothing to do with render batching.
I may suspect memory corruption, but Wesnoth does not survive Valgrind, so much bugs it has. Also, that requires a debug build for both Wesnoth and SDL.
And I didn't meant I skipped the whole dialogue. I just passed over a first responce.

@Wedge009

This comment has been minimized.

Copy link
Member

@Wedge009 Wedge009 commented Nov 2, 2019

How are you running the hint? At least two of us confirmed that switching batched renders via environment variables resolved this issue for SDL 2.0.10.

Yes, we know moving the mouse in this case is enough to trigger a redraw. If you really think your issue is not batched renders related, please submit a new issue instead of reporting on this old one.

@bckpkol

This comment has been minimized.

Copy link

@bckpkol bckpkol commented Nov 2, 2019

Aha! Found. Edit 02_Reclaiming_The_Past.cfg, remove the line
theme=Cutscene_Minimal
and the bug vanishes!

@bckpkol

This comment has been minimized.

Copy link

@bckpkol bckpkol commented Nov 2, 2019

[stuntj@bckpkol-silvermont ~]$ SDL_HINT_RENDER_BATCHING=0 wesnoth
Is that okay?

[stuntj@bckpkol-silvermont ~]$ export SDL_HINT_RENDER_BATCHING=0
[stuntj@bckpkol-silvermont ~]$ wesnoth

That also doesn't work.

@bckpkol

This comment has been minimized.

Copy link

@bckpkol bckpkol commented Nov 2, 2019

Imagine this:

  • in 1.14.x that works neither way.
  • in 1.15.x somebody notices the bug. He thinks that bug only affects non-batch render, so he leaves the old code, and adds a switch to his workaround when batch rendering is disabled.

The result? In 1.15.x disabling batch render works, in 1.14.x not.
You simply say batch render doesn't work anymore, instead of fixing.
But actually no render works.
I can check this.

@bckpkol

This comment has been minimized.

Copy link

@bckpkol bckpkol commented Nov 5, 2019

Checked. I have no problems in the latest dev 1.15.x version, even without that variable, but 1.14.x are broken, even with that variable. However, how can I re-enable batch render in 1.15.x, to debug it?

@Pentarctagon

This comment has been minimized.

Copy link
Member

@Pentarctagon Pentarctagon commented Nov 5, 2019

You'd need to comment out the line in 6436f90 and rebuild wesnoth, I assume.

@bckpkol

This comment has been minimized.

Copy link

@bckpkol bckpkol commented Nov 6, 2019

Thanks. I don't have a time for this right now. Maybe I'll respond after a two weeks.
When I'll be up to it, I'll build earlier versions to determine where exactly disabling batch render started to work.

@bckpkol

This comment has been minimized.

Copy link

@bckpkol bckpkol commented Nov 15, 2019

Gonna do. I have a complete repo clone.
Will build with Clang -O2 for speed.
Ha ha ha. The correct command line is
SDL_RENDER_BATCHING=0
not
SDL_HINT_RENDER_BATCHING=0
Applying that hint in 1.14.9 works, so it never worked. But I could go on to 1.14.8. The chances are little because AFAIK SDL2 backend is new.
The workaround works in 1.14.5, and probably in later versions.
Forgot to check - 1.14.5 already has the bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
8 participants
You can’t perform that action at this time.