Announcement

Collapse
No announcement yet.

Interactive, shapeable Snow

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

    Interactive, shapeable Snow

    Hi there.

    I am a total beginner with UE, and this is probably waaaaaay over my head. I was wondering if it is possible to create interactive snow/sand?

    For example, if my character has a shovel, and I poke the shovel into the sand/snow, and pick it up again, will I be able to dig a hole based on how hard/deep I poke my shovel, and create a proportionally sized mount when I unload my shovel? Can I shape this mound then, like a sandcastle?

    To be more precise, I want to try make a snowball fight game, where you can pick up snow anywhere on the ground, form a ball and then throw it. Where you picked up the snow should be a realistic hole. If, for example, you dig enough, you can make yourself a little trench to hide, or if you pack the snow, you can make a wall. So I want to be able to manipulate snow in the game the same as you would be able to in real life. The snow doesn't have to look realistic (it can be stylized or whatever), but it should act realistic.

    My gut feeling tells me that this might not be possible, and even if it is, would probably make mince meat out of your cpu or gpu. But no harm in asking, right?

    Thanks in advance!

    #2
    just a guess, but you might be able to simulate this effect by using destructive surfaces.. by tesselating your terrain in pre-established holes all over the place.... then as you perform an action with your character.. you could destroy the mesh.. then spawn a snowball into your hand..

    Comment


      #3
      Hi,

      @Chris: This wouldn't necessarily be the best option because you would need different depth layers for destruction and I believe there is a limit of 5-6 layers. I may be wrong on that but It's not an infinite amount.

      Using something like Morph Targets or swapping out meshes that would simulate this kind of effect would be a better more optimized route.

      This is just my theory on creating something like this and there may be better ways but I'm just throwing out some ideas here.

      You could have multiple meshes setup with different holes and depths to them. When you have your player doing the digging motion you can use a snow-like particle effect around the shovel like it's being tossed around and dusty. Swap the mesh out when the animation finishes and you now have your new mesh that has the hole in the ground.

      This would be where I would start if I were looking into this type of effect.

      I hope this helps.

      Tim
      Tim Hobson | Learning Resources | Epic Games
      UE4 Documentation

      Comment


        #4
        Hi Tim

        That sounds like an idea. But will that work on a large area? Eg, if I want to hold my snowball fight on a playground?

        https://www.youtube.com/watch?v=wJFE2pb0Ri4

        If you look at this video that I found (it's for blender) I'm looking at a similar effect to number 6, 8 and 9 in the video.

        Comment


          #5
          If you're just swapping out meshes this can work however you have it set to work. You can have multiple BPs setup to have different styles and swap the meshes that way.

          #6 is using cloth (not specifically Apex Cloth, which wouldn't work with this type of effect) to get the deformations. You can use that to get your different meshs with the deformations but you cannot dynamically create that effect in the engine without coding some things in source I'm sure. You could fake this doing the mesh swapping I've suggested though. It will take some work to get right but can be done.

          #8 This would be a destructible style mesh. However, it is key to remember that this demo is a rendering demo and not necessarily something that is running in real-time meant for games. That type of destruction would be run off the CPU only and would be very taxing on FPS. If you want a demonstration of this, setup a cube Destructible Mesh in UE4 with a fracture value of 500-1000 pieces. Set it up so that it will destroy on impact when you drop it and see how much that impacts FPS. This method really isn't feasible IMO.

          #9 The same applies to #9 for all the reasons listed above. Also, the Directional Wind actor does not affect physics. It will work with Apex Cloth and foliage assets when the material has been properly setup.

          Tim
          Tim Hobson | Learning Resources | Epic Games
          UE4 Documentation

          Comment


            #6
            Batman Arkham Origins was created in UE 3 and had some seriously good snow. It might not be suitable for what you're doing but it could point you in the right direction. (Also if you find anything concrete about how they did it, please let me know. I'm pretty sure it's just a heightmap being transformed with stamps/decals, but it was a really cool effect.)

            Alternatively you could use very high resolution voxels, maybe even one voxel per unit giving you centimeter resolution. From there you could apply a marching cubes/marching tetrahedra algorithm to give things a more smoothed out, natural feel. Space Engineers is a good reference, but they're using much larger voxels than you would want for something like this, probably 100x the size I believe.

            You'll want to set a pretty low max height/depth. I'd say 32 centimeters is probably high enough, though 48 or 64 might even be reasonable if you want some levels with deeper snow. Each chunk should be full height in Z, and then whatever size ends up working for you in x and y. (Same chunk size in all axes makes things pretty easy to keep track of though.)

            You'll have to pretty severely limit your worldsize, or at least the interactive snow parts. Obviously test rather than taking my word but I'd estimate a 10x10m playable area would be a reasonable size

            If you keep a single material type for the entire level, then you should be able to do some serious compression in memory relative to other voxel systems that need to be able to represent many different types of blocks. Or you could try to put some other metadata in there, such as wetness or density, and have those affect the simulation.

            This sounds like a pretty cool project, let me know how it goes!

            Comment


              #7
              Hi All

              I really like Tim and Veovis's ideas and I will try them out! Like I said, I really am an amateur still, so it might take me quite a while to get the hang of it and make it work, but at least I know now that there are some options! Thank you all for the input!

              Comment


                #8
                Hang in there with it and if you get stuck feel free to ask questions here and on the AnswerHub. There is a really good community here that is willing to help out!

                Tim
                Tim Hobson | Learning Resources | Epic Games
                UE4 Documentation

                Comment


                  #9
                  I saw this tutorial a while back and it looked really interesting, so I thought I would share this in case you are looking for a similar effect.

                  This is a snow material that can 'grow' on a surface over time, allowing snow accumulate on a surface dynamically during the game driven by a blueprint. Add on top of that a snowing particle effect and it could look really good! I have not had the time to go through the tutorial yet (it is split in 2 parts), and it doesn't help with your original request of digging into snow, but could be a helpful effect for adding to the realism of your scene. Hope you find it useful!

                  https://forums.unrealengine.com/show...-snow-material
                  Free Community Ocean & Sky Project || Join us on Discord! || Trello Roadmap

                  Comment


                    #10
                    I think this documentation page will be interesting for you: http://udn.epicgames.com/Three/Devel...formation.html Probably you will get it to work/are abel to re-create it in the UE4 -> with tessellation you could theoretically dig into a mesh, but I dont know how it will look like for the performance of your game ^^

                    Comment


                      #11
                      @Veovis: Here is a GDC power point where it is outlined how they achieved the effect in Batman Arkham Origins.

                      http://www.gdcvault.com/play/1020177...ring-in-Batman

                      Tim
                      Tim Hobson | Learning Resources | Epic Games
                      UE4 Documentation

                      Comment


                        #12
                        Originally posted by Tim Hobson View Post
                        @Veovis: Here is a GDC power point where it is outlined how they achieved the effect in Batman Arkham Origins.

                        http://www.gdcvault.com/play/1020177...ring-in-Batman
                        Much appreciated! That's a really clever way to alter the heightmap.... Runtime cost doesn't seem to be that bad either.

                        Comment


                          #13
                          Do remember that was in UE3 and not UE4. But Yeah I definitely agree it's a cool way to get the feature and have something like that!
                          Tim Hobson | Learning Resources | Epic Games
                          UE4 Documentation

                          Comment


                            #14
                            Originally posted by Tim Hobson View Post
                            @Veovis: Here is a GDC power point where it is outlined how they achieved the effect in Batman Arkham Origins.
                            http://www.gdcvault.com/play/1020177...ring-in-Batman
                            Tim
                            Wow that is an interesting way of doing it, too bad it can't be done with landscape as well, but definitely an interesting read. Thanks for the link!
                            Free Community Ocean & Sky Project || Join us on Discord! || Trello Roadmap

                            Comment


                              #15
                              Hey, Sorry to revive an old thread, but I am interested in using the technique created for Batman Arkham Origins! Before I got started I was wondering if anyone had already successfully implemented the same technique and could save me some time trying to figure it out.

                              If no one has, does anyone know how to generate/alter height maps in real-time?
                              Work Tutorials

                              Comment

                              Working...
                              X