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 / socket connection (No built in error handeling)

Author
Message
smerf
19
Years of Service
User Offline
Joined: 24th Feb 2005
Location: nm usa
Posted: 30th May 2023 20:42 Edited at: 31st May 2023 02:31
Ive built a significant amount of networking using socket connects for a server and client but today I sent it a packet from outside an agk app this caused a complete applicaiton crash with error mode (2). " swap chain is out of date" and "surface size error 370x1000". This seems bad considering a server could be shutdown buy a single packet from any source other then agk.

Raven
19
Years of Service
User Offline
Joined: 23rd Mar 2005
Location: Hertfordshire, England
Posted: 1st Jun 2023 20:12
This is becoming an ever increasingly common issue with Vulkan Renderer...
Now as a sidenote., you will NOT experience this issue with the OpenGL Renderer because it's Swap Chain works differently.
Vulkan on the other hand requires exclusivity during the Threaded Barrier.

Now something to keep in mind is that OpenGL works the way it does because it was an effort to Standardise the Programming Side through Driver Abstraction.
That is to say that when you called glSwapChain( )... well the Graphics Driver would handle what it needed to for THAT architecture, to accomplish that.

Today things are different... the Architectures themselves have a Standardised Approach., i.e. you handle Swap Chains identically on AMD, NVIDIA, Intel and ImageTech.
As such this allows us to go back to Low-Level (Close-to-Metal) with Vulkan / Metal 2 / DirectX 12; and with little to no driver input execute the same approach regardless of Hardware.
Still, this is partially the issue here.

Remember Drivers would have robust approaches to accomplish various tasks such-as SwapChain... *because* of Edge Cases (such-as what you're running into) and I don't think AppGameKit does.
As noted... a lot of this likely could be resolved by using a Async Hardware Thread; as this would make associated memory immutable during flight, then anything that accesses it would just have to handle the "immutable" error thrown; i.e. wait until it's free.
Stlll., failing this., another approach on a Single Thread is to add layers of checks for Swap Chain invalidation; and lock the memory while in-flight to ensure that the content or size doesn't change while it's being accessed or rather during the process.

I know that it's easy to say "Well it's faster execution without this... and it doesn't seem to cause any issues." because again 99.99% of the time, it will be fine.
The issue are edge cases; that's what we always need to ensure we're programming for, especially when working Close-to-Metal., as Hardware isn't polite about it's interactions the same way Abstracted Layers are, politely waiting for their turn... you tell them to do something, they just DO it.

What you can do is simple... either nothing and accept it as an edge-case that *may* crash the Application from time-to-time or add #Renderer "Basic" to the start and use OpenGL.
Hopefully as this issue occurs more often TGC _might_ actually realise that their current approach is a "Problem" that needs to be fixed., but I wouldn't count on that.
There are various bigger, replicatable issues that have been left unaddressed for months (if not longer); and it feels like they've placed AppGameKit into maintenance mode, doing minor patches mostly to maintain compatibility with current iOS and Android SDKs.

So like DBP post FPS Creator... we essentially have to figure out our own workarounds.

smerf
19
Years of Service
User Offline
Joined: 24th Feb 2005
Location: nm usa
Posted: 5th Jun 2023 04:35
yeah, I keep trying new work around methods to build games and apps and i keep hitting problems, I dont have an issue with open gl and i will try it out. however i do no vulcan and opengl do handel certain textuing differently and sometimes can completely ruin a model that working in one but not the other. Thanks for the very informative information there raven.

EdzUp
21
Years of Service
User Offline
Joined: 8th Sep 2002
Location: UK
Posted: 27th Aug 2023 20:38
I don't know what your trying to do but I would have packet authentication so packets sent by your client have something which makes them known, maybe a handshake at startup and they are added to a trusted list. This way packets from outside the list are automatically ignored and deleted to stop issues arising.
-EdzUp
Patreon: https://www.patreon.com/EdzUp
smerf
19
Years of Service
User Offline
Joined: 24th Feb 2005
Location: nm usa
Posted: 4th Sep 2023 02:24
EdzUp how would you recommend not accepting a packet from a source if you have to receive a packet first to know what the source is? FIRST PACKET from a non agk source can crash agk socket client/server. Not the biggest issue in the world considering i could build a server in a different language but still an issue for the agk language.

Login to post a reply

Server time is: 2024-04-24 19:05:54
Your offset time is: 2024-04-24 19:05:54