Search Unity

World exporting for standalone server

Discussion in 'Multiplayer' started by callumhutchy, Feb 13, 2019.

  1. callumhutchy

    callumhutchy

    Joined:
    Feb 6, 2014
    Posts:
    4
    I have been developing a standalone C# server that allows multiple clients to connect to it, currently, there are basic features like spawning/despawning players and players movement. Ideally, the server should be Authoritative, but for this, the server would have to know collision points so that it can tell if a player is making an illegal move.

    How would I go about getting my world information out of unity and then into a readable format for the server? It would need to include terrain and objects, is there a way to combine terrain and scene objects into one large mesh which I could somehow interpret server side. The current hurdle is getting the data out of Unity, then I can tackle making that information useful to the server.

    I posted a similar question on Answers before but feel this is more of a topic that needs discussing.
     
  2. LukeDawn

    LukeDawn

    Joined:
    Nov 10, 2016
    Posts:
    404
    Create a exporter in your terrain building project that iterates through every box collider in the scene and saves out a text file with position and size. You can then load this into your server and build a simple collision engine from the data.

    Edit: I went down this route initially, but as my game is never going to be insanely popular (if it ends up being, I'll have the cash to fix it), so I went with local collision detection and control. Yes you could cheat, but is it worth it? There'll be far superior games to use your haxor leet talents on.