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.

Newcomers AppGameKit Corner / is there a limit of data slots in a Network Message?

Author
Message
Tobias_Ripper
11
Years of Service
User Offline
Joined: 24th Mar 2013
Location: REPCONN inc.
Posted: 5th Dec 2017 21:48 Edited at: 5th Dec 2017 21:51
Currently working on the Client Request for the server to send it the random level layout .

The Client is receiving the messages but for some reason only receiving perhaps half or a quarter of the total objects.
The ones that are getting through are in their correct positions as on the server.

This is a message that is being built and sent once when the client is connected to the server. I've got about randomly placed 200 objects, each containing x,y,z and rotation x,y,z, rotation rate and object type data so it's about 1600 data slots to be sent. And that number is going to go up every next level. So I'm looking at whether the network message has a limit I need to stick to and split the data into multiple packages.

Also is there a function that can return to total number of instances of an object? Currently I'm storing the ids of instances in an array but seeing how the above issue is somewhat vague, I want to see if perhaps the instances are being created but not properly set up, in which case using the array into which I'm storing the ids not really tell me much.

Thanks
Eisenstadt Studio: Eisenstadtstudio.com
Composers Page: Milesthatch.net
Tobias_Ripper
11
Years of Service
User Offline
Joined: 24th Mar 2013
Location: REPCONN inc.
Posted: 5th Dec 2017 23:54 Edited at: 5th Dec 2017 23:55
Alright so after testing a little bit I've gotten this info so far.

After creating a message I include 2 variables

1) id of client
2) id of packet as a float

Every packet starts with this. Then this particular packet includes the amount of objects I'm about to send,
3) Height of this level
4) Amount of objects in this level
then i have a loop that collects the level data, the first level contains 200 randomly placed and rotating objects, each carrying

5) Object type used
6) X position
7) Y position
8) Z position

9) X Rotation
10) Y Rotation
11) Z Rotation
12) Rotation Rate.

Now on the other (client side) end I've set up a couple of Print functions and temp variables to see how much data is coming through.

We get the client id and packet id just fine then I have a loop that reads how many times the loop takes place (I've tried with both For and Do loops )

Now there's a counter in place inside of the loop that takes a look at the just received "Object type used " variable which will always either be 1, 2, 3 or 4.
and IF there is a value like that in that variable, it will add a +1 to the loop counter. This is just for redunduncy.

At the end i printed out that first unique packet variable for this particular packet - the "Amount of objects". This returns 200. As it should. But it's really only the 3rd piece of data we've added and received.
Then, however I only get about 45 of those loop ticks. So that's Only 45 times that the loop actually got the "Object type used " to have received a valid value.

Sooooooo that 45 loops times the 8 data pieces of each loop it reads (that is IF the last valid loop actually reads all the data slots) so that's 360 messages, Plus the Client ID, Message ID, and the other two variables. which makes about 370 messages.

Can't complain that's already amazing as it is. Just wish it was documented so I'd code in a help files. I'll have to segment the level sync between host and clients in multiple packets.
Eisenstadt Studio: Eisenstadtstudio.com
Composers Page: Milesthatch.net
smallg
Valued Member
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location: steam
Posted: 6th Dec 2017 09:38
The message has a size limit yes but its on total size of the data sent, not number of messages (its in the help file if you want to see the exact size)... Not sure if there would be a limit on the number of parts that make up a message, seems unlikely.
You will likely need to break down the messages into smaller messages and add a way for the clients to tell which is which so they can deal with the contained info correctly.
life's one big game
spec= 4ghz, 16gb ram, AMD R9 2700 gpu

Login to post a reply

Server time is: 2024-11-24 04:30:07
Your offset time is: 2024-11-24 04:30:07