RunGame Mac Display

Ask and answer questions about making games and related topics. Unrelated topics go in that other forum.

Moderators: marionline, SDHawk

Post Reply
User avatar
Willy Elektrix
Liquid Metal Slime
Posts: 910
Joined: Sun Aug 15, 2010 11:30 pm

RunGame Mac Display

Post by Willy Elektrix »

TMC: I ported Megallennium to Mac, but I discovered a strange display related bug.

The game is set to open in full screen by default. The game select file "megallennium.rpg" opens in full screen and looks fine. However, when you select a game, it also opens in full screen but only occupies about 75% of the screen. There is a black border around it.

If you exit that game and return to the game select menu, then the menu also does not fill the screen. I just uploaded the Mac version to the Slime Salad game list. Give it a try and see if the same problem exists for you.

I am on Mac OS 10.12.5.
TMC
Metal King Slime
Posts: 4308
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

OK, someone else also mentioned fullscreen mac problems (can't remember whether that was specifically with the multicart, or in general). I'll have a look the next time I'm at my Mac.
TMC
Metal King Slime
Posts: 4308
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

I didn't see the same symptoms as you -- there was no permanent screwup -- but I did see some very nasty visual glitches when switching a game. Turns out it was due a workaround for a zoom-changing bug I added in 2010. So I removed that workaround; the fix is in current nightlies.

However, I forgot to check whether changing the window zoom still works (the problem I had in 2010). Could please try to change it using the Zoom 1-4 options in the Window menu and let me know if it works, in both Game and Custom. Also let me know if this fixes your original problem.

Even with this fix, you may notice the wrong palette being used for an instant when switching game if the palettes differ. This seems to only happen only Mac. Can't remember if it happened in Megallennium specifically, but was very noticeable in another test game.
I've checked in a change that I think will fix that too, but you will have to wait a day for it to land in nightly.

It turns out it's you can't google Megallennium if you can't remember how to spell it, even when adding various other specific keywords. I simply could not find it; there are too many ways to spell it!
Last edited by TMC on Sat Jul 01, 2017 3:22 pm, edited 2 times in total.
User avatar
Willy Elektrix
Liquid Metal Slime
Posts: 910
Joined: Sun Aug 15, 2010 11:30 pm

Post by Willy Elektrix »

TMC wrote:I didn't see the same symptoms as you -- there was no permanent screwup -- but I did see some very nasty visual glitches when switching a game. Turns out it was due a workaround for a zoom-changing bug I added in 2010. So I removed that workaround; the fix is in current nightlies.

However, I forgot to check whether changing the window zoom still works (the problem I had in 2010). Could please try to change it using the Zoom 1-4 options in the Window menu and let me know if it works, in both Game and Custom. Also let me know if this fixes your original problem.
I'll test this next time I am on my Mac at work.
TMC wrote:It turns out it's you can't google Megallennium if you can't remember how to spell it, even when adding various other specific keywords. I simply could not find it; there are too many ways to spell it!
Good point. It's a too late to change it now. I was trying to come up with something that wouldn't share any Google keywords. Instead, I made it too hard to Google. =(
User avatar
Willy Elektrix
Liquid Metal Slime
Posts: 910
Joined: Sun Aug 15, 2010 11:30 pm

Post by Willy Elektrix »

I did some testing with the newest nightly.

The zoom 1-4 functions work fine when used with Custom and Game.

I'm still having the same problem. Here's what happens.

1) I run the game from its app bundle, it opens in a 100% full screen view.
2) When I load any of the sub-games, they load in an 80% full screen view. The game screen has a black border around it.
3) When I exit a sub-game and return to the game select menu, it will also be in an 80% full-screen view with a black order around it.

You indicated that you were not able to duplicate the problem, so there's no point with messing with it more.

However, I notice another bug that might be related to the same thing. I just uploaded a new Mac version of Megallennium. Download it and see if you can duplicate it. Here's what to do...

1) Run the game from its app bundle.
2) Open Owlbears. It should open in a normal looking full screen view.
3) Exit Owlbears and return to the game select menu.
4) Open another game from the game select menu (for instance, Dr. Moonlight).
5) Dr. Moonlight will open in a normal looking full screen view. Press ESC to exit the game and return to the game select menu.
6) Open Owlbears again. It will now only occupy about 20% of the screen!

The same thing happens with PicOHRoss. Both games were created by Newbie Newtype and I can't open them because they are password protected.

Let me know if you can duplicate this. Thanks!
User avatar
Bob the Hamster
Lord of the Slimes
Posts: 7658
Joined: Tue Oct 16, 2007 2:34 pm
Location: Hamster Republic (Ontario Enclave)
Contact:

Post by Bob the Hamster »

I know picohross runs at a non-default resolution. Do any of the other games run at something different than 320x200 ?
Last edited by Bob the Hamster on Thu Jul 06, 2017 3:22 am, edited 1 time in total.
TMC
Metal King Slime
Posts: 4308
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

You indicated that you were not able to duplicate the problem, so there's no point with messing with it more.
Actually, I'm not sure that I didn't see it. It sounds like the first of the two things you're complaining about may be two things: 1) there are borders around the screen edges 2) the sizes of the borders changes as you switch between games (is the view always centred? If not, this is definitely a problem). I didn't consider 1) a bug (do you really want to play a 320x200 game stretched right to the screen edges? I guess not all Mac have really large screens, though), and I misunderstood, and was looking for a more dramatic problem than 2). It's possible 2) did happen and I didn't notice. I guess I barely tested Megallennium since I focused on the worse problems I saw with a different test game.

As for the second case, the screen getting scaled to 20%, there's definitely something majorly wrong there.

But too bad I didn't see your reply, as I went to uni today and tested the zoom options while I was there. I probably won't get another chance to test until next week at some point.

Speaking of which, the Cmd+1/2/3/4 keys work even when you are fullscreened. The amount of scaling and black bordering around the edges of the screen is a combination of scaling done by the engine, by SDL, and by the OS, and SDL and the OS might add borders if just scaling won't give the right result. So as you press Cmd+1/2/3/4 it changes the apparent sizes of the borders/the total scaling. See whether you can correct any of the problems you reported doing that; which zoom works best? I think the engine might be choosing the zoom level inconsistently.
Oh, this will also be reported in g_debug.txt... although g_debug.txt output might be useless when using rungame.
Last edited by TMC on Thu Jul 06, 2017 12:21 pm, edited 2 times in total.
User avatar
Willy Elektrix
Liquid Metal Slime
Posts: 910
Joined: Sun Aug 15, 2010 11:30 pm

Post by Willy Elektrix »

TMC wrote: Actually, I'm not sure that I didn't see it. It sounds like the first of the two things you're complaining about may be two things: 1) there are borders around the screen edges 2) the sizes of the borders changes as you switch between games (is the view always centred? If not, this is definitely a problem). I didn't consider 1) a bug (do you really want to play a 320x200 game stretched right to the screen edges? I guess not all Mac have really large screens, though), and I misunderstood, and was looking for a more dramatic problem than 2). It's possible 2) did happen and I didn't notice. I guess I barely tested Megallennium since I focused on the worse problems I saw with a different test game.
The screen is always centered. It doesn't matter that the game is not stretched to full screen. However, sometimes it is (when the game first starts) and sometimes it isn't (when you select a game from the game select menu). The behavior is inconsistent. I think we are both on the same page now. =) I probably should have just taken a screenshot. I'm not sure why I didn't think of it.
TMC wrote: Speaking of which, the Cmd+1/2/3/4 keys work even when you are fullscreened. The amount of scaling and black bordering around the edges of the screen is a combination of scaling done by the engine, by SDL, and by the OS, and SDL and the OS might add borders if just scaling won't give the right result. So as you press Cmd+1/2/3/4 it changes the apparent sizes of the borders/the total scaling. See whether you can correct any of the problems you reported doing that; which zoom works best? I think the engine might be choosing the zoom level inconsistently.
Oh, this will also be reported in g_debug.txt... although g_debug.txt output might be useless when using rungame.
I just tried using CMD1-4 to change the view in full screen. CMD1 shrinks the screen down to about 20% size. This is exactly what I was describing happens to Owlbears and PicOHRoss after following the instructions in my previous post. It sounds like your intuition is right. The engine is just inconsistently resizing things.

Interestingly, after I change the screen's size with CMD1-4, I can't change it again without closing the program and restarting. In other words, I can press CMD1 to shrink it down, but CMD2-4 won't work once I've pressed CMD1 one time.

Below is the g_debug if it will help.

Code: Select all

 ----Starting OHRRPGCE Game----
07-06-2017 17:05:02
OHRRPGCE wip 20170705.8974 gfx_sdl/music_sdl FreeBASIC 1.06.0 (04-29-2016) x86   -gen gcc Mac OS X/Darwin 32-bit
exepath: /Users/AHagen/Desktop/megallennium102mac/megallennium.app/Contents/MacOS, exe: /Users/AHagen/Desktop/megallennium102mac/megallennium.app/Contents/MacOS/ohrrpgce-game
Runtime info:   music_sdl, SDL 1.2.15, SDL_Mixer 1.2.11  Mac OS 10.12.5
Initialising gfx_sdl...
setvideomode zoom=2 w*h = 640*400
gfx_sdl: created screensurface size=640*400 depth=32 flags=0x4 R=0xFF00 G=0xFF0000 B=0xFF000000
gfx_sdl "SDL 1.2.15 (0 joysticks) Driver:Quartz"
music_sdl, SDL_Mixer 1.2.11 (22050Hz)
mersenne_twister seed=1499378702.603626
SETVISPAGE() took 56ms
Setting default window settings...
setvideomode zoom=2 w*h = 640*400
gfx_sdl: created screensurface size=640*400 depth=32 flags=0x4 R=0xFF00 G=0xFF0000 B=0xFF000000
setvideomode zoom=2 w*h = 640*400
gfx_sdl: created screensurface size=640*400 depth=32 flags=0x4 R=0xFF00 G=0xFF0000 B=0xFF000000
set_resolution 320*200
Setting graphics scaling to x2
end_debug: no debug/error messages during startup (skipping rest of startup)

 ----Loading /Users/AHagen/Desktop/megallennium102mac/megallennium.app/Contents/Resources/megallennium.rpg----
curdir: /Users/AHagen/Desktop/megallennium102mac/megallennium.app/Contents/Resources
tmpdir: /Users/AHagen/Library/Caches/OHRRPGCE/ohrrpgce20170706170502.329.tmp/
settings_dir: /Users/AHagen/Library/Application Support/OHRRPGCE
Name: Mega Cart [Game Loader]
Partial game data upgrade...
Last edited by: [[OHRRPGCE wip 20170705.8974 gfx_sdl/music_sdl FreeBASIC 1.06.0 (04-29-2016) x86    -gen gcc Mac OS X/Darwin 32-bit]]
archinym creation info: OHRRPGCE wip 20161106
Desktop resolution: 1440*900
automatic_scale_factor(0.8), screen size: 1440*900
Setting graphics scaling to x4
recenter_window_hint()
setvideomode zoom=4 w*h = 1280*800
gfx_sdl: created screensurface size=1280*800 depth=32 flags=0x4 R=0xFF00 G=0xFF0000 B=0xFF000000
/Users/AHagen/Library/Application Support/OHRRPGCE/megallennium/gameconfig.ini : gfx.fullscreen = -1, genFullscreen = 1
setvideomode zoom=4 w*h = 1280*800
gfx_sdl: created screensurface size=1280*800 depth=32 flags=0x80000004 R=0xFF00 G=0xFF0000 B=0xFF000000
genRungameFullscreenIndependent: 0
setvideomode zoom=4 w*h = 1280*800
gfx_sdl: created screensurface size=1280*800 depth=32 flags=0x80000004 R=0xFF00 G=0xFF0000 B=0xFF000000
! loadrecord: record 8 is off the end of (?)/Users/AHagen/Library/Caches/OHRRPGCE/ohrrpgce20170706170502.329.tmp/playing.tmp//lookup1.bin
! loadrecord: record 183 is off the end of (?)/Users/AHagen/Library/Caches/OHRRPGCE/ohrrpgce20170706170502.329.tmp/playing.tmp//plotscr.lst
SETVISPAGE(gfx_present) took 68ms
SETVISPAGE() took 137ms
recenter_window_hint()
setvideomode zoom=1 w*h = 320*200
gfx_sdl: created screensurface size=320*200 depth=32 flags=0x80000004 R=0xFF00 G=0xFF0000 B=0xFF000000
DOWAIT() took 816ms
! loadrecord: record 8 is off the end of (?)/Users/AHagen/Library/Caches/OHRRPGCE/ohrrpgce20170706170502.329.tmp/playing.tmp//lookup1.bin
! loadrecord: record 183 is off the end of (?)/Users/AHagen/Library/Caches/OHRRPGCE/ohrrpgce20170706170502.329.tmp/playing.tmp//plotscr.lst
...Quit the game.

Ignore ohrrpgce20170706170502.329.tmp because we are using it
Deleting tmpdir /Users/AHagen/Library/Caches/OHRRPGCE/ohrrpgce20170706170502.329.tmp/
TMC
Metal King Slime
Posts: 4308
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

Ah, very interesting! It's clear why 320x200 causes a lot of shrinkage - it's probably far less than even the smallest video mode advertised by the OS, so SDL has to add huge borders to it. But getting stuck there is a mystery.

It used to be that the backend would simply default to 3x zoom in fullscreen and everything seemed fine, but because the resolution is now variable and you can change the zoom we have to do something more complicated. Looking at the code now, I'm starting to see some problems with it which partially explain the problem. I need to do some experimenting.

That debug log shows you changing the zoom to 1x and then nothing. Were you actually trying to change it after that?
Last edited by TMC on Fri Jul 07, 2017 1:54 pm, edited 1 time in total.
User avatar
Willy Elektrix
Liquid Metal Slime
Posts: 910
Joined: Sun Aug 15, 2010 11:30 pm

Post by Willy Elektrix »

TMC wrote: That debug log shows you changing the zoom to 1x and then nothing. Were you actually trying to change it after that?
Yes. However, nothing happened when I tried.
TMC
Metal King Slime
Posts: 4308
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

Interesting; that does narrow down where the problem is.
Hopefully I'll have time this week for it.

BTW, I'm not sure if I mentioned this before, but there's a bug where Mac games set to run at 60 fps will actually only display at 30fps (although game ticks still happen at 60fps, so the effect is just that it's less smooth). So this affects Owlbears and PicOHRoss. I'll be fixing that soon for Dwimmercrafty.
Last edited by TMC on Tue Jul 11, 2017 4:24 am, edited 1 time in total.
Post Reply