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 / Core and Threads Instructions.

Author
Message
cgw
1
Years of Service
User Offline
Joined: 29th Oct 2019
Location:
Posted: 20th Sep 2021 11:14
help, is there any instruction on how to work with threads in order to use a lot of PC cores?
Can't find anything on multithreading.
PartTimeCoder
AGK Tool Maker
6
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 20th Sep 2021 11:19
AGK is single threaded, I think this is a limitation of the OpenGL render pipeline but if you use C++ you can pipe out your AI and logic loops to a thread but the rendering must be done in the main thread.
Open Source plugins
Cl - DnD Plugin
Buy Me A Coffee
cgw
1
Years of Service
User Offline
Joined: 29th Oct 2019
Location:
Posted: 21st Sep 2021 13:02
Please make a feature in Tier1 over streams that cannot be used with OpenGL.
I looked at Cpp and didn't figure out how.
PartTimeCoder
AGK Tool Maker
6
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 21st Sep 2021 18:47
Its not as easy as that, any external threaded system would have to be tailor made for each app, if you must have threads you are going to have to learn C++, advanced usage requires advanced knowledge, no way round that I'm afraid.
Open Source plugins
Cl - DnD Plugin
Buy Me A Coffee
Raven
16
Years of Service
User Offline
Joined: 23rd Mar 2005
Location: Hertfordshire, England
Posted: 21st Sep 2021 20:01
Quote: "help, is there any instruction on how to work with threads in order to use a lot of PC cores?
Can't find anything on multithreading."


AGK is single threaded and there are no functions to support multithreading.
Now it is possible to introduce threading via plug-in ... but it isn't possible in AppGameKit Script.
Virtual Nomad
Moderator
15
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 21st Sep 2021 20:08 Edited at: 21st Sep 2021 20:25
this is all beyond me but i believe the Box2D implementation supports multi-threading which, i believe, does so without a dll while working on all platforms? see .../Box2d/Common?

i know that's not necessarily what's being discussed here but doesn't this imply that AppGameKit can, somehow, utilize multi-threading, otherwise?

then, and again, "beyond me", but i expected to hear more about this compute plugin. not necessarily on topic here but can't this accomplish at least some of what's being sought?
[My Itch.io Home] [AGK on Itch.io]
[AGK Resource Directory] [TGC @ GitHub]
[CODE lang=agk] YOUR CODE HERE [/CODE]
[VIDEO=youtube] VIDEO ID [/VIDEO]
[AGK Showcase][Google Forum Search]
PartTimeCoder
AGK Tool Maker
6
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 21st Sep 2021 22:31
Yes on the backend AppGameKit uses threads for physics and HTTP ETC just as we can use threads in our C++ or plugin code, Box2D does not draw, it tells the sprite class where to draw after its done its calculations in the thread so its safe to use in a thread, I would suspect much of the 3D stuff is in a thread or 2 as well

Problem is I cant just thread every agk function inside a plugin, give me a problem or situation and I can give you a threaded solution but something like this would need to be hand made to suit the project needs, there is no, and will never be no all-in-one generic solution.

Compute, yeah I never understood that one TBH, I can achieve the similar results piping to a plugin thread so I never gave it much of a look but looks like it pipes the logic out to the GPU, not exactly multithreading but it takes the strain off the CPU so it could be a solution, just need to learn HLSL, either way there is a language to learn I'd just go with C++
Open Source plugins
Cl - DnD Plugin
Buy Me A Coffee

Login to post a reply

Server time is: 2021-10-21 02:23:55
Your offset time is: 2021-10-21 02:23:55