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.

DarkBASIC Professional Discussion / memblock send issue

Author
Message
Southside Games
16
Years of Service
User Offline
Joined: 1st Jan 2010
Location: Don\'t tell me what to do!
Posted: 21st Sep 2013 23:25 Edited at: 21st Sep 2013 23:30
Hello.

I'm using mutisync for my game and am using memblocks to send the data. because the map data is stored in an array to begin with using "make memblock for array" seemed like the obveos choice. thing is though is when I receive the memblock the data is wrong, not even out of sync, but different data all together.

Code that loads the data from a file to an array. Then sends it to all players (does not have an issue as I can tell)



code for clients to receive and view the data. (only the first 16 are shown. Note that the for x and y thing was crammed in to see if it was loading the data correctly before it loads the map and is not final code.)



Code I added to the host loop to see if he could read the array correctly. Same thing as above.


I added a photo to show you the numbers it gives.

Thanks
Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 22nd Sep 2013 13:54
Quote: "when I receive the memblock the data is wrong, not even out of sync, but different data all together.
"


Make Memblock From Array / Make Array From Memblock commands are not consistent. Worse with the inclusion of string fields. I took a similar route you are taking and found discrepancies.

It is better to create your own memblock conversion functions, and using the Matrix1 commands as an aid.

It feels like a pain at first but in the long run your functions can be reused easily and the game will work.

Login to post a reply

Server time is: 2026-07-07 00:09:58
Your offset time is: 2026-07-07 00:09:58