1
\$\begingroup\$

I'm working on a multiplayer game in GameMaker Studio 2 using sockets and built-in networking functions. I have a server that can receive and send messages to and from clients.

What I'm trying to do is take the map data (on the server) and send it to the clients, so that I can create a map on the server and have it automatically sent to clients upon entering the game. This map will be a Tilemap Layer.

Does anyone have any ides on how to serialize a GameMaker Studio 2 Tilemap to a data type that can be sent over sockets?

\$\endgroup\$
  • \$\begingroup\$ Why do you need to send the entire map? If the map is predetermined just give the clients direct access to the map data, and if the map is randomly generated just give the clients the seed you used to generate the map. You shouldn't really need to send the entire map over the net. \$\endgroup\$ – Charanor Jul 22 '17 at 12:11
1
\$\begingroup\$

As far as I know, there is no easy way to send the entire GM:S' tilemap over the Internet, but what you can do is transform your map into json\xml\etc and send it as one file. On the client side you can now parse the structure and build tiles on the run, andding them with code in previously created empty room.

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ Thanks, this is how I did it. I'm now reading the map from a text file (server-side) and then I am going to send that map to the client. \$\endgroup\$ – notme1560 Aug 4 '17 at 0:21
  • \$\begingroup\$ @Punknoodles Glad you solved that one! \$\endgroup\$ – German Gorodnev Aug 4 '17 at 14:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.