Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

uSurvival Official Thread - Unity Multiplayer Survival Asset

Discussion in 'Assets and Asset Store' started by vis2k, May 14, 2018.

  1. vis2k

    vis2k

    Joined:
    Sep 4, 2015
    Posts:
    3,282
    The uSurvival example player actually uses a lot of different animations from different models via retargeting. So that definitely works :)
     
  2. vis2k

    vis2k

    Joined:
    Sep 4, 2015
    Posts:
    3,282
    V1.40 pending review:
    • Upgraded to Unity 2018.3.6 to prepare for LTS, and to avoid 2018.2 memory leak bug (https://github.com/vis2k/Mirror/issues/427)
    • Player, Zombie, Arrow rigidbody collision detection changed to 'Continous Speculative' to avoid 2018.3.6 warning
    • PlayerAnimation: apply to all animators to properly animated skinned mesh equipment
    • PlayerHotbar: call UPPERBODY_USED trigger in all animators to work with skinned meshes too
     
    Drannach and SunLeaf like this.
  3. HiddenFace

    HiddenFace

    Joined:
    Feb 13, 2016
    Posts:
    12
    Hi,
    A little improvment for this amazing asset will be a 360° camera. Players needs to look at behind them when looting.
     
  4. vis2k

    vis2k

    Joined:
    Sep 4, 2015
    Posts:
    3,282
    There is a free look mode already. See the tooltip on the bottom right.
     
  5. ParadoxSolutions

    ParadoxSolutions

    Joined:
    Jul 27, 2015
    Posts:
    272
    I updated to the latest version of Unity (2018.7), Unity hub, and uSurvival and I'm getting weird DLL conflicts:

    Code (CSharp):
    1. PrecompiledAssemblyException: Multiple precompiled assemblies with the same name Telepathy.dll included for the current platform. Only one assembly with the same name is allowed per platform. Assembly path: {0}
    2. UnityEditor.Scripting.ScriptCompilation.EditorBuildRules.CreateTargetAssemblies (System.Collections.Generic.IEnumerable`1[T] customScriptAssemblies, System.Collections.Generic.IEnumerable`1[T] precompiledAssemblies) (at C:/buildslave/unity/build/Editor/Mono/Scripting/ScriptCompilation/EditorBuildRules.cs:249)
    3. UnityEditor.Scripting.ScriptCompilation.EditorCompilation.UpdateCustomTargetAssemblies () (at C:/buildslave/unity/build/Editor/Mono/Scripting/ScriptCompilation/EditorCompilation.cs:619)
    4. UnityEditor.Scripting.ScriptCompilation.EditorCompilation.SetAllCustomScriptAssemblyJsons (System.String[] paths) (at C:/buildslave/unity/build/Editor/Mono/Scripting/ScriptCompilation/EditorCompilation.cs:728)
    5. UnityEditor.Scripting.ScriptCompilation.EditorCompilationInterface.SetAllCustomScriptAssemblyJsons (System.String[] allAssemblyJsons) (at C:/buildslave/unity/build/Editor/Mono/Scripting/ScriptCompilation/EditorCompilationInterface.cs:217)

    and

    Code (CSharp):
    1. Microsoft (R) Visual C# Compiler version 2.9.1.65535 (9d34608e)
    2. Copyright (C) Microsoft Corporation. All rights reserved.
    3. error CS1703: Multiple assemblies with equivalent identity have been imported: 'C:\Users\me\myProject\Assets\uSurvival\Plugins\Sqlite\sqlite_common\System.Data.dll' and 'C:\Program Files\Unity\Hub\Editor\2018.3.7f1\Editor\Data\MonoBleedingEdge\lib\mono\4.7.1-api\System.Data.dll'. Remove one of the duplicate references.
    4. error CS1704: An assembly with the same simple name 'Telepathy' has already been imported. Try removing one of the references (e.g. 'C:\Users\me\myProject\Assets\uSurvival\Plugins\Mirror\Telepathy.dll') or sign them to enable side-by-side.

    Usually when I get errors like this I just delete the duplicate DLL but these errors point to an external DLL of the same name as included with uSurvival meaning it is conflicting with a DLL used by the Unity editor and not with another DLL in the project files/plugins folder. Are you sure you compiled the assemblies correctly before packing the unitypackage file?
     
  6. vis2k

    vis2k

    Joined:
    Sep 4, 2015
    Posts:
    3,282
    Yes.
    Try a fresh asset store download.
    If that doesn't work, you could also just delete the DLL file and download Telepathy source files from: https://github.com/vis2k/Telepathy
     
  7. craftrap

    craftrap

    Joined:
    Apr 25, 2015
    Posts:
    29
    Would you say to add material to the inventory, for example when you talk to NPC, add goods to the inventory.
    Example. Add(Inventory. "Banana", "1")
     
  8. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    9,794
    Hi - If you happen to be using the Dialogue System addon for uSurvival, you'd use AddItem("Banana", 1) in the conversation node's Script field. If you have questions about the Dialogue System, please bring them to its forum thread so we don't hijack this thread. If you're not using the Dialogue System, just ignore this. :)
     
  9. vis2k

    vis2k

    Joined:
    Sep 4, 2015
    Posts:
    3,282
    The inventory component has an Add function like that
     
  10. craftrap

    craftrap

    Joined:
    Apr 25, 2015
    Posts:
    29
    i find and edit this code.but i dnt fix item empty to add . i edit default items i add new sciprtable items. but dnt add if not empty inventory.
    Code (CSharp):
    1.         for (int i = 0; i < inventory.size; ++i)
    2.                             {
    3.                                 // add empty slot or default item if any
    4.                                 inventory.slots.Add(i < inventory.defaultItems.Length ? new ItemSlot(new Item(inventory.defaultItems[i])) : new ItemSlot());
    5.                             }
     
  11. vis2k

    vis2k

    Joined:
    Sep 4, 2015
    Posts:
    3,282
    Use PlayerInventory.Add:
    upload_2019-3-7_9-34-39.png
     
  12. antey3064

    antey3064

    Joined:
    Mar 21, 2016
    Posts:
    15
    The number of polygons of the character affects the ping? Lod0 my individual consists of 300 thousands of polygons. When I connect to the server the delay is over 400ms
     
  13. ParadoxSolutions

    ParadoxSolutions

    Joined:
    Jul 27, 2015
    Posts:
    272
    Redo the topology, a multiplayer realtime application probably shouldn't ever have a character with that many polygons, save that lod for a pre rendered cutscene. More than 6 players on screen with that many polygons will probably kill most players performance.
     
  14. ParadoxSolutions

    ParadoxSolutions

    Joined:
    Jul 27, 2015
    Posts:
    272
    67,000 tris was Unity max for a long time, I would say 30k is high, stay around 10k for players and less for NPCs. 2k if you have a low poly style game.

    Edit: I'm by no means a 3D artist those numbers are max LOD0 values I just pulled out of thin air, look at uSurvivals volund model geometry and get an idea of how many polygons your character should have.
     
  15. antey3064

    antey3064

    Joined:
    Mar 21, 2016
    Posts:
    15
    I have a great optimization in single player. Even with 1000 characters on the screen with 4 LOD the FPS is high. GTX 1070 graphics card.
     
  16. vis2k

    vis2k

    Joined:
    Sep 4, 2015
    Posts:
    3,282
    Number of polygons doesn't directly affect ping.
    But if you have so many that your frame rate drops, then ping will increase because it gets updated less often.
     
    antey3064 likes this.
  17. iSleepzZz

    iSleepzZz

    Joined:
    Dec 23, 2012
    Posts:
    137
    Hey vis2k, hopefully all is well!
    I have a quick question, I was reading the entire documentation on uSurvival and I noticed this statement under Player Movement:
    "The PlayerMovement and NetworkTransformRubberbanding components are the only two components that are client authoritative."

    Does that mean uSurvival uses client authoritative movement in the game? So the player's movements are not server-authoritative?
     
  18. vis2k

    vis2k

    Joined:
    Sep 4, 2015
    Posts:
    3,282
    Yes, at the moment. It's actually rubberband movement, where the client can move freely and the server validates each move - and resets the client if the move was not allowed.

    That system is almost done, the only thing that's left is the actual rubber part. I just need to add some checks to the ValidateMovement function, then it will be cheat safe.
     
    Drannach likes this.
  19. iSleepzZz

    iSleepzZz

    Joined:
    Dec 23, 2012
    Posts:
    137
    Ok awesome! Can’t wait to see this implemented!:)
     
    vis2k likes this.
  20. johny256

    johny256

    Joined:
    Mar 3, 2015
    Posts:
    186
    I hope first person support
    Animation reloading, aiming, run weapon and walk veapon
     
  21. vis2k

    vis2k

    Joined:
    Sep 4, 2015
    Posts:
    3,282
    uSurvival works in first person, yes. You can use the mouse wheel to zoom in.
     
  22. TechSins

    TechSins

    Joined:
    Feb 16, 2015
    Posts:
    142
    @vis2k i think @johny256 means individual first person support so just fps arms not attached to a 3rd person body
     
  23. iSleepzZz

    iSleepzZz

    Joined:
    Dec 23, 2012
    Posts:
    137
    Oh that's not too bad to implement, whenever your in "first person mode" just turn do this all local client-sided:
    - turn off your player mesh
    - turn on your hands mesh (that is animated with reload, shoot, etc)
    - attack itemmodel prefab to the hands

    Done! It's very easy because you don't have to have any network in-mind, simply do it all local client-side so only your instance sees the first person hands and such.
     
    vis2k likes this.
  24. antey3064

    antey3064

    Joined:
    Mar 21, 2016
    Posts:
    15
    Figured out how to create "EquipmentItem" and put a static mesh on the character.
    How to wear "Skinned Mesh Render" clothes? which has a binding to the skeleton. I tried to create a prefab of" Skinned Mesh Render " clothes attached to the character, but the clothes in the prefab became invisible.
     
    Last edited: Mar 13, 2019
  25. johny256

    johny256

    Joined:
    Mar 3, 2015
    Posts:
    186
    Gud. Upper body aiming? Transform position And rotation upper body player?
     
  26. vis2k

    vis2k

    Joined:
    Sep 4, 2015
    Posts:
    3,282
    Skinned meshes are just animated 3D models. You'll have to ask your artist to create them for you.
    uSurvival simply passes animation parameters not only to the player animator, but to all child animators too. That's the whole trick.
     
  27. vis2k

    vis2k

    Joined:
    Sep 4, 2015
    Posts:
    3,282
    V1.41 pending review! Another important bug fix release.
    • Mirror updated to latest version (sceneID fix, Websockets, source based Weaver)
    • removd message ids
    • fixed missing NetworkIdentity component in battle royale sphere
    • FSM._state and .state merged into one variable
    • Net 4.X syntax for Item.cs getters
    • Database.ExecuteReader: add comment on why we keep the current solution
    • NetworkManager.OnClientReceivePopup renamed to OnClientError
    • NetworkManager.ClientSendPopup renamed to ServerSendError
    • CharacterDeleteMessages inherits from IntegerMessage to simplify code
    • Use nameof(function) for Invoke/InvokeRepeating. also fixes a bug where NetworkManagerSurvival.OnStopServer would try to cancel the wrong save function
    • UI singletons: only assign once to fix Network Zone errors where UI elements would refer the destroyed panels instead of the ones in DontDestroyOnLoad
    • NetworkNavMeshAgent: add agent.ResetPath detection. it only works right now because agent.velocity is != 0 after resetting the path for some reason
     
    AdamQ likes this.
  28. johny256

    johny256

    Joined:
    Mar 3, 2015
    Posts:
    186
    Integration unistorm easy:)
     
  29. langtusaupt

    langtusaupt

    Joined:
    Mar 15, 2017
    Posts:
    5
    Dear Vis2k !
    After upgrading the 141 version, I had a problem in the console window with no line script number available, making it difficult to correct the error. Previous versions did not encounter this error
    upload_2019-3-19_10-51-14.png
     
  30. vis2k

    vis2k

    Joined:
    Sep 4, 2015
    Posts:
    3,282
    That looks like a Unity problem. Please report it to Unity with the bug report tool.
     
  31. langtusaupt

    langtusaupt

    Joined:
    Mar 15, 2017
    Posts:
    5
    I have just studied. My other projects have no problems. When I Play u the Survival Demo scene, what is the difference between the Debug.log in the image.
    upload_2019-3-19_19-37-1.png
     

    Attached Files:

  32. vis2k

    vis2k

    Joined:
    Sep 4, 2015
    Posts:
    3,282
    Which Unity version are you using?
    uSurvival simply calls Debug.Log, I have never seen that not show a line number. Very strange.
     
  33. langtusaupt

    langtusaupt

    Joined:
    Mar 15, 2017
    Posts:
    5
    Thanks!
    I test in Unity 2018.3.6, Unity 2018.3.9, Unity 2019.2b and other computer . Very strange.
    I sent an bug report to Unity and am waiting for a response
     
  34. craftrap

    craftrap

    Joined:
    Apr 25, 2015
    Posts:
    29
    Door audio sync not work.
    Command function CmdFire called on server.
    UnityEngine.Debug:LogError(Object)
    kapi:CallCmdFire()
    kapi:OnInteractServer(GameObject) (at Assets/scriptler/kapi.cs:58)
    Interaction:CmdInteract(Vector3) (at Assets/uSurvival/Scripts/Interaction.cs:65)
    Interaction:InvokeCmdCmdInteract(NetworkBehaviour, NetworkReader)
    Mirror.NetworkIdentity:HandleCommand(Int32, NetworkReader)
    Mirror.NetworkServer:OnCommandMessage(NetworkMessage)
    Mirror.NetworkConnection:HandleBytes(Byte[])
    Mirror.NetworkConnection:TransportReceive(Byte[])
    Mirror.NetworkServer:OnData(NetworkConnection, Byte[])
    Mirror.NetworkServer:HandleData(Int32, Byte[], Byte)
    Mirror.NetworkServer:InternalUpdate()
    Mirror.NetworkServer:Update()
    Mirror.NetworkIdentity:UNetStaticUpdate()
    Mirror.NetworkManager:LateUpdate()

    Code (CSharp):
    1. using UnityEngine;
    2. using Mirror;
    3.  
    4. [RequireComponent(typeof(AudioSource))]
    5. public class kapi : NetworkBehaviour, Interactable
    6. {
    7.     public AudioClip kapisesi;
    8.     public Animator animator;
    9.     private Audiosync audiosync;
    10.     public AudioSource source;
    11.     GameObject player;
    12.     [SyncVar] public bool open;
    13.  
    14.  
    15.     void Start()
    16.     {
    17.         source = this.GetComponent<AudioSource>();
    18.     }
    19.  
    20.     [ClientCallback]
    21.     void Update()
    22.     {
    23.         animator.SetBool("Open", open);
    24.  
    25.     }
    26.  
    27.     [Command]
    28.     void CmdFire()
    29.     {
    30.         RpcOnFire();
    31.     }
    32.  
    33.     // this is called on the tank that fired for all observers
    34.     [ClientRpc]
    35.     void RpcOnFire()
    36.     {
    37.         source.PlayOneShot(kapisesi);
    38.     }
    39.  
    40.  
    41. // interactable ////////////////////////////////////////////////////////////
    42. public string GetInteractionText()
    43.     {
    44.         return (open ? "Close" : "Open") + " door";
    45.     }
    46.  
    47.     [Client]
    48.     public void OnInteractClient(GameObject player)
    49.     {
    50.         open = !open;
    51.         CmdFire();
    52.     }
    53.  
    54.     [Server]
    55.     public void OnInteractServer(GameObject player)
    56.     {
    57.         open = !open;
    58.         CmdFire();
    59.     }
    60. }
    61.  
     
    Last edited: Mar 27, 2019
  35. johny256

    johny256

    Joined:
    Mar 3, 2015
    Posts:
    186
    vis2k--Trello upgrade progres?
     
  36. vis2k

    vis2k

    Joined:
    Sep 4, 2015
    Posts:
    3,282
    Like the error message says, you shouldn't call CmdFire on the server in OnInteractServer.
    Put the code into a Fire() function and call it from CmdFire. Then call Fire in OnInteractServer.

    Emptying my uMMORPG ToDo list at the moment. Full on uSurvival afterwards, probably starting mid next week.
     
  37. craftrap

    craftrap

    Joined:
    Apr 25, 2015
    Posts:
    29
    When I add an EBS build part after the server, the screen becomes problem. How do we save these prefabs parts in advance? Examlpe start the server ı build EBS door part but ı cant interact the door. I register to prefab networkmanager but still not work.
     
  38. vis2k

    vis2k

    Joined:
    Sep 4, 2015
    Posts:
    3,282
    I never tried EBS. Probably best to contact the EBS creator for that question.
     
  39. craftrap

    craftrap

    Joined:
    Apr 25, 2015
    Posts:
    29
    I want to add shotgun raycast and How can I adjust the damage by distance?
     
  40. vis2k

    vis2k

    Joined:
    Sep 4, 2015
    Posts:
    3,282
    Start by measuring the distance. Go from there :)
     
  41. VE_GAME

    VE_GAME

    Joined:
    Mar 13, 2014
    Posts:
    39
    Hi,
    I recently bought Survival.
    I wanted to know about the database.
    If my world is 2 X 2 kilometers,maximum online will not exceed 100 people.
    Will I have enough sqlite?
    Or is it better to still use mqsli ?
    I do not ask to do it for me, I will do it all myself.
    Just thinking whether to bother.
    Thanks in advance.
    Sorry for bad english, this is not my native language.:)
     
  42. vis2k

    vis2k

    Joined:
    Sep 4, 2015
    Posts:
    3,282
    Sqlite is fine for 100 players, don't worry about it.
    Sqlite is a really solid database. Read their wikipedia page, it's really interesting.
     
  43. VE_GAME

    VE_GAME

    Joined:
    Mar 13, 2014
    Posts:
    39
    Thanks for the quick response.
    vis2k you are a good man.
    I will go to learn Sqlite/
     
    vis2k likes this.
  44. johnlanz

    johnlanz

    Joined:
    Sep 2, 2016
    Posts:
    37
    when i tried to use Enet transport (Ignorance) and update mirror to latest version, I've got errors like this one:
    Code (CSharp):
    1. Assets\uSurvival\Plugins\Mirror\Components\NetworkLobbyManager.cs(325,30): error CS0115: 'NetworkLobbyManager.OnStartClient()': no suitable method found to override
     
  45. vis2k

    vis2k

    Joined:
    Sep 4, 2015
    Posts:
    3,282
    You can delete the NetworkLobbyManager if it causes problem. It's not needed in uSurvival.
    Sounds like something wasn't updated/overwritten properly.
     
  46. craftrap

    craftrap

    Joined:
    Apr 25, 2015
    Posts:
    29
    How do I print the name of the person who killed and died? This feature appeared in the UMMORPG chat. but I didn't see it at USURVIVAL.
     
  47. vis2k

    vis2k

    Joined:
    Sep 4, 2015
    Posts:
    3,282
    Call GetComponent<PlayerChat>().TargetInfoMessage
     
  48. vis2k

    vis2k

    Joined:
    Sep 4, 2015
    Posts:
    3,282
    Update: V1.42
    • Mirror updated to latest version (lots of fixes and improvements)
    • Use SyncList<struct> instead of SyncListSTRUCT everywhere
    • NetworkProximityGridChecker: playerController != null check not needed anymore
    • NetworkManagerSurvival.OnServerAddPlayer: null check message.value bytes
    • UILogin: disabled host, dedicated buttons if webgl because webgl can't start a server
    • PlayerChat: local chat uses [ClientRpc] instead of sending a [TargetRpc] to each observer manually
    • [TargetRPC] NetworkConnection parameter removed everywhere because it's optional now
    • Grid renamed to Grid2D to avoid Unity 'Grid class already exists' warning
    • NavmeshPathGizmo renamed to NavMeshPathGizmo
    • Fixed NavMeshPathGizmo NullReferenceExeption after rebuilding scripts sometimes
    • Change enum types to byte to minimize bandwidth
    • Zombie.startPosition is now set in Start instead of Awake, because that's what Start is for. Fixes a bug where runtime spawned monsters weren't respawning properly.
    • Fixed UI Chat activating during WASD movement because the scrollbar Navigation setting was set to Automatic, also enabling keyboard navigation. Setting it to None disables it and fixes the bug.
    • Player default inventory items are now configurable with amount by using ScriptableItemAndAmount type
    • PlayerInventory.CmdSwapInventoryEquip moved into separate SwapInventoryEquip function that can also be used on the server
    • EquipmentItem.Use reuses PlayerEquipment.SwapInventoryEquip function for proper validation and proper health > 0 checks etc.
    • PlayerEquipment default item reuses ScriptableItemAndAmount. Make sure to reassign your player prefab's default equipment items and amounts when upgrading.
    • UI Confirmation window, used in UICharacterSelection to delete characters with less risk for accidental clicks.
    • Database: characters.name field is created with COLLATE NOCASE so that CharacterExists is case insensitive and we can't create both 'Volund' and 'volund' characters.
     
  49. craftrap

    craftrap

    Joined:
    Apr 25, 2015
    Posts:
    29
  50. vis2k

    vis2k

    Joined:
    Sep 4, 2015
    Posts:
    3,282
    The image doesn't load.