Search Unity

uSurvival Official Thread - Unity Multiplayer Survival Asset

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

  1. SirTwistedStorm

    SirTwistedStorm

    Joined:
    Sep 20, 2015
    Posts:
    183
    I can confirm no errors on 2019.2
     
    tylerguitar75 likes this.
  2. vis2k

    vis2k

    Joined:
    Sep 4, 2015
    Posts:
    3,303
    2018.3.6 is still recommended. We are waiting for a linux bug fix from Unity, which was already applied to 2019.2+.
     
  3. craftrap

    craftrap

    Joined:
    Apr 25, 2015
    Posts:
    29
    player.GetComponent<Health>().current += usageHealth * (int)Time.deltaTime * 1;
    I use it to use a slow potion, but it doesn't work.(PotionItem.cs) I using medkit but not Effect
     
  4. vis2k

    vis2k

    Joined:
    Sep 4, 2015
    Posts:
    3,303
    Time.deltaTime is in seconds. So it's likely '0' if you round it to int, so your whole right side of the equation becomes 0.
     
    MarshallVisions likes this.
  5. craftrap

    craftrap

    Joined:
    Apr 25, 2015
    Posts:
    29
    How to unequip durability 0 item because item durability 0 but not change damage & defense this is big problem FPS games. And Potion item countdown not working. I asked u how to overtime HP potion working.
    Scriptable item problems.
    Countdown not work.
    Durability 0 but The equipment can still be used..


    You just say.Time.deltaTime is in seconds. So it's likely '0' if you round it to int, so your whole right side of the equation becomes 0.
    This is you system and give me good idea code.You just comment and it doesn't solve the problem. Thanks for support..
     
  6. vis2k

    vis2k

    Joined:
    Sep 4, 2015
    Posts:
    3,303
    Sounds like you found a bug. Will take a look.

    If you want to add a feature yourself then you'll have to do the hard work yourself too :)
    If you post the code again then I can give you suggestions like last time.

    This will be added in a few weeks. I am currently working on the low level networking part of uSurvival, which is very difficult to get right but it will probably double the amount of players that can play at the same time :)
     
    Djayp likes this.
  7. craftrap

    craftrap

    Joined:
    Apr 25, 2015
    Posts:
    29
    I've added enough features to my game. But these are the bugs of your original project.
    -Countdown not work
    -Durability 0 but The equipment can still be used.(Try Equip %0 durability axe)
    -Cannot merge same items.
    -Craft system not work stably.
    -Furnace does not work stably.
    TEST SERVER GOOGLE CLOUD
    8 vCPU, 30 GB RAM
    Ubuntu, 16.04 LTS
    Germany, Frankfurt


    You can work as a server stable. You should try it in real time. There is a lot of delay on the network. For example, while the Player is crafting an item. The server detects a delay and makes it unlimited craft items..
    if you want to try u system
    https://www.justitsurvive.com/
     
  8. vis2k

    vis2k

    Joined:
    Sep 4, 2015
    Posts:
    3,303
    Item cooldowns aren't implemented yet, but will be soon.

    I just tried. I can drag it onto the hotbar, I can put it in the hands but I can't actually use / swing it. Same for food items. Are we talking about the same thing?

    You can, but you can not merge two items with different durabilities. But I have been thinking about this, perhaps I should remove durability from certain item types (e.g. banana) and limit max stack size to 1 for durability items.

    Can you make a video please?
     
  9. craftrap

    craftrap

    Joined:
    Apr 25, 2015
    Posts:
    29

    I think your system is consuming too much network. This eliminates delays and some access restrictions.
    BUGS
    8 CPU 30GB RAM Linux system

    The map of my game is very large and about 8gb is about 15 to 20 players at the same time.75 - 90ms on Client
    PLAYERS REPORTED THIS BUGS
    - Unlimited Crafting
    - Merge problem
    - Crossbow destroyed structures only 1 arrow.
    - Durablity item not change damage and defense ( Maybe you should durtablity 0 item auto drop or destroy)
    and lastly items don't disappear from the floor.
    Sometimes it works fine. Remember I made the craft system right.
    What can I do to avoid building a place while building. Give me an idea. for example, you cannot place pallets in a city area.Thanks for support.Because players can go up to the sky.
     
    Last edited: Sep 19, 2019
    socialsumate likes this.
  10. vis2k

    vis2k

    Joined:
    Sep 4, 2015
    Posts:
    3,303
    V1.64 pending review:
    • Mirror updated to latest version (auth, sync-to-owner, allocation-free send)
    • Hydration/Nutrition/Temperature/Endurance energies sync mode set to Owner to save bandwidth
    • PlayerRespawning/Inventory/Combat/Construction sync mode set to owner to save bandwidth
    • NetworkAuthenticatorSurvival component added to NetworkManager. takes care of all the authentication, and unauthenticated connections can't send messages (or bypass authentication) anymore; OnServerLogin addon hook renamed to OnServerConnect.

    Try V1.64. many components now sync only to the owner, not to everybody.

    You can modify crossbow damage / structure health so they don't get destroyed in one hit.
    Will take a look at the video, thanks.
     
  11. vis2k

    vis2k

    Joined:
    Sep 4, 2015
    Posts:
    3,303
    tylerguitar75 likes this.
  12. vis2k

    vis2k

    Joined:
    Sep 4, 2015
    Posts:
    3,303
    V1.65 pending review:
    • Weapons use new item cooldowns too. Fixes a bug where having one 10s cooldown on one item would require 10s before using the next item of a different type too
    • Fixed some build warnings
    • Save and load hotbar selection in Database for a better user experience
    • FirstPersonClipping uses a new HideInFirstPerson layer to hide meshes in first person. Main Camera clips this layer, Volund Prefab's Equipment Avatar camera shows this layer. Fixes a bug where the player head in first person would be hidden in the equipment avatar. Also improves performance because less draw calls and no material swaps are needed.
    • Football helmet equipment item for easier testing
    • FirstPersonClipping: use transforms instead of renderers and hide all renderers in children. this way it works for equipments lots (like head slot) too. Make sure to reassign the hideRenderers in the player prefab's FirstPersonClipping component when upgrading.
    • FirstPersonClipping: calculate nodepth layer name only once
    • ItemModel layer created and assigned to all item models. Both main camera and player prefab's avatar camera show the ItemModel layer now. fixes a bug where the helmet wouldn't be shown in the equipment avatar unless in first person.
    • Equipment slots can now be dragged out of the window to drop the item to the ground
     
    tylerguitar75 likes this.
  13. Gabo_campitelli

    Gabo_campitelli

    Joined:
    Oct 17, 2012
    Posts:
    287
    Hello,

    Sorry for my noobity on the subject... but how is master server service dealed? Do i still have CCU limits?
    is it possible to add p2p logics?

    Thanks.
     
  14. vis2k

    vis2k

    Joined:
    Sep 4, 2015
    Posts:
    3,303
    There is no CCU limit or master server. you basically just host it on a dedicated server and go from there.
    You can of course connect it to your own master server if you wanted to
     
  15. vis2k

    vis2k

    Joined:
    Sep 4, 2015
    Posts:
    3,303
    V1.66 pending review: Addresses several of the recent issues, and makes database 10x faster!
    • ItemDropSpawners removed. ItemDrops now have a 'respawn' and 'respawnInterval' property. They can be placed directly in the scene for an easier workflow, and instead of Destroying+Spawning, they are simply hidden for much better performance. Additionally we avoid lots of unnecessary ItemSpawner NetworkIdentities in the scene too. When upgrading manually: make sure to reassign the proximityChecker field in each ItemDrop and replace your ItemDropSpawners with the ItemDrops directly and enable respawn and respawnInterval for them in the scene.
    • Removed Outline shader for compatibility with Standard Shader and future rendering pipelines.
    • NetworkManagerSurvival: character creation code moved into separate function
    • Reimplemented SQLite database for 10x performance improvements. make sure to delete your old database file when upgrading manually.
    • Database: renamed structure x/y/zRot to x/y/zrotation for consistency
    • Database: renamed character table's class field to classname to avoid C# name collisions with built in 'class'
    • football helmet: added durability to tooltip
    • ScriptableItem.OnValidate: disallow durability for stackable items to avoid confusion when people can't stack the same item types with different durabilities.
    • UIEquipment, UIHotbar: reset image color to white for no-durability items. Fixes a bug where no-durability items could still have the wrong color when dragging them into a slot where a durability item was before.
     
  16. socialsumate

    socialsumate

    Joined:
    Apr 29, 2018
    Posts:
    20
    Someone could show me how to update the project without losing my progress.
     
  17. thevisad

    thevisad

    Joined:
    Jan 29, 2018
    Posts:
    8
    Build new assets using the examples provided, don't modify the existing assets to do what you want.
     
    socialsumate and MarshallVisions like this.
  18. vis2k

    vis2k

    Joined:
    Sep 4, 2015
    Posts:
    3,303
    V1.67 pending review:
    • NetworkmanagerSurvival.OnClientDisconnect: remove redundant StopClient call because base function already does so
    • Database.CharacterLoad: add missing deleted check
    • Mirror updated to latest version
    • UsableItem: only modify cooldown dict if we have a cooldown. avoids resync for 0 cooldown items.
    • NetworkManagerSurvival.OnStart/StopServer: remove unnecessary base calls
    • NetworkManagerSurvival.OnServerAddPlayer replaced with OnServerCharacterSelect and CharacterSelectMsg to avoid obsolete Mirror warnings. NetworkManagerMMO.OnServerCharacterSelect addon hook added too.
    • NetworkManagerSurvival: set client ready after selecting a character. not after connecting.
    • Database: character_equipment inherits from character_inventory to save code
    • Database: character_hotbar inherits from character_inventory to save code
    • CraftingRecipe.FindForIngrediends renamed to Find for consistency with uMMORPG
    • FurnaceRecipe.FindForIngrediends renamed to Find for consistency with uMMORPG
    • CraftingRecipe.IngredientsNotEmpty function that avoids Linq
    • PlayerCrafting.CmdCraft: pass recipe name so that the server doesn't have to search the whole recipe dict, which would potentially slow down the whole world
    • NetworkManagerSurvival: cache player classes in Awake
    • GUIConsole updated: usable with F12 hotkey, limit memory usage, etc.
     
    socialsumate and Djayp like this.
  19. craftrap

    craftrap

    Joined:
    Apr 25, 2015
    Posts:
    29
    Code (CSharp):
    1. public bool CanAttack(GameObject go)     {        
    2.  return (go.tag == "Player" || go.tag == "Build") &&  
    3. go.GetComponent<Health>().current > 0 &&
    4.   health.current > 0;     }
    When ım called multi tag enemy(Example Wall part) so many Lag how to fix it?
     
  20. vis2k

    vis2k

    Joined:
    Sep 4, 2015
    Posts:
    3,303
    What do you mean exactly? frame drops, latency, or what?
     
  21. craftrap

    craftrap

    Joined:
    Apr 25, 2015
    Posts:
    29
    no frame drop, LAG AND FREEZE check the MS and when part destroy is beginning to return to normal.
     
  22. craftrap

    craftrap

    Joined:
    Apr 25, 2015
    Posts:
    29
    Still bugs.... lol no reply nice support! There's always a bugs. Never stabilized.
     
  23. vis2k

    vis2k

    Joined:
    Sep 4, 2015
    Posts:
    3,303
    I can send you a refund if you aren't happy with uSurvival
     
  24. craftrap

    craftrap

    Joined:
    Apr 25, 2015
    Posts:
    29
    How many times have I said I don't want a refund? If you are publishing this product, will you support it? You won't take the cheapest way. Does it make you angry to find errors in your product?
     
  25. vis2k

    vis2k

    Joined:
    Sep 4, 2015
    Posts:
    3,303
    The language barrier is a bit difficult to deal with mate.
    'lag' can mean a million things. I need to know exactly how to reproduce an error so that I can see it for myself and debug the code to fix it.
     
  26. craftrap

    craftrap

    Joined:
    Apr 25, 2015
    Posts:
    29
    Look, there are a lot of improvements in the system. There has been a lot of improvement since the first version. It's a big job, thanks. but you can't see some minor mistakes.I hope u understand. watch video please...ı make example with zombies.
    FPS : 9 - 15
    CPU: 10-15


     
    Last edited: Oct 20, 2019
  27. vis2k

    vis2k

    Joined:
    Sep 4, 2015
    Posts:
    3,303
    Could you do this while running the profiler and enable deep profiling? Then we can see exactly why the frames drop and fix it easily.

    Youtube shows your video at 480p, I can't even read the frame count there.
     
  28. antsonthetree

    antsonthetree

    Joined:
    May 15, 2015
    Posts:
    61
    Hello @vis2k

    Couple of questions about this:

    1. The player movement seems to still be client-authoritative based on the OpenCharacterController. If I wanted to use this as a base for a faster paced FPS type shooter, would this method still work or would I need to add lag compensation / rewind / server authoritative stuff? I'm concerned the shots will not hit if both players are moving quickly.

    2. Are you planning on adding server authoritative movement in a future build? If so then I may just wait for you to do it.

    3. I notice that you are not using Mirror's built in NetworkAnimator. Why not? Seems like this would be a good showcase for it.

    Thanks
    Jake
     
  29. vis2k

    vis2k

    Joined:
    Sep 4, 2015
    Posts:
    3,303
    1. It doesn't use lag compensation or rewinding. I will add the server authoritative part soon, where the server will reset a player if he tries to speedhack. It's one step after another really. So far, this is the first really well synced character controller movement for UNET/Mirror that I have seen. No lag compensation, but at least it syncs near perfectly.

    2. I really just need to add the IsValidMove code which currently returns true at all times. Will likely do this before the end of the year.

    3. Imho NetworkAnimator is pointless. I already sync the player state, speed, etc. to all observers. Might as well feed it to the local animator and not sync it twice via NetworkAnimator. I tried NetworkAnimator for the early uMMORPG versions, but it just didn't give too great results. Syncing the state and move speed does give perfect results though.
     
  30. Victor_cross

    Victor_cross

    Joined:
    Dec 16, 2015
    Posts:
    40
    Hey lads are there any new guides out there for the setup of a usurvival platform on a standalone or master server?
    What port has to be opened for unity to pass through?
    I have ran steam servers before but I am having issues with the unity thing.
    My server is a windows server 2016.

    Thanks!
     
  31. vis2k

    vis2k

    Joined:
    Sep 4, 2015
    Posts:
    3,303
    Check out the built in documentation pdf :)
     
  32. Refeas

    Refeas

    Joined:
    Nov 8, 2016
    Posts:
    52
    Hey @vis2k I discovered a bug where if you use
    StopHost()/StopServer()
    but don't close the game (say you want to go back to the main menu) Mirror throws "Unknown message XXX" error. I've tracked the issue down to the PlayerMovement script and the message being RpcMessage. It seems like Mirror is unregistering the messages before the player is destroyed. It's probably a problem in Mirror as well but since it affects your assset I decided to report it here.
     
  33. vis2k

    vis2k

    Joined:
    Sep 4, 2015
    Posts:
    3,303
    Thanks for letting me know.
    Can you post the exact error message and let me know exactly what to click / which code to run to get it?
    A video would be useful too.
     
  34. Refeas

    Refeas

    Joined:
    Nov 8, 2016
    Posts:
    52
    I'm currently travelling but if you just put a StopHost() call into any player script after a certain key is pressed you can easily reproduce it. If you still need more details let me know and I will provide them later. Thanks!
     
  35. socialsumate

    socialsumate

    Joined:
    Apr 29, 2018
    Posts:
    20
    Bugs that my players found-


    -Every time the server saves the data (30 seconds by default) it paralyzes the game for a few very small but annoying milliseconds.

    -When dragging an item to the crafting menu it is still instantiated in your inventory. (The icon is still visible in the player's inventory even though it was already dragged to the crafting slot this confuses the player.

    I hope it helps something.
    Have a nice day
     
  36. vis2k

    vis2k

    Joined:
    Sep 4, 2015
    Posts:
    3,303
    V1.69 pending review:
    • Hide main UI if server stopped
    • NetworkManagerSurvival.OnClientDisconnect: only find main camera once
    • Fixed UI Chat activating during WASD movement again, this time for good. Chat InputField Navigation setting was set from Automatic to None to not activate anymore.
    • Mirror updated to latest version
    • Apathy, FallbackTransport with Apathy, Telepathy
    • Chat.SendGlobalMessage function for those who need it
    • UIChat.AddMessage: combined object creation with set parent
    • PlayerEquipment.RefreshLocation: combined object creation with setparent
    • Player Equipment: set equipmentInfo amount to 1 immediately when assigning an item
    • PlayerInventory: set defaultItems amount to 1 immediately when assigning an item
    • UIShowToolTip: set text immediately to avoid a small empty tooltip being shown for one frame. can be reproduced with a low framerate and hovering over the inventory button.
    • CraftingRecipe.CanCraftWith: avoid FindIndex
    • GridChecker performance update
    • Use CompareTag everywhere
    • NetworkBehaviourNonAlloc to avoid .name allocations
    • ScriptableObjectNonAlloc to avoid .name allocations
    • UI: only build tooltip while tooltip is visible. reduces UI allocations by 10x and improves performance
    • Palette tooltip shows name too
    • UIDragAndDropable: currentlyDragged made static so it can be checked by other components too
    • Energy scripts moved into Energies folder
    • Fixed attack animations being reset when being attacked bug
    • PlayerMovement.ForcePosition renamed to Warp for consistency with uMMORPG
    • PlayerMovement.Warp: ignore early warp for char previews

    Will take a look in a few days after applying latest uMMORPG improvements to uSurvival.

    Are you using the latest uSurvival version? I recently swapped out the Sqlite library, it's really fast now.
    About crafting: that's because it's a link to the item. The slot isn't a real slot.
     
    socialsumate and Djayp like this.
  37. vis2k

    vis2k

    Joined:
    Sep 4, 2015
    Posts:
    3,303
    V1.70 pending review:
    • Combat.OnClientReceivedDamage: remove unnecessary gameObject parameter
    • ItemContainer and Inventory/Equipment inherit from it
    • Item.CheckDurability to avoid the complicated check everywhere. Also fixes a bug where Equipment wouldn't include boni for items with maxDurability==0
    • UIDragAndDropable copies image color too, so that dragging low durability items it has the same color
    • PlayerHotbar: rename CheckDurability to IsHandsOrItemWithValidDurability
    • FiniteStateMachine moved into Monster.cs
    • MonsterAnimation moved into Monster.cs
    • abstract Entity class for Player and Monster to inherit from. For consistency with uMMORPG and to avoid GetComponent class later
    • Monster.target changed to Entity
    • Structure inherits from Entity
    • Added Harvestable component to Tree prefab
    • Combat uses Entity and avoids GetComponent calls
    • Entity.collider field added to avoid thousands of GetComponent<Collider>() calls later
    • Monster uses target.collider instead of target.GetComponent<Collider> everywhere
    • Added public component fields to Player class to avoid GetComponent calls. Player.onlinePlayers value type changed to Player too
    • Player.localPlayer type changed to Player to avoid even more GetComponent calls
    • PlayerInventory.DropItem: only call GetComponent once
    • Database.CharacterLoad: avoid GetComponent calls
    • UsableItem: use correct parameter name
    • UsableItem passes Player instead of PlayerInventory/PlayerHotbar to avoid lots of GetComponent calls. Also makes the code more elegant with less strange uses like 'hotbar.name'.
    • Combat.onServerReceivedDamage: first parameter changed from GameObject to Entity. Make sure to assign the new Combat.entity field in Inspector for all entities (players/monsters/trees/structures) when upgrading manually.
    • PlayerAnimation code moved into Player.cs
    • Interactable passes Player instead of GameObject as parameter to avoid GetComponent calls
    • CharactersAvailableMessages.Load uses List of Player
    • Monster: replace remaining GetComponent calls
    • PlayerConstruction: remove components in reverse order to avoid RequireComponent dependency errors. Also sorted PaletteStructure components
    • Energies: improve bonusComponents caching to fix a bug where max wouldn't work when cached in Awake
     
    socialsumate and Djayp like this.
  38. vis2k

    vis2k

    Joined:
    Sep 4, 2015
    Posts:
    3,303
    socialsumate likes this.