Search Unity

Realistic FPS Prefab multiplayer WIP

Discussion in 'Multiplayer' started by BananaClipStudio, Sep 27, 2014.

?

What Multiplayer service do you use for your game?

  1. SmartFox2x

    2.0%
  2. Photon Server

    42.9%
  3. PUN

    42.9%
  4. uLink

    4.1%
  5. Other

    20.4%
Multiple votes are allowed.
  1. BananaClipStudio

    BananaClipStudio

    Joined:
    Jul 23, 2012
    Posts:
    13
    I have been working on editing the asset to work with Smartfox2x and I have gotten pretty far but I am wondering if anyone else is trying to do that same thing and if they have found some trick that we can all bounce off each others heads. We can start posting information on here for others to learn from the work as well
     
  2. Ashkan_gc

    Ashkan_gc

    Joined:
    Aug 12, 2009
    Posts:
    1,124
    To create a realistic FPS prefab you need to change position, rotation and input of each player to the server on a relatively high priority unreliable channel. Then server should try to apply the movement and send correct results of the simulation to everyone. Ideally input and prev positions should low for a good amount of extrapolation and you should be able to use prediction easily in a FPS game unless you involve physics a lot in character movement which is unlikely in most scenarios. I know this is a lot of theory but you'll need it in order to be able to do it. So don't use reliable data sending mechanisms since the data will be updated soon. Try to pack your input to a small byte or something using a [flags] enum for example
    [flags]
    enum InputData : byte
    {
    fire=1<<0,
    attack=1<<a1;
    jump=1<<2;
    }
    This means only one byte will be used for the input values and you can send it efficiently. To set and check individual values you should use bitwise and and or operationrs (& and | in C#).
    See flags attribute in MSDN for more information.
     
  3. onlyskate13

    onlyskate13

    Joined:
    Dec 9, 2014
    Posts:
    2
    When will exit it?
     
  4. Jtuzi

    Jtuzi

    Joined:
    Jun 16, 2016
    Posts:
    2
    Is there anyone else working on this multiplayer project?