Rendering performance drops in letterboxed full screen

Started by Monsieur OUXX, Sun 08/11/2020 21:07:38

Previous topic - Next topic

Monsieur OUXX

I've been playing Zniw adventure and I noticed something peculiar.
The game is in 640x480x32 with "max round multiplier" and nearest neighbour. That makes it 2560x1920. It's in Direct3D9.
I'm running it on a wide screen (laptop) (i'm guessing 16:9 ratio maybe?) on a powerful laptop.

I've noticed a thing :
- when I run the game in windowed mode, the game does not slow down
- when I run it in exactly the same resolution, but I press Alt+Enter (which makes it fullscreen letter box, with no resolution change), then the game visibly slows down whenever the room scrolls (i.e. when the camera is following the character around). By "visibly" I mean it's not catastrophic but I can see that the framerate of the game drops a little bit and everything starts moving in slow motion.

I can't think of an explanation since, then again, the number of pixels rendered is exactly the same.
The only reasons I can imagine (and both sound equally crazy) are : a) the letterbox is rendered "manually" which means that every black pixel actually has to be rendered, or b) it's the camera system that contains a non-optimized portion so bad that it can slow down the entire game.
 

CrashPL

I've actually noticed it too, even described it on the forum once - for whatever reason the framerate dipped a bit in scrolling rooms, when an animated GUI is displayed (I guess due to alpha blended sprites used?), or when a large object is animated and visible on the screen (Lambeosaurus in Wajapulka, or background river animation in Rivenn-na).

Monsieur OUXX

#2
Quote from: CrashPL on Sun 08/11/2020 21:14:42
I've actually noticed it too, even described it on the forum once - for whatever reason the framerate dipped a bit in scrolling rooms, when an animated GUI is displayed (I guess due to alpha blended sprites used?), or when a large object is animated and visible on the screen (Lambeosaurus in Wajapulka, or background river animation in Rivenn-na).

I myself have observed it in the caves, where I don't think there's really any big animated object? It's really the scrolling combined with the letterbox. No letterbox, no slowdown.

Also (when the letterbox is disabled) I DON'T observe the issue in a room with a complex set of walkable areas (which would make complicated pathfinder computations) and the room is 4 to 6 times the surface of the viewport -- what I'm trying to say is : it really seems to come down to the letterbox black rectangles.
 

Crimson Wizard

Do you have this problem with OpenGL renderer too, or only Direct3D?

Do you have vsync on? We discussed this on Discord lately, it appears the game is set to run in 85 fps, but because AGS still runs game loops and renders on the same thread vsync may screw things up.

CrashPL

Yeah, it has a game speed set to 85 - however it's still weird, as v-sync issues would cause constant slowdown (as seen on one user video), rather than during specific parts of the game (room scrolling etc.), hmm...

Monsieur OUXX

Quote from: CrashPL on Wed 18/11/2020 09:19:45
Yeah, it has a game speed set to 85 - however it's still weird, as v-sync issues would cause constant slowdown (as seen on one user video), rather than during specific parts of the game (room scrolling etc.), hmm...

I think maybe you're overlapping two different issues? Let's tackle them one by one. For me it was strictly when a scrolling was happening AND there was some fullscreen letterbox
 

Crimson Wizard

#6
Quote from: Monsieur OUXX on Thu 19/11/2020 15:50:59
I think maybe you're overlapping two different issues? Let's tackle them one by one. For me it was strictly when a scrolling was happening AND there was some fullscreen letterbox

Can you answer on my previous question about renderer?

Do I understand correctly that the effect appears only when the room scrolls?

Also, is this noticable strictly in this game, or in any other game when there's letterboxed mode?

PS. I should've asked earlier, but what version of AGS the game is made with?
May this effect be seen in game demo (as I dont own the game at the moment)?

Monsieur OUXX

Quote from: Crimson Wizard on Thu 19/11/2020 16:04:30
Quote from: Monsieur OUXX on Thu 19/11/2020 15:50:59
I think maybe you're overlapping two different issues? Let's tackle them one by one. For me it was strictly when a scrolling was happening AND there was some fullscreen letterbox

Can you answer on my previous question about renderer?

I was hoping to hand the issue over to the dev of that game, but here goes :
- Renderer : Direct3D9, max round multiplier, nearest neighbour
- my screen : wide screen (3840x2160)
- only when the room scrolls? Correct
- is this noticable strictly in this game, or in any other game when there's letterboxed mode? > I Don't know, I don't have any other AGS game in 640x480. Let me try a dummy game.
 

Crimson Wizard

#8
Quote from: Monsieur OUXX on Tue 24/11/2020 08:00:44
I was hoping to hand the issue over to the dev of that game, but here goes :

Well, from above comments reports looks similar, but not quite, so I wanted to clarify your case. I learnt that the game is run in 85 fps with long smooth animations, so I'd expect sprite caching to slow it down when new objects appear on screen. Whether this is a case with scrolling room or not is an open question (as new objects may appear as room scrolls). Unfortunately I do not own the game yet, so wonder if I'll be able to observe the problem with the demo.
EDIT: I tried downloading demo now, but the links are missing, idk if it's website error or they got removed.

Quote from: Monsieur OUXX on Tue 24/11/2020 08:00:44
- Renderer : Direct3D9, max round multiplier, nearest neighbour

I don't know what the version of AGS this game was made with, but if it's one with OpenGL, could you also try that?

Monsieur OUXX

Quote from: Crimson Wizard on Tue 24/11/2020 09:03:59
Whether this is a case with scrolling room or not is an open question (as new objects may appear as room scrolls)
I understand what you're saying but in my case it's a constant slowdown the whole time the camera is panning, and it goes back to normal speed the instant the camera stops scrolling.

Quote from: Crimson Wizard on Tue 24/11/2020 09:03:59
- Renderer : Direct3D9, max round multiplier, nearest neighbour
I don't know what the version of AGS this game was made with, but if it's one with OpenGL, could you also try that?
I see in winsetup.exe that it is AGS 3.5.0.26. It does have OpenGL but the slowdowns were appearing when I was using Direct3D9. Let me try with OpenGL
 

Monsieur OUXX

Well, what do you know!
I've just retried running the game in Direct3D9 (exact same conditions as before) and there was zero slowdown, even with letterbox.
This baffles me as the symptoms were quite consistent (across rooms and game sessions and all that) about a week or so.

Therefore, two questions for CrashPL:
1. Did you rebuild the game on a newer version of AGS? (Steam might have updated it for me)
2. (just a hunch) In the large rooms in the caves, do you have large objects covering the entirety of the room? (room-sized GUI or room-sized object or room-sized animated background)? I wonder in particular how you implemented the "darkness versus lit-by-torch" system.
 

CrashPL

Yeah, we're using 3.5.0 since December 2019. The final build of the game was created on 3.5.0.26, I haven't updated the engine since. The patches I rolled dealt with minor bugs and text fixes, like missing commas in the Polish translation.

There are only three places in the cave that feature large animation chunks - the fresh air cavern, secret cavern (with the large boulder), and the path slope, where you have to bring the boulder down. As for the torch, there's a background check whether its state has changed (i.e. it was lit or extinguished), and it sets the appropriate background and graphics of the visible objects. This check is actually used
Spoiler
in every room that has light/dark version and/or time of the day change.
[close]

Monsieur OUXX

Quote from: CrashPL on Fri 27/11/2020 10:58:24
The final build of the game was created on 3.5.0.26 in december 2019, I haven't updated the version of AGS I use since then.
The patches I rolled dealt with minor bugs and text fixes, like missing commas in the Polish translation.

But 3.5.0.26 didn't exist in December 2019? It was 3.5.0.24 I think? Or maybe I'm completely wrong.

Anyways, the mystery remains. Maybe I should try again with my laptop plugged/unplugged, which triggers energy-saving mode, which in turns maybe changes something in the performances or hardware acceleration or refresh rate... But again it's apowerfull laptop so it shouldn't impact an AGS game, especially when there aren't more pixels to render in letterboxed fullscreen versus windowed.
 

CrashPL

Indeed, I updated to .26 around summer, as previous versions had some bugs that affected the development. :) I just updated the engine to 3.5.0 in December (until then I was still using 3.4), as it had support for some things I really needed.


SMF spam blocked by CleanTalk