Announcement

Collapse
No announcement yet.

MSSR ★ Modular Snap System Runtime Plugin

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

    Originally posted by Arkhemor View Post
    Hey,

    I get Invalid File Specified error from the BP screenshots you uploaded. Can you upload them again please?

    Thanks for the explanation about the Motion Controller Pawn.

    I would like to use the plugin for a modified/custom VR pawn, so is there any documentation about how to implement it into a blank project or VR Template from scratch?

    Thanks for your support.
    I hope it works now.

    VR example is basically the default UE4 VR template modified a little bit. The modified part is in those Grab and Release events mostly. You can check how they are done, they are not very complex. If there is something not clear feel free to ask.
    Attached Files
    Modular Japanese HouseScaffold System
    Snap Plugin for EditorSnap Plugin for Games
    TwitterBlogYoutubeitch.io

    Comment


      Originally posted by scha View Post

      I hope it works now.
      Yes, the hands are working. Thanks a lot! Now I'm working on the other implementations.

      MSSR works well while grabbing the default BP_PickupCube, but it won't work with new grabbable objects. Here, I create one duplicate and one child from the default PickupCube. What could be the issue? The created new objects (child or duplicate) are grabbable in the default VR Template.


      Comment


        Originally posted by Arkhemor View Post

        Yes, the hands are working. Thanks a lot! Now I'm working on the other implementations.

        MSSR works well while grabbing the default BP_PickupCube, but it won't work with new grabbable objects. Here, I create one duplicate and one child from the default PickupCube. What could be the issue? The created new objects (child or duplicate) are grabbable in the default VR Template.

        In most of the MSSR examples, the "Grab" event checks if the actor has a tag, usually "pickup". Here, in the VR example, the check is in the "GetActorsNearHand" method (see pic). You can check one of the cubes, look for Actor Tags array in the properties. So you have to add a tag like that to your actor.
        You can also change the code of the Grab to check some other criteria, like just grab anything which is a physics actor. The original example used an Interface PickupActorInterface to see what you can pick, but I don't like this approach, because it forces you to use a custom actors. A tag can be added to any actor, including basic static mesh actors.

        And to "snap" you need to have sockets defined on those meshes, but I suppose you know that already. If not, check Overview level in the example project and the tutorial video.
        Attached Files
        Last edited by scha; 11-13-2019, 10:40 AM.
        Modular Japanese HouseScaffold System
        Snap Plugin for EditorSnap Plugin for Games
        TwitterBlogYoutubeitch.io

        Comment


          I didn't realize that actor tag wasn't embedded in the blueprint. Sorry for the confusion, fixed it and it works like a charm now. Thanks again!

          Another question: Do I set the global snap search distance from the Structure Variable under BP_MotionController? I couldn't get it to work.

          Click image for larger version

Name:	image_177030.png
Views:	119
Size:	47.4 KB
ID:	1686644
          Last edited by Arkhemor; 11-13-2019, 03:01 PM.

          Comment


            Originally posted by Arkhemor View Post
            I didn't realize that actor tag wasn't embedded in the blueprint. Sorry for the confusion, fixed it and it works like a charm now. Thanks again!

            Another question: Do I set the global snap search distance from the Structure Variable under BP_MotionController? I couldn't get it to work.

            Click image for larger version  Name:	image_177030.png Views:	4 Size:	47.4 KB ID:	1686644
            Under BP_MotionControllerDetach if you are using MotionControllerMap2. There are 2 example maps, MotionControllerMap and MotionControllerMap2. The "2" uses more advanced algorithm to detach things, so it uses BP_MotionControllerDetach and MotionControllerPawnDetach.

            The difference between two is how they manage the "Detach" operation.(Grip+Trigger). The first map will just call UE's DetachFromActor. The problem is that you can easily end up holding something with a hole in the middle.

            Second map will rebuild attachment trees to avoid this situation. It will use MSSR's snap sockets to find which cube is logically attached to which one then use that to make new trees without holes. The algorithm is in BP_MSSRHelpers Detach function.
            Last edited by scha; 11-13-2019, 03:38 PM.
            Modular Japanese HouseScaffold System
            Snap Plugin for EditorSnap Plugin for Games
            TwitterBlogYoutubeitch.io

            Comment


              Thanks for the explanation, now it works alright.

              I noticed a glitch with the parent objects. If you attach multiple attachment trees, some of the attached objects lose their physics. It really compromises the gameplay I am trying to implement. Can you replicate this, and any idea on how to avoid it?



              Sorry for asking too much questions, but I loved your plugin and unfortunately I'm quite new to UE4.

              Edit: Console log: Blueprint Runtime Error: "Accessed None trying to read property AttachedComp". Blueprint: BP_MotionControllerDetach Function: Execute Ubergraph BP Motion Controller Detach Graph: Grabbing Node: Set Simulate Physics
              Last edited by Arkhemor; 11-13-2019, 05:10 PM.

              Comment


                Originally posted by Arkhemor View Post
                Thanks for the explanation, now it works alright.

                I noticed a glitch with the parent objects. If you attach multiple attachment trees, some of the attached objects lose their physics. It really compromises the gameplay I am trying to implement. Can you replicate this, and any idea on how to avoid it?



                Sorry for asking too much questions, but I loved your plugin and unfortunately I'm quite new to UE4.
                No prob. I will try to reproduce that tomorrow. Physics in UE are tricky, because underlying PhysX library represents things differently, there no trees in PhysX.
                Modular Japanese HouseScaffold System
                Snap Plugin for EditorSnap Plugin for Games
                TwitterBlogYoutubeitch.io

                Comment


                  Originally posted by Arkhemor View Post
                  Thanks for the explanation, now it works alright.

                  I noticed a glitch with the parent objects. If you attach multiple attachment trees, some of the attached objects lose their physics. It really compromises the gameplay I am trying to implement. Can you replicate this, and any idea on how to avoid it?



                  Sorry for asking too much questions, but I loved your plugin and unfortunately I'm quite new to UE4.

                  Edit: Console log: Blueprint Runtime Error: "Accessed None trying to read property AttachedComp". Blueprint: BP_MotionControllerDetach Function: Execute Ubergraph BP Motion Controller Detach Graph: Grabbing Node: Set Simulate Physics
                  I can't reproduce it. I watched your video and tried to do exactly the same few times and it works correctly.
                  But I noticed something. You spawn new cubes right? Do you spawn them with all the right parameters?
                  Show me your spawning code please.

                  edit: I spawned cubes too and I have the same error. I will try to find why
                  Last edited by scha; 11-14-2019, 07:19 AM.
                  Modular Japanese HouseScaffold System
                  Snap Plugin for EditorSnap Plugin for Games
                  TwitterBlogYoutubeitch.io

                  Comment


                    Originally posted by Arkhemor View Post
                    I noticed a glitch with the parent objects. If you attach multiple attachment trees, some of the attached objects lose their physics. It really compromises the gameplay I am trying to implement. Can you replicate this, and any idea on how to avoid it?
                    I think I found it. The problem is the "auto weld" physics parameter of the BP_PickupCube. Usually it's enabled by default, but in the PickupCube bp it was disabled. So I enabled it back and now it seems to work also with the cubes you spawn on runtime.
                    To enable it, you need to open the BP_PickupCube, disable "SimulatPhysics", check "Auto Weld", then enable simulate physics again. Otherwise it's grayed out.
                    Modular Japanese HouseScaffold System
                    Snap Plugin for EditorSnap Plugin for Games
                    TwitterBlogYoutubeitch.io

                    Comment


                      Originally posted by scha View Post

                      I think I found it. The problem is the "auto weld" physics parameter of the BP_PickupCube. Usually it's enabled by default, but in the PickupCube bp it was disabled. So I enabled it back and now it seems to work also with the cubes you spawn on runtime.
                      To enable it, you need to open the BP_PickupCube, disable "SimulatPhysics", check "Auto Weld", then enable simulate physics again. Otherwise it's grayed out.
                      Would have never guessed Auto Weld, thanks! It fixed other attaching/detaching problems I haven't mentioned too. Here's the actor spawner BP, in case anyone needs it.https://blueprintue.com/blueprint/9tofkzl0/

                      Two more questions:
                      1. How do you modify the "force" preview material?
                      2. I want front face of a gemoetry to attach with the other one's back only. Currently, two front or two back faces can be attached. Is there any socket implementation that I can use to avoid same-face snaps?

                      Comment


                        Originally posted by Arkhemor View Post

                        Would have never guessed Auto Weld, thanks! It fixed other attaching/detaching problems I haven't mentioned too. Here's the actor spawner BP, in case anyone needs it.https://blueprintue.com/blueprint/9tofkzl0/

                        Two more questions:
                        1. How do you modify the "force" preview material?
                        2. I want front face of a gemoetry to attach with the other one's back only. Currently, two front or two back faces can be attached. Is there any socket implementation that I can use to avoid same-face snaps?
                        Some of physics parameters are very obscure. I try to understand how they work by studying the source of the engine and by trial and error. I think there are bugs i the engine too

                        >How do you modify the "force" preview material?

                        You can set it on the preview actor, it's a variable.

                        > I want front face of a gemoetry to attach with the other one's back only. Currently, two front or two back faces can be attached. Is there any socket implementation that I can use to avoid same-face snaps?

                        I'm not sure I understand, maybe you can show some example?

                        Did you tried +/- sockets? You can add a sign to the socket name, like "Socket+" or "Socket+_0" or "Socket-" etc. Those signed sockets will only snap to sockets with the same name and opposite sign, or to a socket with the same name and no sign.

                        There is also the "snap open only" parameter.

                        Those points are explained in the long tutorial and overview example, check that.
                        Modular Japanese HouseScaffold System
                        Snap Plugin for EditorSnap Plugin for Games
                        TwitterBlogYoutubeitch.io

                        Comment


                          Originally posted by Arkhemor View Post
                          [*]I want front face of a gemoetry to attach with the other one's back only. Currently, two front or two back faces can be attached. Is there any socket implementation that I can use to avoid same-face snaps?[/LIST]
                          Btw, i think I understand what you mean. You should ensure that your sockets are pointing outside of the geometry. The X-axis (red one) should point outside, like the normals, not up or sideway. Because, by default, MSSR aligns things respecting this direction. Check where is the X axis on the pickup cube mesh sockets for example. This is explained in the tutorial too.
                          Modular Japanese HouseScaffold System
                          Snap Plugin for EditorSnap Plugin for Games
                          TwitterBlogYoutubeitch.io

                          Comment


                            > Some of physics parameters are very obscure. I try to understand how they work by studying the source of the engine and by trial and error. I think there are bugs i the engine too

                            Well done on the good job then. Very much appreciated.

                            Originally posted by scha View Post
                            Did you tried +/- sockets? You can add a sign to the socket name, like "Socket+" or "Socket+_0" or "Socket-" etc. Those signed sockets will only snap to sockets with the same name and opposite sign, or to a socket with the same name and no sign.

                            There is also the "snap open only" parameter.

                            Those points are explained in the long tutorial and overview example, check that.
                            Looking at the extended tutorial now. Mine looks like pretty much a positive/negative pole issue. Here's a scheme of my socket setup, the only snap that I want to enable, and two snaps that I want to avoid:
                            Click image for larger version

Name:	20191115_224601.png
Views:	102
Size:	101.4 KB
ID:	1687547

                            Comment


                              Originally posted by Arkhemor View Post
                              > Some of physics parameters are very obscure. I try to understand how they work by studying the source of the engine and by trial and error. I think there are bugs i the engine too

                              Well done on the good job then. Very much appreciated.


                              Looking at the extended tutorial now. Mine looks like pretty much a positive/negative pole issue. Here's a scheme of my socket setup, the only snap that I want to enable, and two snaps that I want to avoid:
                              Click image for larger version

Name:	20191115_224601.png
Views:	102
Size:	101.4 KB
ID:	1687547
                              Yes, that can be solved with socket polarity. Call them something like Socket+ and Socket- and they will only snap in the right way, "plus" with "minus" only. There is an example with a hat and a "head", and the sockets are called "hat+" on the head and "hat-" on the hat.
                              Modular Japanese HouseScaffold System
                              Snap Plugin for EditorSnap Plugin for Games
                              TwitterBlogYoutubeitch.io

                              Comment


                                I added another example to the example project. It shows how to make a user-friendly physics handle with MSSR.
                                Some parts don't even require the plugin (grab speed ease-in, depenetration, etc.)

                                You can see a little video preview here:

                                https://twitter.com/games_inu/status...14829933334529

                                and download it on itch as usual: https://inugames.itch.io/mssr-demos

                                Features :

                                - Setup phys.handle with MSSR.
                                - Realistic detach
                                - Mix between simulated and static actors.
                                - Physics handle Interpolation Speed ease-in. It helps to grab things more "gently", example video: https://twitter.com/games_inu/status...45301538443264
                                - Max depenetration speed on the physics actors. Setting this will limit forces applied to separate overlapping actors.
                                Last edited by scha; 11-16-2019, 11:09 AM.
                                Modular Japanese HouseScaffold System
                                Snap Plugin for EditorSnap Plugin for Games
                                TwitterBlogYoutubeitch.io

                                Comment

                                Working...
                                X