TLDR; Looking for more efficient ideas on my Network Architecture, I’d like to keep the part that is not a WIP for my Network Architecture if possible, and there are code questions down below in bullet point form.
Current Working Code [GitHub - License] (small revisions and questions will go in posts below)
I’m looking for some further insight on the ideas I came up with for handling an expandable user-base at an affordable cost.
I made a post long ago where I asked a few questions concerning the performance of Unity in terms of MMO games and how Unity handles multiple cores. Eventually, the thread started getting a bit off-topic, since my questions were already answered. I’m pretty set with sticking with Unity and have begun using the Transport Layer API to start working on a prototype to match my ideas.
The current network architecture can be found in the README.md for the GitHub repository. I’m more than happy to accept full or partial revisions of the parts labeled under WIP. But I am obstinate when it comes to changes to the rest of the ideas.
Current Code Questions:
- Send() does not work as soon as Connect() is finished. How should I go about making sure they are connected before Send() goes through? My initial thought was to add a boolean indicating whether or not they are connected. The boolean would be set in Listen(). A question still unanswered though is, how could I make sure the message waits until they are connected? My thought on this part was to add it to a list that serves as a buffer. Then send them all out when ready. This would require a while loop though.
- What would be an efficient way to relay client updates to other clients on different servers?
- What is a good way to go about spawning nearby clients?
Solved Code Questions:
- As an example, say there was a Hello() method. This Hello() method takes a string parameter and prints it to the console of the Master Server. How should I go about having the Send() method on the Server tell the Master Server to run Hello() with the string “World”? The key question here is, how can I minimize the amount of data being sent?
- There’s a WhoAmI() method and it takes a string parameter. It also returns a string. The return is simply the whatever the parameter is. How should I go about receiving this data? Once again, the key question here is efficiency.
- I heard that using BinaryFormatter isn’t the fastest way available to send data. If this is true, what would be a better method to take? The serialization code is an example from here as well.
- Send() does not work as soon as Connect() is finished. How should I go about making sure they are connected before Send() goes through? My initial thought was to add a boolean indicating whether or not they are connected. The boolean would be set in Listen(). A question still unanswered though is, how could I make sure the message waits until they are connected? My thought on this part was to add it to a list that serves as a buffer. Then send them all out when ready. This would require a while loop though.