Resolution switcher - win10 testers needed

Discussion and feedback on Construct 2

Post » Mon Jul 10, 2017 2:31 pm

Tried and it works. Only thing is that the game scaling gets messed up. My game uses letterbox scaling and it gets streched when I change the launcher res. Any ideas how to keep the correct scaling?

Forgot to mention that I'm on win7. Maybe this only works for win10?
B
52
S
22
G
12
Posts: 728
Reputation: 11,722

Post » Mon Jul 10, 2017 4:53 pm

Nah I don't think it's your windows version. I have one win7 and one win8.1 system to test on, and it works as intended on both of those.

What this does is simply change the system resolution temporarily, forcing everything (including your game) to run in that resolution for as long as the target process (your game) is running.

Have you tried lowering the resolution manually through Control Panel/Display to see if the scaling gets stretched the same way? If it doesn't, then the problem is on my end. But if it does, then maybe it's something to do with the way your display/display driver handles non-native resolutions. For instance, many if not most laptops will stretch everything to fit the screen by default, instead of scaling to fit aspect ratio.
B
38
S
16
G
6
Posts: 537
Reputation: 7,582

Post » Tue Jul 11, 2017 11:59 pm

Yo,

I tired testbuild now, and it works. Well done. I'd make a use out of it too. Do you think I could use it when it's done? Also, if you would be able to turn it in to a plugin somehow, that would rock.
My professional Royalty Free Music at Scirra Assets Store
--------------------------------
Specs: i5 2500, 16gb of ram, gtx 770, win 7, Focusrite Scarlett 8i6, Mackie mr8mk2, Alesis 320, browsing the net on chrome.
B
86
S
28
G
21
Posts: 1,976
Reputation: 19,306

Post » Wed Jul 12, 2017 1:41 pm

Sure thing! I'm looking into license options atm for something as permissive as possible; no need to credit me, use however you like etc. Might just go with public domain to minimize the amount of headache :P

I do plan to offer another version in the future with support for mac/linux and more customization options for the launch window, including using your own graphics, buttons, layout style etc, which will be commercial. Small fee, the price of a cup of coffee or two probably. You'll be able to use that however you like as well, with the exception of re-selling the software itself.
B
38
S
16
G
6
Posts: 537
Reputation: 7,582

Post » Wed Jul 12, 2017 2:05 pm

@ErekT I tried setting the monitor resolution manually and you were right. It scales exactly the same way as your launcher so there was no issue :) So great job! Looking forward to see more :D
B
52
S
22
G
12
Posts: 728
Reputation: 11,722

Post » Wed Jul 12, 2017 6:36 pm

Okay here it is! No proper readme in there yet. I'll write one up when I feel less lazy :P

https://www.dropbox.com/s/r1nwmlpav9629 ... 0.rar?dl=0

New in this build:

Window mode – you’ll need to set up a couple of things in your game’s events for it to work. See the testbuild capx inside the archive for an example.


Future plans (v2.0):
Switch resolutions in-game, switch between window and fullscreen in-game, and restore system resolution when the game is minimized (Alt-TAB).
Mac/Linux support.
Customizable launcher with various graphics and layout options.
B
38
S
16
G
6
Posts: 537
Reputation: 7,582

Post » Wed Jul 12, 2017 6:49 pm

This is interesting and I want to make sure I'm using it correctly. Upon first launch, without changing anything, the game launched in 800x600 with black bars around the image, as though it were cropped (I'm not sure if there's a better way of saying this). I did notice that when I adjust the launch.cfg and the osH/osW to 1920x1080 the game still says "800x600" but it scales to my 1920x1080 without black bars anywhere (I think that what's supposed to happen). Once I set that once, it always reverts to a full screen scaling, even after resetting everything in launch and osW/osH to 800x600.

I'm on a Windows 7 machine with a GTX 560
B
56
S
33
G
23
Posts: 334
Reputation: 16,743

Post » Wed Jul 12, 2017 7:40 pm

Okay, here's how to use it.

Export your game with nw.js and place Launcher.exe and Game.exe in the win32/64 folder.

Run Launcher.exe and select a resolution and screenmode. Then press either launch or exit, in both cases your choices get saved. After pressing launch the game will run with your choices applied. If you want the 'window' choice to work though, you'll need to set up some events at the start of your game like I've done in the test.capx example.

If you've run the launcher once and don't want to change resolution or screenmode again you can just run Game.exe directly with your saved settings.

EDIT:
Oh, and you need to turn kiosk mode off in build settings or you won't be able to cancel fullscreen in C2.

-----------

Quick breakdown of what the different cfg files do:

launch.cfg:
Used by Game.exe to get the name of the executable (nw.exe), the desired resolution to run in, the delay in seconds before switching to the desired resolution, and the time in seconds to display a black background while the game loads. (The last one doesn't work properly so I'd leave it alone for now.)

You should only change "nw.exe", and the two last lines in launch.cfg. The resolution values get overwritten every time launcher.exe gets run so there's not much point changing those.

mode.cfg:
fullscreen/window toggle. 0 = fullscreen, 1 = window. Set by launcher.exe. Read by Game.exe (tells it not to switch resolution in window mode) and by your nw.js build (check out the capx to see how).

osH.cfg/osW.cfg:
Reference values. Allows C2 to read the resolution selected in launcher.exe. Best not mess with these.

osDH.cfg/osW.cfg:
Same as above but for system resolution.

res.cfg:
This is the file where you set up all the different resolution choices you want to make available to the player.

ui.cfg:
You can set your own names for launcher.exe's window and buttons here.
B
38
S
16
G
6
Posts: 537
Reputation: 7,582

Post » Thu Jul 13, 2017 6:14 am

Oh gosh... my antivirus deleted the launcher executable haha. That's where my issue was; sorry! It works like a dream! Thanks! I'd definitely be interested in paying for this, especially if you do make a version that runs on linux and OSX.
B
56
S
33
G
23
Posts: 334
Reputation: 16,743

Post » Thu Jul 13, 2017 7:05 am

@erekt Awesome job! I'll test it later :)

@ultrafop False positives from anti viruses has been a nightmare for me on steam. A while back tons of users got my games exe file deleted as it was falsely flagged as a virus and they couldn't play it. But it's finally fixed and the nw.exe files are now white listed. I wonder if the same will happen to this launcher?

Does it get deleted every time?
B
52
S
22
G
12
Posts: 728
Reputation: 11,722

PreviousNext

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 3 guests