Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Studio Chat / SetScreenResolution ?

Author
Message
Pfaber1
6
Years of Service
User Offline
Joined: 7th Jan 2018
Location: England
Posted: 17th Apr 2023 12:36
Setscreenresolution has been deprecated is there another way to set the screen resolution in AppGameKit S .
PSY
Developer
7
Years of Service
User Offline
Joined: 3rd Jul 2016
Location: Laniakea Supercluster
Posted: 18th Apr 2023 17:36
Help says the following:

Quote: "This command is deprecated due to the lack of support in newer renderers. The alternative is to render the screen to an image of your chosen size with SetRenderToImage and then display that image to the screen"


PSY


PSY LABS Games
Coders don't die, they just gosub without return
Pfaber1
6
Years of Service
User Offline
Joined: 7th Jan 2018
Location: England
Posted: 21st Apr 2023 06:32
Yeah it seems that is the way it is done Some very kind person gave me a copy of their very nice ,agc include file which is really cool and gets the job done and there is another way to do it over on syntax bomb .
Qube_
9
Years of Service
User Offline
Joined: 21st Oct 2014
Location: Omnipresent
Posted: 22nd Apr 2023 05:41
Personally I'd skip the RenderToImage method for your main game unless you have a good reason to use it. Instead use SetVirtualResolution to define your desired game resolution. In full screen mode AppGameKit with scale up / down to match the virtual resolution.
Pfaber1
6
Years of Service
User Offline
Joined: 7th Jan 2018
Location: England
Posted: 23rd Apr 2023 03:52
Hi Qube yes I get that, but the idea was to change the screen resolution from 1920 x 1080 to 1366 x 768. The reason for this was to speed the fps up and it does and very well, about another 30 fps, however I would of liked to of done this from within the app or game but this does not seem to work whichever way I try to do it . It doesn't really matter right now . I also realize that plugging my laptop in gives me 10 to 15 fps more .
Another way to increase the fps is to reduce the FOV to 40 or 45 not sure on the fps gain but I think it is significant . Thanks for reading and for the help. I can change the resolution on my laptop to 1366 x 768 and this is fine and does the job. I've been experimenting for the last few days and I'm now done with it . What sparked my interest was I read somewhere that gamers will change the computer resolution to get better fps.
Qube_
9
Years of Service
User Offline
Joined: 21st Oct 2014
Location: Omnipresent
Posted: 24th Apr 2023 22:13
Virtual resolution is faster than render to image and you can set the virtual resolution to your 1366 x 768. Overall though it doesn't matter so long as your game is fast enough for what you are doing
hendron
8
Years of Service
User Offline
Joined: 20th Dec 2015
Location:
Posted: 25th Apr 2023 00:55
Quote: "Virtual resolution is faster than render to image"


Which is unfortunate. When doing anything graphically intensive in 3D, being able to lower the render resolution can be and often is a critical performance consideration. AGK's Virtual Resolution doesn't actually change the rendering resolution. Setting your virtual resolution to 1366 x 768 and using full screen will still result in the game being rendered at your native desktop resolution. Sprites are simply scaled to match the virtual resolution. 3D objects are unaffected, with the exception of being cut off to fit within the aspect ratio.



Notice how the cube is totally sharp and not pixelated even though the virtual resolution is set to 320 x 180.
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 25th Apr 2023 02:19 Edited at: 25th Apr 2023 02:49
there should be a way to trigger windows' own display settings, complete with confirmation, from within AGK.

otherwise, if DBPro can do it, create a launcher app (or use a different 3rd party app) which you can execute from within AppGameKit, allow the user to set the desired resolution and go from there? i believe AppGameKit has enough device commands to accomodate changes/settings?

i'm still not familiar with WIN10 since purchasing this laptop ~a couple of years ago (havent bothered/needed to explore much) but my dinosaur PC had an ATI card, i believe. within that (control panel), settings could be changed based on a given game/application via profiles. i'm not seeing that on this WIN10 laptop with a meager onboard graphics card but i expect any real gamer has a decent card with similar "game/app profiles" that can be set if FPS matters that much?

meanwhile, a quick google and it seems some of this stuff is buried/restricted in WIN10/11, theoretically to protect the user. but there has to be a way to make changes that are completely within a users' control (as HTML stuff has gone over the years i've recently learned, requiring user interaction to make changes of potential negative consequences? even if it's simply allowing us to trigger direction to windows settings).

then, i expect a dll could be written (by someonne with more smarts than me) .

speaking of which (and i know you are probably after more than WIN support but at least it would be something), MadBit's FileExplore has evolved well beyond Filestuff so i've made a request.
Qube_
9
Years of Service
User Offline
Joined: 21st Oct 2014
Location: Omnipresent
Posted: 25th Apr 2023 13:31 Edited at: 25th Apr 2023 13:32
Quote: "Which is unfortunate. When doing anything graphically intensive in 3D, being able to lower the render resolution can be and often is a critical performance consideration. AGK's Virtual Resolution doesn't actually change the rendering resolution. Setting your virtual resolution to 1366 x 768 and using full screen will still result in the game being rendered at your native desktop resolution. Sprites are simply scaled to match the virtual resolution. 3D objects are unaffected, with the exception of being cut off to fit within the aspect ratio."

I did a C64 retro game a while back and came across virtual resolution having native res rotation so I had to use RenderToImage which gives you the effect you want. Would be nice if set virtual res had an additional flag to act as if rotations were in the virtual res.
hendron
8
Years of Service
User Offline
Joined: 20th Dec 2015
Location:
Posted: 25th Apr 2023 14:13 Edited at: 25th Apr 2023 14:15
Quote: "there should be a way to trigger windows' own display settings"


That'd be one way to do it, although it'd be limited to Windows unless you made a launcher or plugin for every desktop platform you want to support. Also, changing the OS display settings is not really the norm these days. AppGameKit needs a native way to change the render resolution and scale it to a borderless window like most modern games. I submitted a request for this on github a few years ago.

Quote: "I did a C64 retro game a while back and came across virtual resolution having native res rotation so I had to use RenderToImage which gives you the effect you want. Would be nice if set virtual res had an additional flag to act as if rotations were in the virtual res."


Yeah that's what I do as well for retro style graphics. But like you said, it's really only useful as an effect and not so much for performance. I guess for most projects in AppGameKit, it's not much of an issue. But I could see it becoming one relatively easily on less powerful systems that are hooked up to 4k+ monitors.
SFSW
21
Years of Service
User Offline
Joined: 9th Oct 2002
Location:
Posted: 26th Apr 2023 22:43
Also use RenderToImage here for the needed output. With rendering shifting over to full borderless windows in recent years and deprecating full screen exclusive modes (now considered a legacy capability in OS/API frameworks), I suspect this has become the new norm. There may not be a practical way for AGK/S to provide such a capability considering its render device/display setup. Not in the traditional 'DirectX 9' DBPro method at least. So if you're after that kind of capability, you'd probably be ahead to go with custom render targets via the image method. Your players will be able to change screen resolutions with the game running and media loaded while also having a very broad array of possible settings, rather than only the static resolutions a monitor might be capable of.
Raven
19
Years of Service
User Offline
Joined: 23rd Mar 2005
Location: Hertfordshire, England
Posted: 28th Apr 2023 06:30
This might help

Game_Code_here
3
Years of Service
User Offline
Joined: 2nd Jun 2020
Location:
Posted: 28th Apr 2023 10:39
I will say this as a fact.

Most people today have high end computers and 16 to 32 gigs of memory.

You are not making anything for low end specks while big companies are making nothing but high end stuff.

With that said set your goal in-between as your market is not with the low end people who do not have what it takes for a high end app.

Big companies are making billions on there games and apps from high end buyers.

Just some things to consider.
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 28th Apr 2023 12:29 Edited at: 28th Apr 2023 12:30
Pfaber1
6
Years of Service
User Offline
Joined: 7th Jan 2018
Location: England
Posted: 29th Apr 2023 10:45 Edited at: 29th Apr 2023 11:03
Hey Raven thanks for that. Not sure of it's purpose but I learnt something about offset .
Game Code Here : Yes never looked at it like that. Maybe time for a rethink.
Mad Bit : Thanks for the hard work.
Virtual Nomad : Thanks for the input.
I did this in Blitz3D and it was very useful. It just seems like a very useful way to get a fps increase. Thanks for your time.
Raven
19
Years of Service
User Offline
Joined: 23rd Mar 2005
Location: Hertfordshire, England
Posted: 29th Apr 2023 20:35
Pfaber1 ... There are a couple things I've done with the example.

First is the Automatic Resizing with the Window Size., meaning that the "Virtual" Resolution remains the same relative size to the Window Size.
As such it will remain full area of the Window (i.e. no black borders).
The second is by pressing Spacebar you can flip between the Default (built-in) Virtual Resolution (which always uses the Window Size as the Backbuffer Size) and RenderImage (which uses a "Native" to whatever you set said Virtual Resolution to)

As a note this will also work on Mobile Devices with Orientation Changes., so the App will automatically resize and maintain the same Resolution & Aspect Scaling.
It's a very streamlined approach that can be more-or-less just dropped into any project "As-Is"

The only real drawback to a RenderImage (custom Render Pipeline) approach is keeping mind that Print and DrawLine, DrawBox, etc. work a little differently and MUST be called in a very specific place.
Pfaber1
6
Years of Service
User Offline
Joined: 7th Jan 2018
Location: England
Posted: 30th Apr 2023 20:13
Hi I'm having a bit of a problem with this code and maybe some kind person could steer me in the right direction. It's Madbits FileExplore plugin .
Here is the offending code.



MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 1st May 2023 16:24
What happens or does not happen.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)

Donations are always welcome.
Pfaber1
6
Years of Service
User Offline
Joined: 7th Jan 2018
Location: England
Posted: 1st May 2023 19:39
Hi Madbit it says fe is not defined as a type which I have tried to do as in the above code . I put it in as a float a string and integer and did not help.
Would really like to get this working . Thanks for your time and effort.
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 1st May 2023 21:09 Edited at: 1st May 2023 21:27
i saw that but thought you might be using the type variable somewhere else in code; you know that you don't need to define a type to use the plugin, right?

otherwise, perhaps in general, we can't declare a type's variable with the same as a plugin reference?
i'm not seeing help for #Import_Plugin anywhere. anyone?

all i could find: 14_plugins.htm which uses the term "custom name" which isn't required but is definitely handy. alas, some help but doesn't advise of a potential naming conflict that might be going on here?

try renaming or omitting the Type variable (if you dont really need it) and advise?
MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 2nd May 2023 06:16 Edited at: 2nd May 2023 06:16
Überprüfe, ob du das Plugin richtig installiert hast. Ich denke das wird das Problem sein.
Ich nehme an mein Beispielcode aus dem FileExplore thread funktioniert auch nicht. Oder?

From the readme.txt wrote: "
The directory 'FileExplore' must be copied into the AppGameKit directory '...\AppGameKit\Tier 1\Compiler\Plugins\' for Classic
The directory 'FileExplore' must be copied into the AppGameKit Studio directory '...\AppGameKit Studio\Plugins\' for Studio
"
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)

Donations are always welcome.
Pfaber1
6
Years of Service
User Offline
Joined: 7th Jan 2018
Location: England
Posted: 6th May 2023 12:06
Hi could some kind person tell how to call the plugin? I cannot remember it. Thankyou.
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Pfaber1
6
Years of Service
User Offline
Joined: 7th Jan 2018
Location: England
Posted: 6th May 2023 12:45
Thankyou .
Pfaber1
6
Years of Service
User Offline
Joined: 7th Jan 2018
Location: England
Posted: 10th May 2023 07:19
Well I now know how to use a plugin and I must say it is very useful . Thanks MadBit and virtual Nomad for your time .
Pfaber1
6
Years of Service
User Offline
Joined: 7th Jan 2018
Location: England
Posted: 15th May 2023 02:37
Hi I have now got MadBits awesome program running faultlessly and it really is amazing . I am referring to the desktop resolution part of it but I also think there are quite a few rare gems in File explore . Anyway it did take me a while to get it working but after looking at the example it all came together pretty quickly . Really good job . Remember to look at the example like I didn't for a few days and if I would of looked at the example in the beginning I would of saved a lot of time . It is really quite easy to use once you get going . 10 out of 10 . excellent.
Pfaber1
6
Years of Service
User Offline
Joined: 7th Jan 2018
Location: England
Posted: 19th May 2023 05:18
Hey MadBit gonna send you a Donation on next pay day . Thanks for the help and it came just at the right time for me . I'm surprised this has not come up before as for me it is quite important.
Not sure if it works on linux but will see in the near future . I no it will not work with Android but I think it will be quite good even so. ( my latest game ). Anyway this is a great thing to be able to do and is a must have feature. My game at 1920 x 1080 is slow but at 1280 x 720 I get around 55 fps more and is nice and smooth.
MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 19th May 2023 09:25
Hey, thanks for your review.
I'm glad you were able to optimize your game with the plugin.

Unfortunately it won't work on Linux, because the plugin uses only Windows functions and there is only the .dll for windows.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)

Donations are always welcome.
Pfaber1
6
Years of Service
User Offline
Joined: 7th Jan 2018
Location: England
Posted: 19th May 2023 21:11
That's fine still really great job .

Login to post a reply

Server time is: 2024-04-25 10:06:36
Your offset time is: 2024-04-25 10:06:36