Lately I have a pretty solid plan for making global enemies work, but I am having a problem with finding out how I am going to send out near around 100 enemies with there own particular ID, X & Y Position, so that all the players can see them at all times.
Here's the scenario:
Let’s say you have 3 enemies, each of them has an ID stored in Alterable Value A. Enemy 1's ID is 1, Enemy 2's ID is 2, Enemy 3's ID is 3, each of them have there own X & Y position obviously. How can you send all of this information over MooClick over few milliseconds, so that all the players can see all of these enemies?
Plan 1: Have every single enemy send 1 message with there own particular information, every few milliseconds.
Problem: I can only get 1 of them to send at a time, this might not be a big deal for around 5 enemies, but at around 10 enemies, people will notice a major lag, not to imagine a 1 second lag with 100 enemies!
Plan 2: Every few milliseconds, a message is assembled maybe by String Parser 2, that includes all the enemy information in the fallowing form: ID;X;Y;ID;X;Y;ID;X;Y that way when its received, the player client can use each ID to position the enemies.
Problem: How is this message going to be assembled, especially if the number of enemies can not be predicted? How will the player clients know how to split this message up, again seeing that the number of enemies is not predictable.
Does anyone have any other plans that might work? I am getting pretty desprit on a working plan here, I just really wish I can get this working. I already solved the problem with finding out how I am going to host the enemy client, so I just need to find out how I am going to program this client to do what I need it to do. Any ideas? Please; Thanks.
I'll give that a shot, I never thought of 2 different delimiters in the same message. Thanks.
How ever this leaves me with 1 large question. How do I actually develop this long message, so that its always updated with the correct X & Y position? This is the number 1 problem I'm having