the_dude_abides
Member
Hi. This is mainly at the concept stage as a process, but I am looking into using local networking to have two versions of a game communicating with each other, and they are working in tandem. Basically a crude version of multi threading.
That side of things I can get a handle on, so the question of how efficient it is doesn't bother me at this point, as I just want to see if it works. However: with this solution comes the downside of it being a bit limited, as whatever is communicated must be fairly limited in scope.
Data that can be sent in
(a) a recognized format to go into a buffer
(b) not be so big that the act of sending it makes this set up pointless (dunno if that would be true at this point)
SO:
I have Execute Shell - which will load up the second exe of my game, and it's being called from the first exe. These are going to be "server" and "client", which for the time being is the only definite order I have to all of this, due to the local networking process.
At this point I can either:
(A)
Give them particular roles - the "client" is doing the heavy lifting on the AI side, and the "server" is doing the graphical side and smaller tasks.
Data between the two is simple values:
Say that I want to put various paths into an mp grid, and want to find a spot that is not in collision. Any path is just points in an array, and that can be passed through in a buffer as straightforward values. At the other end the heavy leg work of filling in the grid is done, looping through it and finding a free spot, and then the end result (another simple value) is passed back.
The work flow is either fixed between the two, or if the cost of transmitting data between them like this isn't too high I will see if they can mix and match roles.
(B)
Do something even more technical (if possible, of course). If the means exists to directly affect each other, such as fully being able to access grids / paths / other indexes, then I would want to look into that.
As an example:
I have several objects I want to put into the grid, with the "master" handling x amount of them, and the "slave" handling the rest.
(1)
The question is whether they could both "share" the same grid and fill data to it simultaneously, thus speeding up the end result without either taking too long ( the process, as it happens currently in a single exe, is too long and has to be divided into smaller chunks)
(2)
Both have separate mp grids. Each fills its own, and the two are then merged into one grid....? I don't know of any GMS function that merges two mp grids, so I guess that would have to be self coded (if at all doable)
OR
Each fills in its own, and maybe outputs it into a ds grid. The two ds grids are merged.....assuming this data can be passed, can the new values overwrite the old ones in a way that is useful?
Say that a cell is either true, or false, just as an mp grid would be. If the cells that are true in the "slave" can be transferred into the "master", without the negative results overriding any positive cells that the "master" has.
If I have access to both ds grids, then looping through one would be enough to control what goes into the other. At this point I don't know if there is an inbuilt function that could handle this instead, should the two different builds be able to speak directly to each other.
The user YellowAfterlife pointed me to a function they made called "function_get_address" - I'm not sure if that can be utilized for some of option B? It sounds like it could be used for a global kind of variable that the two different exe could use, but at this point I haven't yet looked into it.
And there it is....I'm not looking for anyone to do this for me, but am just after suggestions of ways either attempt (local networking, or directly) could be done. Bare in mind that the networking side of things is fine: I already have that set up, so they can communicate.
If anyone can tell me about what could be passed in a buffer between them (a whole path as is, or would I have to break that down? grid details as is, or broken down? etc) then it would be appreciated.
Or if you have any ideas about "direct access" (option B) I would like to hear them. Thanks for taking the time to read this, sorry there was so much of it
That side of things I can get a handle on, so the question of how efficient it is doesn't bother me at this point, as I just want to see if it works. However: with this solution comes the downside of it being a bit limited, as whatever is communicated must be fairly limited in scope.
Data that can be sent in
(a) a recognized format to go into a buffer
(b) not be so big that the act of sending it makes this set up pointless (dunno if that would be true at this point)
SO:
I have Execute Shell - which will load up the second exe of my game, and it's being called from the first exe. These are going to be "server" and "client", which for the time being is the only definite order I have to all of this, due to the local networking process.
At this point I can either:
(A)
Give them particular roles - the "client" is doing the heavy lifting on the AI side, and the "server" is doing the graphical side and smaller tasks.
Data between the two is simple values:
Say that I want to put various paths into an mp grid, and want to find a spot that is not in collision. Any path is just points in an array, and that can be passed through in a buffer as straightforward values. At the other end the heavy leg work of filling in the grid is done, looping through it and finding a free spot, and then the end result (another simple value) is passed back.
The work flow is either fixed between the two, or if the cost of transmitting data between them like this isn't too high I will see if they can mix and match roles.
(B)
Do something even more technical (if possible, of course). If the means exists to directly affect each other, such as fully being able to access grids / paths / other indexes, then I would want to look into that.
As an example:
I have several objects I want to put into the grid, with the "master" handling x amount of them, and the "slave" handling the rest.
(1)
The question is whether they could both "share" the same grid and fill data to it simultaneously, thus speeding up the end result without either taking too long ( the process, as it happens currently in a single exe, is too long and has to be divided into smaller chunks)
(2)
Both have separate mp grids. Each fills its own, and the two are then merged into one grid....? I don't know of any GMS function that merges two mp grids, so I guess that would have to be self coded (if at all doable)
OR
Each fills in its own, and maybe outputs it into a ds grid. The two ds grids are merged.....assuming this data can be passed, can the new values overwrite the old ones in a way that is useful?
Say that a cell is either true, or false, just as an mp grid would be. If the cells that are true in the "slave" can be transferred into the "master", without the negative results overriding any positive cells that the "master" has.
If I have access to both ds grids, then looping through one would be enough to control what goes into the other. At this point I don't know if there is an inbuilt function that could handle this instead, should the two different builds be able to speak directly to each other.
The user YellowAfterlife pointed me to a function they made called "function_get_address" - I'm not sure if that can be utilized for some of option B? It sounds like it could be used for a global kind of variable that the two different exe could use, but at this point I haven't yet looked into it.
And there it is....I'm not looking for anyone to do this for me, but am just after suggestions of ways either attempt (local networking, or directly) could be done. Bare in mind that the networking side of things is fine: I already have that set up, so they can communicate.
If anyone can tell me about what could be passed in a buffer between them (a whole path as is, or would I have to break that down? grid details as is, or broken down? etc) then it would be appreciated.
Or if you have any ideas about "direct access" (option B) I would like to hear them. Thanks for taking the time to read this, sorry there was so much of it
Last edited: