Design Battle Royale in GM:S

Discussion in 'Game Design, Development And Publishing' started by nacho_chicken, Jun 28, 2019.

  1. nacho_chicken

    nacho_chicken Member

    Joined:
    Jun 21, 2016
    Posts:
    322
    I'm interested in creating a (2D) battle-royale style game. I've only ever dabbled in online multiplayer before. I have a few questions:
    • What are some things I'm going to have to deal with in GM regarding online MP compared to other engines/languages?
    • How should I handle the server? Would it be best to have the server written in another language and only the client written in GM?
    • What are some common pitfalls with beginners using GM networking, and how can I avoid them?
     
  2. Pfap

    Pfap Member

    Joined:
    Apr 30, 2017
    Posts:
    547
    I think determining how "real-time" you need the network operations to be would be a good starting place. What is the maximum amount of latency you can deal with in your game? The networking design should be easier if you design the game to be forgiving as possible when it comes to latency. For a battle royale style game you might be able to use a database like Redis to maintain the play state.

    If you are building a mobile based game network sockets are pretty much off the table, so you will have to find some creative way to make your game stateless. Which is a good idea in general when dealing with mobile networks I suppose.

    The server should definitely be written in a different language whatever you are familiar with should be fine, again depending on your latency requirements I would recommend Node.js or Golang. I've heard good things about Golang being really fast and Google pretty much designed it for networking and a lot of the clouds have sdks for it, also the documentation seems pretty good. I really like Node and the node package manager though and javascript is everywhere, so it's a useful language to know.

    The topic of networked games and other languages and ways to design things is really broad, so answering your question is kind of difficult.

    If I were to build a mobile 2d battle-royale game I would set up a local node server with a Redis instance and just start prototyping with that and see how it goes. Deciding exactly how to structure your data would then be the next step.
    I'm working on a game where I have the data structured into JSON lists for being sent over the network.

    Code:
    var send_list = ds_list_create();
       // add data here
       ds_list_add(send_list, direction_locker);
       ds_list_add(send_list, net_startx);
       ds_list_add(send_list, net_starty);
       ds_list_add(send_list, x);
       ds_list_add(send_list, y);
    
    Each move takes 5 "pieces" of data to perform and the above data is sent to the other client. You can use as little or as many "pieces" as you need per list, but the more you can have the client handle the less you will need to send over.

    If you need any other help or something more specific I'm pretty happy to help when I have the time and if I'm able. I should probably state that the above is just some stuff I hacked together and probably not efficient at all, but it works.
     
    nacho_chicken likes this.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice