Announcement

Collapse
No announcement yet.

WIP: - UE4 'Slabs' Greyboxing system

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

    WIP: - UE4 'Slabs' Greyboxing system

    Hey everyone, I think this is my first post here in the forums although I have been lurking for ages. So I thought I would drop something I have been working on recently to get myself into the habit of posting things.

    Basically I am working on small greyboxing tool based from the 'slabs' system Jonathan Blow created for use in blocking out the puzzles in The Witness. A similar system has been used on the game Obduction for prototyping, a little video of it in action here (somewhere in the middle they show it):

    https://youtu.be/CWRmO3gXnKo?t=481

    The slabs are basically just cube actors that are places in the level and when a modifier key is held down above a face you can drag it along it's normal to stretch it out, this always works locally so you don't get any nasty deformations or anything unexpected going on.

    Currently I am working on a blueprint prototype with plans to turn it into a C++ version after that once I've figured out the logic (As I'm only just starting to learn C++). At the moment it works simply by dragging about 3d widgets placed on each face that are constrained to an axis but eventually I want to do away with that and access the face directly using the mouse and selecting a modifier key.

    Click image for larger version

Name:	Capture55.PNG
Views:	1
Size:	272.3 KB
ID:	1193140

    I made this earlier which taken me about 5-10 minutes, it's very intuitive to use and combined with grouping and rotating makes it very efficient for creating level prototypes.

    Click image for larger version

Name:	Capture54.jpg
Views:	1
Size:	558.9 KB
ID:	1193139

    The only problem at the moment is that unlike the slabbing system the pivot currently doesn't reset to the center of the actor after an adjustment is made, this is a hard one though since I have to access the relative location and all the points are being moved independently of the objects origin and I haven't quite figured out the maths behind it yet to get it to work. I'll upload a video soon showing properly how it works anyway.
    Attached Files
    Last edited by JBroderick; 09-11-2016, 07:15 PM.
    PORTFOLIO
    BLOG
    LINKEDIN
    TWITTER
    YOUTUBE

    I_DO_TRI GAMES DEVBLOG

    #2
    This is really cool!

    Cannot wait to see more

    Comment


      #3
      Very cool, I can see blocking out levels really quickly with something like this.
      www.valkrysa.com
      A proud and noble software developer

      Comment


        #4
        Here is what I've got so far, made a quick video showing myself messing about with the blocks.



        I'm continuing to work on the pivot problem, as you can see in the video if I move the sides of the cube the pivot doesn't update to be back into the centre of the cube, this actually requires quite a bit of reworking by the looks of things as when you offset the root pivot you offset everything in the actor, and then you have to take that away to keep the points where they were before. I think... Apart from that the slabs function quite well!
        PORTFOLIO
        BLOG
        LINKEDIN
        TWITTER
        YOUTUBE

        I_DO_TRI GAMES DEVBLOG

        Comment


          #5
          IMO this should be a built-in feature. Nice work JBroderick.

          If you make it so that any model can be resized with these control handles I'd use it constantly. Put this on the marketplace for sure.

          Comment


            #6
            Ahah thanks XD

            Yeh I was just thinking along the lines of something like that, I mean there is a similar mesh scaling feature inside the VR editor I believe so I'm surprised that's not in the main engine version yet, maybe it will be soon and render this work pointless. :P I will put it all on marketplace though when I get a C++ version working that works with the mouse, but I'll probably include the blueprint version aswell that could be mesh swapped. I'm thinking the C++ version will be nice as you can select the side bounds of the mesh like a face and drag it out instead of a widget.
            PORTFOLIO
            BLOG
            LINKEDIN
            TWITTER
            YOUTUBE

            I_DO_TRI GAMES DEVBLOG

            Comment


              #7
              Hey [MENTION=61460]JBroderick[/MENTION] got a few requests for the C++ Plugin.

              1. Make use of Instanced static meshes or have the ability to convert the static meshes to instanced static meshes.
              2. Make it so we can manipulate user defined meshes so not just cubes.

              Comment


                #8
                Ok I've been experimenting with some other basic shapes while I figure out how to create the pivot offset, at the moment only similar sized meshes can be used and the pivot must be centred. I imagine this would have to be fixed along with the pivot offset as you would need to offset the mesh component from the root depending so the slab's mesh is always centred. I'm working on that atm though, it's harder than I thought it would be.

                Click image for larger version

Name:	Capture58.PNG
Views:	1
Size:	519.2 KB
ID:	1115448
                [MENTION=260]HeadClot[/MENTION] I'll have a look into instanced meshes, I haven't really used them before but that would be great in large scenes so I'll give it a try.
                PORTFOLIO
                BLOG
                LINKEDIN
                TWITTER
                YOUTUBE

                I_DO_TRI GAMES DEVBLOG

                Comment


                  #9
                  New Video!

                  Finally fixed the pivot problem, now the slabs pivot autocentre correctly. Also I have added a small feature to disable the mesh and replace it with a box collision, allowing the designer to use placed slabs as the level collision underneath finalised assets.



                  I've tried to improve the video quality a bit more aswell, something I'm trying to improve as I do more of these updates.
                  PORTFOLIO
                  BLOG
                  LINKEDIN
                  TWITTER
                  YOUTUBE

                  I_DO_TRI GAMES DEVBLOG

                  Comment


                    #10
                    Looking good!

                    As someone who has been longing for the improved BSP tools this is right up my alley.
                    Tracks - The Train Set Game

                    Comment


                      #11
                      Awesome work. If you need any C++ help, both coding and questions. i'd be happy to help as this is something i wanted but i've yet to get around to making.
                      Youtube
                      Machine Learning C++ Plugin
                      Lindenmayer System C++ Plugin

                      Comment


                        #12
                        Originally posted by SaxonRah View Post
                        Awesome work. If you need any C++ help, both coding and questions. i'd be happy to help as this is something i wanted but i've yet to get around to making.
                        Cheers, much appreciated. I got the C++ version working (mostly) last night. I do have a little problem with it though that I don't seem to have with the blueprint version. Basically to get the end position of the root pivot so it always stays in the center of the slab I use this to get PivotOffset which I subtract from each control point, so the Slab's root is always moving but it's unnoticeable as the control points are compensating for it. I think. When I add a new Slab to the scene the base actor position is offset before doing anything to it, but as soon as I move a node though it corrects itself.


                        //Get Pivot offset and set root position
                        FVector CurrentMeshLocation = Mesh->GetComponentLocation();
                        FTransform SlabTransform = GetActorTransform();
                        FVector SlabWorldLocation = SlabTransform.GetLocation();

                        //Create Point Offset Vector by converting world space movement to local offset that can be subtracted from control points
                        FVector PivotOffset = (SlabTransform.InverseTransformPosition(CurrentMeshLocation));

                        SetActorLocation(CurrentMeshLocation, false, false);


                        I have tried to put it inside an if statement checking if CurrentMeshLocation is equal to SlabWorldLocation, hoping that on spawn it wouldn't trigger the setlocation but it didn't really do anything, is there something I'm missing?

                        Thanks in advance.
                        PORTFOLIO
                        BLOG
                        LINKEDIN
                        TWITTER
                        YOUTUBE

                        I_DO_TRI GAMES DEVBLOG

                        Comment


                          #13
                          Originally posted by JBroderick View Post
                          ^^^
                          Where is this code? In the construction script ?
                          Youtube
                          Machine Learning C++ Plugin
                          Lindenmayer System C++ Plugin

                          Comment


                            #14
                            Originally posted by SaxonRah View Post
                            Where is this code? In the construction script ?
                            Yeh it's in the construction script. Apologies, I thought I put that in.

                            Here is a little visual representation of what is currently happening anyway, compared to the BP version which acts as it should.

                            Attached Files
                            PORTFOLIO
                            BLOG
                            LINKEDIN
                            TWITTER
                            YOUTUBE

                            I_DO_TRI GAMES DEVBLOG

                            Comment


                              #15
                              I thought so, This is exactly the same problem im having in my Lindenmayer System plugin. Maybe we can summon an epic dev to give us some information about C++ and the use of world space to local and vise versa and how to not get local movement offsets when moving in world. Because BP holds your hand for local to world. whereas C++ forces you to manage both. I've tried almost every combination of relative/world set/get/add and i still cannot figure this same problem out.

                              Edit: I never really had a problem with adding things in C++ then moving in the world and having this weird offset. I have to be overlooking something.


                              @Michael Noland Any insights to why when we move stuff in world space, object in its local space are offset ?
                              Last edited by SaxonRah; 09-28-2016, 10:53 AM.
                              Youtube
                              Machine Learning C++ Plugin
                              Lindenmayer System C++ Plugin

                              Comment

                              Working...
                              X