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.

Newcomers AppGameKit Corner / #Renderer Variations?

Author
Message
Scribble
7
Years of Service
User Offline
Joined: 2nd Apr 2017
Location:
Posted: 11th Oct 2023 23:31
Hello. I have a question regarding AppGameKit Studio renderers.
From what I'm aware of, AppGameKit Studio has several renderers that we can choose from, using the command #Renderer
#Renderer "Basic" uses OpenGL
#Renderer "Advanced" uses Vulkan
"Prefer Best", etc

But there are also undocumented type of renderes such as #Renderer "None", which will render nothing. I've been using this to make server apps to run on Amazon servers that cannot run 'normal' AppGameKit app, because AppGameKit needs graphic cards of some kind when rendering, which these servers computers don't usually have.
Is there any other hidden undocumented renderer type that we can use or specify?
Is there an option for the app to display simple texts, but doesn't require graphic renderers such as openGL and Vulkan? Something like what Command Prompt uses?
Thanks in advance.
smerf
19
Years of Service
User Offline
Joined: 24th Feb 2005
Location: nm usa
Posted: 13th Oct 2023 07:03 Edited at: 13th Oct 2023 07:11
Not sure if renderer none is useful or not it may be but unless a render /sync is actually called then it doesn't try to do anything with graphics. I generally run about 200 loops and render once for a semi dedicated server. You could write to a file from tir one and read it with cmd or batch. U could also host a local connection over sockets and connect locally or remotely and send / receive messages. It supports wen hooks as well I believe so something may be possible there. Serial coms is an option also. I think socket coms is best bet it's possible to connect with infinite options. Could talk to batch power shell python c web bash ect

Scribble
7
Years of Service
User Offline
Joined: 2nd Apr 2017
Location:
Posted: 15th Oct 2023 14:27 Edited at: 15th Oct 2023 14:30
Yes, I do write some logs to a file from time to time, for now. I think I'll try the socket thing later with python maybe. Renderer "None" is pretty much a lifesaver for AppGameKit, because otherwise, servers .exe made in AppGameKit cannot be hosted on 'normal' hosting service, because all AppGameKit renderers requires some graphic capability. Only AppGameKit Studio has the choice to choose renderers though, Classic doesn't.

Another question (I don't know much about renderings), just to make sure:
How do I run 3D calculations and physics and everything else in the loop , without calling SYNC()?
I want the game to have the ability to 'minimize', and doesn't try to render anything graphically 3D to screen, to preserve the PC resource while the game is being minimized.
And then, if the player chose to maximize the .exe again, I wanted the minimized .exe to return to its 'active' state and render all the graphics like usual, and doesn't skip any graphic update, as if it was never minimized before.
I cannot do this with Renderer "None" because it only works once at the beginning of the code, it doesn't work in the middle of the loop.

So should I just skip the SYNC(), and just directly LOOP()? Is that all? I think I'm missing something.

The reason for this is, I want to implement player merchant feature in my multiplayer game project. While player shop is open, I want the player to have the ability to AFK and conserve PC resource.
Basically player will set up their store, then minimize the .exe and AFK to conserve PC resource while he's sleeping (in real life), while other players can still browse his shop while he's AFK. Later on, the shopkeeper player will return, and maximize the .exe back to see how his store is doing.
SFSW
21
Years of Service
User Offline
Joined: 9th Oct 2002
Location:
Posted: 15th Oct 2023 21:31 Edited at: 15th Oct 2023 21:31
Indeed, the 'None' render mode is incredibly useful for server apps and various other conditions where running without any dependency on a graphics adaptor is required. You can only use one mode or the other at startup though, so you can't switch render modes during runtime.

You can still use 'Sync()' in the 'None' mode as it handles some internal step timers and other operations still useful in a program running more as a 'service' rather than a full program task. But you will want to manage the pace of your program in a different way (helps reduce CPU overhead as well as timers/routines running too quickly). So along with wherever you might call 'Sync()', also include a wait delay for whatever tick rate you want to target. To do that, just call 'Sleep(#)' where # is the wait value you want to apply for your target tick rate, such as 10 (for about 100 cycles per second). That will help keep your main loop running at a consistent speed regardless of internal mismatches between systems as well as relieve some of the CPU overhead involved.

This won't likely help with some kind of minimize/maximize of a game EXE as you describe, instead relating more to an AGK/S coded program running as a background service. So you might have to do something like link a main game EXE with a background service running the storefront as a 'host' of some kind.
Scribble
7
Years of Service
User Offline
Joined: 2nd Apr 2017
Location:
Posted: 19th Oct 2023 23:17 Edited at: 19th Oct 2023 23:17
O_O so the server .exe will run at maximum unrestricted speed with #Renderer 'None', even with SYNC() at 60 FPS? I haven't used any waiting methods for it yet, can't exactly see the FrameTime either because nothing is rendered. I just assumed it runs at maximum 60 FPS max, since it causes no problem before. I'll investigate this further, log the frametime or something. Thanks for the heads up.
SFSW
21
Years of Service
User Offline
Joined: 9th Oct 2002
Location:
Posted: 20th Oct 2023 15:52
Sync() doesn't actually 'render' when the mode is set to 'None'. Only its other internal operations (ie 'Update()') apply, which does slow things down slightly, but not to the degree of a full render pass nor 'synched' to a refresh. The limit will be in just how fast the code will execute running in the background. You can dynamically adjust your step rate to target a specific loop speed or make it fixed and expect a minimum performance baseline. The most effective way I found to keep things at a reliable rate was to apply the 'sleep' delay and have it be adjustable. Otherwise, things ran so fast that float precision could be exceeded in timers for certain operations.

Login to post a reply

Server time is: 2024-05-01 11:04:55
Your offset time is: 2024-05-01 11:04:55