Announcement

Collapse
No announcement yet.

Voxel Plugin

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    lets think for a min of around 8 - 10 players on a world with the game having to keep all of the clients updated with changes in the terrain as well as simulating everything else. Actual game environment with AI, physics and nice eye candy ect.
    You're totally right, a voxel size of 25 is too low for a multiplayer game. For tesselation, I guess the best would be to do it on the GPU, however I have absolutely no idea on how to do that with UE4 procedural meshes. Landscape Architect seems to have done it: https://www.youtube.com/watch?v=P4R_2FQ-BJ0

    Could you push that map you tested your performance on to GitHub
    Done, it's with the PerlinNoise world generator. You may have to increase deletion time in the Voxel World settings to avoid holes.

    many people still use quad core i5's to game on
    That's indeed going to be a problem, as the number of threads is critical for performance here, which means 8 core CPU is really twice as fast as a 4 core one.
    Website: https://voxelplugin.com
    Discord: https://discord.voxelplugin.com
    Twitter: https://twitter.com/phyronnaz

    Comment


      Voxel size of 25 looks really good on my system and renders fine as long as the world is not having to update. 120fps at a stand still but dropping to single digit fps just moving around a bit. Even pacing back and forth from one point to the next still gave single digit framerates even though that part of the terrain had already been updated the first time I passed through that area. Using the voxel tool on the default setting it has when you start the game dropped fps to around 90.

      Voxel sizes 125-150 offered far more acceptable frame rates that would put the terrain I think in the playable area. Never dipping below 20fps. But the voxels are far easier to see and make out but maybe there could be a visual solution there which wouldn't increase the complexity of the actual voxel terrain itself.

      Do you know of Space Engineers and Emperion? Both seem to use a larger voxel size with Emperion being what looks like around 150 - 180 voxel size and Space engineers around 100 - 120. Emperion being the most stable one of those two by a long shot. So comparatively speaking here, your plugin for UE4 is already approaching what I have seen in commercial games already in my opinion. Just needs some more tweaks to the presentation and generation.

      I am on a quad core system here btw. I hope to have a Threadripper system running by this time next week so it would be interesting to see how this plugin performs with 16 cores instead of just the 4.

      Originally posted by Phyronnaz View Post
      You're totally right, a voxel size of 25 is too low for a multiplayer game. For tesselation, I guess the best would be to do it on the GPU, however I have absolutely no idea on how to do that with UE4 procedural meshes. Landscape Architect seems to have done it.


      I have seen this some time ago but I was under the impression that the tessalation done there was a solution in the landscape material. Maybe I'm wrong.

      Comment


        Default settings are for an 8 core CPU. There are 3 settings for threads:
        MeshThreadCount: Number of thread to render far chunks
        HighPriorityMeshThreadCount: Number of threads to render nearest chunks. Those threads have an higher priority
        FoliageThreadCount: Number of threads for foliage

        By default, MeshThreadCount = HighPriorityThreadCount = 4, so on a 4 core CPU, all core are used, including the one used by the main UE thread, leading to bad FPS. You should have way better results with MeshThreadCount = HighPriorityThreadCount = 2 (or HighPriorityThreadCount = 1) .

        The main factor affecting performance is the WorldGenerator. The PerlinNoiseWorldGenerator is quite heavy as I'm not caching any values, so there may be space for optimization here. To see how performant the marching cubes implementation is by itself, you should try the FlatWorldGenerator.

        I have seen this some time ago but I was under the impression that the tessalation done there was a solution in the landscape material. Maybe I'm wrong.
        Material tesselation doesn't work for procedural meshes, as explained here.
        Website: https://voxelplugin.com
        Discord: https://discord.voxelplugin.com
        Twitter: https://twitter.com/phyronnaz

        Comment


          Adjusting the thread settings for the voxel world did improve the responsiveness of the game. Still seen single digits when moving around but not as bad as it was earlier.

          MeshThreadCount
          = 2 ,
          HighPriorityThreadCount
          = 1

          Comment


            Got tesselation to work thanks to Ali Akbar:
            Website: https://voxelplugin.com
            Discord: https://discord.voxelplugin.com
            Twitter: https://twitter.com/phyronnaz

            Comment


              @Phyronnaz it looks now really impressively! it's really cool that Ali helped a competing system.

              I'm planning to add it to my RTS project, but I would like to know how good its performance comparing to landscape? In my case the full terrain should be max. 1kmx1km (game area is 500x500m), and I need to do rare and small area changes, like smoothing terrain on building placement, digging moats around castle walls, or making craters after explosions. this game genre is quite a performance eater, so I have to optimize all the sub-systems as much as possible to keep the playable units quantity around 400-500...

              thanks.
              Last edited by sivan; 11-09-2017, 05:06 AM.
              "Age of Total Heroes" - RTS Pathfinding and Movement System for UE4
              RTS Camera C++ Tutorial

              Comment


                sivan Thanks!

                The main advantage of marching cubes over a heightmap based landscape is the possibility to have 3D shapes. I don't think it would be that useful in a top-down game. Moreover it has a lot of disadvantages compared to Landscape:
                - Collision only works in near chunks
                - Resolution is lower
                - Uses lots of CPU to build chunks on the fly
                - Materials are a lot slower (no texture arrays in UE ) as Landscape generates a custom material for each landscape component based on the layers used

                I'd say this plugin is for first/third person games that requires one of the following:
                - Infinite world
                - Realtime edit
                - Shapes that can't be done with a heightmap: Planets, caves ...

                If you really need realtime edit, you should go with a procedural mesh based on a heightmap.
                Website: https://voxelplugin.com
                Discord: https://discord.voxelplugin.com
                Twitter: https://twitter.com/phyronnaz

                Comment


                  Multiplayer with custom TCP sockets:

                  Not tested with different computers, but should be ok for small edits.
                  Website: https://voxelplugin.com
                  Discord: https://discord.voxelplugin.com
                  Twitter: https://twitter.com/phyronnaz

                  Comment


                    Thanks, yes a heightmap based system would be perfectly fine for me.
                    "Age of Total Heroes" - RTS Pathfinding and Movement System for UE4
                    RTS Camera C++ Tutorial

                    Comment


                      This is great. Keep up the magnificent work.

                      Comment


                        Can this do a planet of 600km radius or more?

                        Comment


                          Rareden Yes, the size of the world is 2 ** Depth * 16 * VoxelSize and Depth <= 20 (uint64 limit). For a VoxelSize of 100cm, world max size is 16 777 216 m.

                          SphereWorldGenerator with a radius of 600 000 00 cm:
                          Website: https://voxelplugin.com
                          Discord: https://discord.voxelplugin.com
                          Twitter: https://twitter.com/phyronnaz

                          Comment


                            Originally posted by Phyronnaz View Post
                            Rareden Yes, the size of the world is 2 ** Depth * 16 * VoxelSize and Depth <= 20 (uint64 limit). For a VoxelSize of 100cm, world max size is 16 777 216 m.

                            SphereWorldGenerator with a radius of 600 000 00 cm:
                            wonderful to hear

                            Comment


                              Hi, I'm getting this error whenever I try to build the 4.18 version.

                              ------ Build started: Project: UE4, Configuration: BuiltWithUnrealBuildTool Win32 ------
                              2>------ Build started: Project: VoxelTest, Configuration: Development_Game x64 ------
                              2>Creating makefile for VoxelTest (changes to module files)
                              2>Parsing headers for VoxelTest
                              2> Running UnrealHeaderTool "D:\Users\User\Documents\Unreal Projects\VoxelTest\VoxelTest.uproject" "D:\Users\User\Documents\Unreal Projects\VoxelTest\Intermediate\Build\Win64\VoxelTest\Development\VoxelTest.uhtmanifest" -LogCmds="loginit warning, logexit warning, logdatabase error" -Unattended -WarningsAsErrors -installed
                              2>Reflection code generated for VoxelTest in 4.9800079 seconds
                              2>Performing 7 actions (4 in parallel)
                              2>PCH.Voxel.cpp
                              2>MyClass.cpp
                              2>VoxelTest.cpp
                              2>Module.Voxel.gen.cpp
                              2>Module.Voxel.cpp
                              2>D:\Users\User\Documents\Unreal Projects\VoxelTest\Plugins\Voxel\Source\Voxel\Private\VoxelNetworking.cpp(117): error C4800: 'FVoxelTcpConnection *': forcing value to bool 'true' or 'false' (performance warning)
                              2>D:\Users\User\Documents\Unreal Projects\VoxelTest\Plugins\Voxel\Source\Voxel\Private\VoxelNetworking.cpp(176): error C4800: 'int32': forcing value to bool 'true' or 'false' (performance warning)
                              2>D:\Users\User\Documents\Unreal Projects\VoxelTest\Plugins\Voxel\Source\Voxel\Private\VoxelRender\Private\VoxelChunkComponent.cpp(356): error C4800: 'FStaticMeshInstanceData *': forcing value to bool 'true' or 'false' (performance warning)
                              2>ERROR : UBT error : Failed to produce item: D:\Users\User\Documents\Unreal Projects\VoxelTest\Plugins\Voxel\Binaries\Win64\UE4-Voxel.lib
                              2>Total build time: 44.16 seconds (Local executor: 0.00 seconds)
                              2>D:\VisualStudio\Common7\IDE\VC\VCTargets\Microsoft.MakeFile.Targets(44,5): error MSB3075: The command ""C:\Program Files (x86)\Epic Games\UE_4.18\Engine\Build\BatchFiles\Build.bat" VoxelTest Win64 Development "D:\Users\User\Documents\Unreal Projects\VoxelTest\VoxelTest.uproject" -waitmutex" exited with code 5. Please verify that you have sufficient rights to run this command.
                              2>Done building project "VoxelTest.vcxproj" -- FAILED.
                              ========== Build: 1 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


                              Any help would be appreciated.

                              Comment


                                peto I've added a section to the install guide. The easiest way to solve this is to remove VS 2015 and to install VS 2017.

                                Tesselation doesn't create cracks anymore:


                                Website: https://voxelplugin.com
                                Discord: https://discord.voxelplugin.com
                                Twitter: https://twitter.com/phyronnaz

                                Comment

                                Working...
                                X