Search Unity

LLAPI transform problem

Discussion in 'Multiplayer' started by p627, Aug 7, 2015.

  1. p627

    p627

    Joined:
    Apr 12, 2014
    Posts:
    23
    Hello i have make everything to work great (RPC, commands etc..) with LLAPI but the only problem is after 5 connections in the same game it's take time from server to send player position to all clients.

    let say player 1 send position to server and server send the posistion to player 2,3,4,5 that happen with all clients. (player 2 send position to server and server send the posistion to player 1,3,4,5 etc..) so it's 5(clients)x5(repeats for each client)=25 requests from server to clients with only 5 connections.

    .. can anyone give me an example how can i make the server send position to all players with less request?
     
  2. Cirmik

    Cirmik

    Joined:
    Jan 8, 2014
    Posts:
    6
    If you need all that data for all clients, then I don't think there is a magical way of solving this.
    However you should consider if you do need to send all data to all clients all the time.

    For example you might not need to send the data of objects that don't move. Instead of sending the transform data every tick, you send the change of it, if there is no change then you don't send it. I think its called delta compression.

    Another way would be using areas of interest. After some time interval you run a check on your server about which clients care about each others' position. For example you can do it by distance - clients that are too far apart don't need to know about each other, or can be updated less frequently.
    You can make a "priority list" of multiple properties that calculates some kind of priority value out of them. For example distance, time since last update, importance and so on, then you combine them into your own "priority value". You sort the list by that value and grab some amount from the top of it. If things don't fit in the update, the time since last update value goes higher and soon it will have high enough priority value to fit. So the more important objects will update more frequently, but it lets you assign a limit about how much can fit into 1 update.

    You just need to find out how much of that data you actually need pretty much. No magical solutions here as far as I know.
     
  3. Red_Kay

    Red_Kay

    Joined:
    Aug 14, 2015
    Posts:
    94
    how did u made RPCs and commands with LLAPI? I have a problem here thought if you could help. I want the server to send some data to all clients connected, right now I can send data from each client to the server.........
     
  4. TheNoobieWaffle

    TheNoobieWaffle

    Joined:
    Jul 12, 2014
    Posts:
    28
    Same here, if you could help me out with that RPC, that would be awesome! I can make it send string messages, but not much more than that. And, I really cant find a lot of documentation or anything for the LLAPI.
     
  5. Red_Kay

    Red_Kay

    Joined:
    Aug 14, 2015
    Posts:
    94
    I quited using LLAPI. Forge better.