Search Unity

Could UNet work for procedural generation?

Discussion in 'Connected Games' started by QueueTip, Jun 8, 2017.

  1. QueueTip


    May 22, 2017
    First of all, I'd like to say I've tried to look into this on the forums, but I haven't found any great answers. That's why I'm asking here.

    Would this be a bad idea? Just to see if I can, I'd like to create a very simple multiplayer map that is procedurally generated. It'll of course be a relatively small, definitive area that is generated. The dilemma I've run in to is deciding whether I could pull this off with UNet's HLAPI. It seems as though creating something like this would require a dedicated server, not the client-server setup that the HLAPI provides. I know it can be modified at a lower level, but I'm not really sure if it would be practical to program it so that it runs clients and the server independent of one another? I'm new to networking, so everything I'm saying probably sounds ridiculous anyway, hah.
  2. angusmf


    Jan 19, 2015
    Client-server? You mean client hosted? HLAPI is fully capable of working with dedicated servers, you just need a back end to connect your users to it. See the link in my sig for an example which happens to be written in unity using the LLAPI.
  3. robochase


    Mar 1, 2014
    unet's HLAPI will work just fine for a procedurally generated game...why do you think it wouldn't? what are your concerns?

    the HLAPI is mainly a way to connect players together and to make it easy to send messages to each other. it's not really tied to procedural vs non-procedural. it does provide some helpful stuff to make non-procedural stuff easier (loading fixed levels with pre-placed network objects, for example), but there isn't anything there that would make a procedural game more difficult to make, imo
  4. donnysobonny


    Jan 24, 2013
    Hmm yeah there's not a great deal of advice that can be given, we probably need more information on what you mean by "procedural" because depending on what you mean, the challenges that you'll face when it comes to the networking/multiplayer aspects will be very different.

    For example, a game like minecraft wont "spawn" every block that exists in the world, or even within your close proximity. It uses seeds and other tools to send very small pieces of data over the server for the client to decode and construct the world around them. That's just one way to do it though.

    Ultimately it will come down to a few things:
    • an understanding of UNET, both as the LLAPI and the HLAPI. Asking in here about questions that you might have will help you gain an understanding but don't attempt to choose which route to take without understanding your options fully
    • start thinking about the challenges that you are going to face. In multiplayer/networking, your goal is to send messages over the network that are as small as they possibly can be, and also send messages as infrequently as you possibly can. So it comes down to working out what it is that you NEED to send over the network and figuring out the most efficient way to do it
    If you can provide more information about what you mean by "procedural" then we can maybe offer better advice. Otherwise, good luck!