Search Unity

VOXL - Unity Multiplayer Voxel Sandbox

Discussion in 'Assets and Asset Store' started by mischa2k, Nov 20, 2016.

  1. freedom667

    freedom667

    Joined:
    Sep 6, 2015
    Posts:
    425
    I mean this asset only works In games like Minecraft? I want to make a multiplayer shooter war game, for example like Call of Duty can i use this?
     
  2. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    It's meant for voxel worlds yes.
     
  3. zelgo

    zelgo

    Joined:
    Jun 26, 2016
    Posts:
    39
    does this hold together well if you walk out very far? concerned about unity using floats for locations, whereas minecraft uses doubles
     
  4. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    I doubt that anyone can move out that far unless he walks for a year straight. If you walk at 5m/second then you walk 300m/minute or 18.000m/hour or 432.000m/day. Those are still floats that we can work with just fine.
     
  5. zelgo

    zelgo

    Joined:
    Jun 26, 2016
    Posts:
    39
    are your chunks one mesh or just a lot of cubes?
     
  6. cookimage

    cookimage

    Joined:
    Sep 10, 2012
    Posts:
    729
    Would you be able to increase the render distance, right now in the demo you see the chunks being rendered as you walk , would be good if they where starting to render a little bit further from the player.
     
  7. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    A lot of cubes!

    You can increase it on Windows/Mac/Linux standalone builds a bit more yes. UNET spawning / unspawning is not that fast though, so you can't look thousands of units far etc. like in Minecraft
     
  8. zelgo

    zelgo

    Joined:
    Jun 26, 2016
    Posts:
    39
    isn't that really bad to do?
     
  9. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    It's meant as a voxel game, not as a terrain engine or anything. So having 1x1x1 cubes there is definitely intended, if that's what you mean.
     
  10. syleron

    syleron

    Joined:
    Mar 6, 2009
    Posts:
    3
    Hello, cool pack!

    I was wondering if you could clarify a few things for me.

    I've noticed that new "chunks" load in outwards -> in toward the player. Could you not inverse this so that the walking comes across a bit more "seamless". UPDATE: Sorry, I just noticed this depends in the direction you are moving in though I still believe that chunks should generate from the player outwards.

    Furthermore, could you not make it so that the number of blocks that are generated vertically is limited so that a larger view distance can be generated? Also, could you not just network/keep track of blocks placed/removed as the seeds will generate the same map on everyone's client? the only thing the network should have to load/unload is the blocks which have changed.

    Lastly, could you change at which point chunks start to load as a person walks?

    Cheers!
     
    Last edited: Dec 31, 2016
  11. zelgo

    zelgo

    Joined:
    Jun 26, 2016
    Posts:
    39
    not sure what you mean by terrain engine but rendering each voxel as a cube is really naive

    going to pass on this one
     
  12. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    The voxels in each chunk are sorted, and always loaded in that order. See it would make sense to make them load from the player's direction first, but this becomes an issue when there are multiple players around. There sure is an algorithm to do that, I am not sure if the overhead is worth it though. But then VOXL was only released a few days ago, so this may all change.

    They are already limited vertically. You can modify that in the Inspector after selecting the WorldGenerator.

    Loading chunks based on where a person walks makes sense too until players rapidly turn into different directions. So there's some research needed here too.

    Why is it naive? I'll explain the thoughts behind it a bit more. VOXL was designed around UNET, so every voxel is a NetworkIdentity with a cube mesh attached to it. We don't draw all the voxels all the time, only those that are not occluded by their direct neighbors, that's a huge performance gain.

    Of course, we could try and combine multiple voxels to a bigger mesh. Right now, UNET is 90% of the performance constraint. The drawing isn't really an issue at the moment, Unity is ridiculously fast.
     
  13. zelgo

    zelgo

    Joined:
    Jun 26, 2016
    Posts:
    39
    having that many network identities is ridiculous. doing such things at a voxel level is going to have terrible performance, and already does even with such a small view distance. it's only going to get worse as more features are added.

    even if performance wasn't a concern, the water looks weird because of the cube spam, and i don't see how you could make it flow at all if you have no intention of getting into dynamic meshing.

    the framework has a glass ceiling that won't even let you stand up straight. $80 would be worth it for a good starting point to a game like minecraft but this just seems like a useless facade
     
  14. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Well that's how the HLAPI works, it's all NetworkIdentities. As long as VOXL is based on the HLAPI, we pay for it with performance.

    Of course, only using the LLAPI would be interesting too. There is also a lot of value in being easy to understand and modify though. Generating procedural worlds full of voxels isn't easy, there are a lot of people who prefer to understand what's going on over having a really fast Minecraft clone that is hard to understand.
     
    Last edited: Jan 1, 2017
  15. H45544N

    H45544N

    Joined:
    Jan 3, 2017
    Posts:
    6
    Hey vis2k I just bought this and it's awesome but can you add a few basic tools like an axe and sword? That will make it perfect.
    Also maybe add an account registration option for players.
    Thanks a lot for making this .I have been looking for something like this for more than a year.
     
  16. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Thanks. Equipment is planned yes.

    Account registration might not be added. The reason is that if you launch your game, it depends on your website / system. Some have a sql database somewhere, some use a certain forum software, others use some cloud service, etc. It pretty much depends on your content management system.
     
  17. syleron

    syleron

    Joined:
    Mar 6, 2009
    Posts:
    3
    @vis2k Would you be able to provide a timeline of what you have planned?
     
  18. H45544N

    H45544N

    Joined:
    Jan 3, 2017
    Posts:
    6
    ok thats fine I can do the registration part myself , but I just noticed two issues that will need to be fixed.
    1. The linux headless build does not work with webgl client. If keeps disconnecting with random errors.
    2. You should change the world map to be generated once and stored on the server instead of being regenerated every time a player walks into an area, because right now when you go back to somewhere you placed blocks, everything gets regenerated except the blocks placed by the player and sometimes they are left floating in the air.
     
  19. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    To be honest, I work on whatever feature interests me the most. Next will be a long list of improvements in the core code base (from uMMORPG). After that, we will see.

    What are the random errors? Does it work locally?

    There is actually some caching going on already in the code, they just aren't kept in the Hierarchy all the time because then UNET would go crazy. If they are left floating in the air then you may have found some kind of glitch. Is there any way for me to reproduce it? E.g. generate world with settings..., go to position ... place block... etc.
     
  20. H45544N

    H45544N

    Joined:
    Jan 3, 2017
    Posts:
    6
    It works locally and on windows server ( both batchmode and normal mode) but not on linux.
    these are two of the errors I got
    "A server must not mask any frames that it sends to the client"
    "One or more reserved bits are on: reserved1 = 1, reserved2 = 0, reserved3 = 1"
    other times it stays connected but the world is empty.

    I placed some blocks and then after moving around went back to the same place and the blocks were floating in the air and the nearby trees were gone.
     
  21. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Did you try it with something like Ubuntu on your own computer? It could be that the host has some weird networking configuration that doesn't play well with UNET.
     
  22. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Progress: V1.3 was submitted for review:
    • Upgraded to Unity 5.5.0p3 for important bug fixes
    • NetworkManager configuration improved for sending huge amounts of messages
    • NetworkName uses unreliable channel now
    • All player commands use the unreliable channel now
    • PlayerChat component and all commands, targetrpcs and clientrpcs use the unreliable channel now
    • Entity.RpcShowDamagePopup uses the unreliable channel now
    • Removed UI Chat comment
    • Dedicated server fixed tick rate
     
  23. cookimage

    cookimage

    Joined:
    Sep 10, 2012
    Posts:
    729
    Can you save a world as in save it so that when you return to a game it shows what you build?
     
  24. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Yes of course. You don't see that in the WebGL demo though, nothing is saved there.
     
  25. H45544N

    H45544N

    Joined:
    Jan 3, 2017
    Posts:
    6
    I noticed another problem with the server side .Players don't get removed from the map after they leave and keep using up memory and cpu (was using 4gb+ ram yesterday and I had to restart it to clear it up). vox.png vox2.png

    All those players have left the server but can still be seen stuck in one place.
    The server is running on Windows as you can see in the screenshot and the clients are all webgl .
     
  26. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Interesting. Anything in the log files or in the Editor log?
    https://docs.unity3d.com/Manual/LogFiles.html
     
  27. H45544N

    H45544N

    Joined:
    Jan 3, 2017
    Posts:
    6
    Nothing useful.
    220k lines repeating the same "saved player,saved game world ,saved player ....."


    Code (CSharp):
    1.  
    2. saved:player632
    3. (Filename: C:/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)
    4.  
    5. saved:player270
    6. (Filename: C:/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)
    7.  
    8. saved:player323
    9. (Filename: C:/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)
    10.  
    11. saved:Marinette
    12. (Filename: C:/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)
    13.  
    14. saved game world
    15. (Filename: C:/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)
     
  28. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Ok. Does it happen when you run the server and the client on the same computer? Does it happen on the local network? Does it only happen when hosting the server on the internet?
     
  29. H45544N

    H45544N

    Joined:
    Jan 3, 2017
    Posts:
    6
    Yeah only internet. I just tested it with client and server on same computer and it works fine.

    btw can you add some caching feature so every chunk doesn't get deleted immediately and re-downloaded as the player moves around the map
     
  30. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Is it possible for you to test it on the local network (e.g. between two laptops at home) or on another server on the internet?

    Voxels are already cached on the server. They are still spawned and unspawned each time though, otherwise it would be too much load for UNET.
     
  31. Xain

    Xain

    Joined:
    Aug 3, 2013
    Posts:
    68
    Asset looks great so far, Is there a spawner for animals etc. ?
     
  32. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Thank you. Not yet, animals will be a challenge. Spawning them is easy, but the movement on voxels is a bit more difficult.
     
    Xain likes this.
  33. Xain

    Xain

    Joined:
    Aug 3, 2013
    Posts:
    68
    Thank you for answer , can't wait to buy it when you put animals.Great job with the asset!
     
  34. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Thanks!
     
  35. Xain

    Xain

    Joined:
    Aug 3, 2013
    Posts:
    68
    Hello again , I was wondering if it's easy for mobile. It's says * Mobile Support but how is multiplayer works ?
     
  36. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    You can build it for mobile and it will run on your phone, but controls still need some mobile optimizations - like a WSAD key overlay on screen for WSAD movement. This is planned for the future, but shouldn't be too difficult if you can't wait.
     
    Xain likes this.
  37. Xain

    Xain

    Joined:
    Aug 3, 2013
    Posts:
    68
    Allright , I have control freak 2 asset I can try to integrate with it.Thank you again for your answer.
     
  38. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    You are welcome.
     
  39. FeedorFeed

    FeedorFeed

    Joined:
    Jan 9, 2014
    Posts:
    35
    Hey, you mentioned that you wouldn't be able to see thousands of blocks away because of how slow uNet is, my question is, If I wanted to make the cubes smaller and use them more as a terrain and less as interactable objects, how would that perfom? Not overly smaller, but say half size, would the fact that they need not be interactable help with performance, or would it be a non factor
     
  40. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    You can make them as small as you want, but then your voxel view range will become smaller too since there is only so much that UNET can handle. Take a look at the WebGL demo, what you see there is a stable voxel amount for WebGL. For a standalone system you can probably use twice as many. For people will really fast computers maybe 3 or 4 times as many. But you won't be able to use tiny voxels for a terrain and use 100x as many.
     
  41. maurizioruocco

    maurizioruocco

    Joined:
    Feb 15, 2014
    Posts:
    1
    Good job with this work! When you add a few basic tools like a sword?
     
  42. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Thanks! Soon I hope. The code is pretty much done, since I can copy it from my other uMMORPG package. I will need a few 3D models first though.
     
  43. skaljac

    skaljac

    Joined:
    Apr 9, 2015
    Posts:
    33
    Hi,

    I really like how this package looks and I would like to use it on mobile.
    Can you tell me how does it perform on Android or iOs device?

    Or even better, can we get APK to try the game on Android device?
     
  44. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    It runs, but it doesn't run that fast. Hosting a server or using the server & play mode would be far too slow for most mobile devices. Using client mode can work if you have a really fast device. What you see in the WebGL demo is already close to the performance limit for WebGL, so you can expect mobile to be much slower, hence a smaller view range.

    I wouldn't buy it just for mobile support really. It kind of runs, but there is still a lot of work to do.
     
  45. Legion4

    Legion4

    Joined:
    Apr 18, 2017
    Posts:
    4
    How easy would it be to implement cave generation to this?
    Also would it be possible to add a light to a block(i.e. torches and such)?
     
  46. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    It depends. You'd either need 3D noise, or randomly carve out caves after generating. Caves look easy, but the concept is far from easy if you want to get it right. (there is a reason why there are no caves in VOXL yet)

    Yes you can easily modify your voxel prefabs and add lights to them, that should work without writing any code.
     
  47. Legion4

    Legion4

    Joined:
    Apr 18, 2017
    Posts:
    4
    A question about how this handles rendering chunks - Does it render each chunk as one mesh and update that chunk's mesh as needed, or does it render each blocks mesh individually inside the chunk?
     
  48. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Each block is one mesh at the moment.
     
  49. Supergeek

    Supergeek

    Joined:
    Aug 13, 2010
    Posts:
    103
    Curious what's going on with this asset. Haven't seen any updates for a while.
     
  50. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    So uMMORPG, uMOBA and VOXL share about 80% of the same code.
    For new features, I always do all my research with uMMORPG and try to implement them there. Afterwards they are applied to uMOBA and VOXL. So instead of many smaller updates, there's always one big update after a longer period of time.