Announcement

Collapse
No announcement yet.

Basic Level Design: BSP

Collapse
This is a sticky topic.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [TUTORIAL] Basic Level Design: BSP


    This tutorial will cover the very basics of level design; how to can create walls, floors, ceilings and windows using only by using BSP.

    Also available on the wiki!

    What is BSP?
    Binary Space Partitioning, or BSP for short, is a simple and quick way of laying out space in your level; defining what's solid and what's not. Designers place BSP Brushes to create Geometry which is what forms the foundation of a level. You may here people talking about BSP shells, Brushwork, or Geometry; all these mean the same thing, that being the layout of BSP Brushes used to create the level.

    Why is BSP important?
    BSP is both very fast to work with, and can be edited easily within the editor, it allows designers to quickly prototype and modify levels which is crucial in the early stages of both the level's development, and the game's. It's also very basic and easy to work with once you understand the basic rules and how to avoid pitfalls. Most level designers will start off a level with BSP, test, edit and test again until they are happy with it, or till they run out of time. learning BSP is the first step to creating levels, without it you'll likely end up with a confused mess.

    What are meshes then?
    At this point meshes are used to make things pretty, they're a lot more malleable and efficient, but need to be created outside of the editor in a modelling program and take a longer to make and edit. If you're just starting a level, or level design in general just stick to BSP, ignore meshes unless you know you need them (I'll expand on this near the end).

    Adding brushes to your level
    BSP brushes can be found under the place mode under BSP From here you can drag any brush shape you'd like into your level. While dragging you will see a red outline of the brush, when you let go the brush will be placed into the level.


    Brush size and shape
    BSP brushes come in a variety of shapes and sizes, they can be then edited further to create almost any shaped you desire.


    Various BSP brush shapes.

    You can use the details panel to set the size of your brushes and their type as well as more complex options, some of which are hidden under the drop down arrow.


    Brushs and the grid
    One of the downsides to BSP is that it's quite prone to breaking, and one of the fastest ways to break it is by working off the snap to grid. If you work with grid snapping off, you're gonna have a bad time. Any grid setting over 10 is fine. If you find yourself with brushes floating in space you can save them by pressing the Align Brush Vertices and this will place the brushes back on the grid for you.

    The only exceptions to this rule are cylinders and spheres. The centre (or origin) of the brush should be on the grid, but the vertices often will not be.

    Rotating Brushes
    Long story short, don't rotate brushes at anything other than 90 degree increments. If you for example wanted a diamond shape, or a diagonal walkway, it is much better to edit a brush to fit that shape than simply rotate it to fit. This simply makes sure the vertices are on the grid and that everything matches up nicely. If you need to rotate a complex mesh and don't want to have to rebuild it entirely at 45 degrees you can use the Align Brush Vertices tool; the engine will move vertices to their nearest grid point and won't care about modifying the shape of the brush so it's not foolproof.

    There are some times when you need to have a brush rotated at an odd angle, or rotated in more that 2 axis. This is a really good place to use a simple mesh! there are a few basic ones provided in the editor, like cubes.

    Building Geometry
    In order to turn out brushes into something the player can actually move around in the engine must first Build Geometry. This is a fairly complex mathematical process in which the engine breaks down our brushes into parts which it can render and display to the player. By default the UE4 will build your geometry for you as you make changes. However from time to time it can miss an update, or on larger maps this behaviour can get irritating. You can turn off this default in the Editor Preferences under Level Editor -> Miscellaneous -> Update BSP Automatically.

    You may also manually build geometry by selecting Build Geometry under the Build menu, or simply press build (this will build everything and thus may take a long time). Personally I have made a custom keybind for build geometry to save time.

    You will want to build whenever you make a change to a BSP brush, including deleting one. If you delete a brush and it doesn't seem to disappear, rebuild. Change a brushes size, rebuild. Something doesn't match up with the wireframe, rebuild.

    Additive and Subtractive Brushes
    BSP brushes are all about creating and carving solid space to create a level. All levels start empty, filled with "air" or "void" so in order to create a level we must add solid areas for the players to move around. These areas can then be carved into further editing the space. To facilitate this BSP comes in two types:
    • Additive brushes - Add solid space to the level. If you wanted to make a wall you'd need to add solid space your level.
    • Subtractive brushes - Subtracts solid space from the level. If you wanted to make a window in said wall, you'd want to subtract space to create a hole.


    Additive brush (blue) with Subtractive brush (pink) carving out a block.

    BSP Order
    When the engine builds geometry it processes each brush in a particular order, designers can manipulate this order to get the desired effect. For instance building a frame inside a window might require the designers to place Additive Brushes inside a Subtractive Brush; the order in which these instructions are processed defines how the end result will appear. You can change the order of brushes from the details panel, hidden under the drop down arrow. There are however only two options. To First and To Last.

    I like to think of this as a stack of instructions written on paper, when you want something done first you put it on top, when you want it done last you put it on the bottom. You can move groups of instructions to the top or bottom but they stay in the same order as a group.

    Same Brushes, different order. Moving the subtractive brush to last causes the frame to be hidden.

    Geometry Mode
    Geometry mode allows you to modify brushes into interesting and useful shapes. You can select Geometry mode from the Modes tab, it's at the end and looks like a cube with the end chopped off. It can look a little intimidating but it's actually really simple.


    The most important feature of geometry mode is the ability to select individual parts of a brush and move them around, similar to how you might in a modelling program like 3dmax, maya, or blender. You can select veracities, edges, and faces independently. Then you can simply move them around to create the desired shape. The majority of the time I work in geometry mode and stretch and pull brushes to fit the size I need rather than using the details panel to set them to a particular size.


    Cube brush edited in geometry mode

    Extrude Tool
    Sometimes you need to create more complex shapes than simply moving faces and vertices around will allow. The extrude tool allows you to take a face and pull it out from the brush, creating new edges and faces as you go. This can be useful when adding more detail, or when you want to avoid making multiple brushes when you don't need to. In order to activate the extrude tool select a face, then select extrude from the geometry mode toolbar. You may see a message warning you that extrude only works in local space, this isn't anything to worry about.

    There are two ways to extrude, the first is to use the transform widget to move the face, the second is to enter a length value in the geometry mode toolbar. You can also define a segment number, if you use this make sure your segments remain on the grid.


    Making an L shaped brush from a cube.

    Brush Clip Tool
    Almost the inverse of the Extrude tool, the Brush Clip Tool allows you remove part of your brush and full in the gap left. This can be useful when you want to get odd angles, or would otherwise not be able to create the desired shape easily.


    Brush Clip in action.

    The brush clip tool is a little trickier to use and only works in the orthographic views (Top, Side, Front). First select the brush you wish to clip and the brush clip from the geometry mode toolbar. This should give you a small square that follows your cursor around the grid. By pressing space you can start and end a line to cut along. Once you're happy with your cut line you can press apply to cut it.

    You will also see a line running perpendicular to the cut line, this defines what part will be deleted. You can flip this by selecting Flip Normal. The split option doesn't delete any part, but creates a new brush from the part removed.


    Clipping, and slitting a cube.

    Pen Tool
    The pen tool allows you to draw a shape from vertices, and then extrude it into a complete brush. Drawing a new brush functions in a similar way to the clip tool; it only works in the orthographic views, using space to place vertices. Each vertex placed links directly to the one you just placed. After placing your 3rd vertex you will see a dotted line appear between the first vertex, and the last placed vertex. This shows you the edge that would be drawn if you were to finish drawing the shape there in order to create a valid brush. You can complete a shape at any time by pressing enter or by placing a vertex over the first one. Escape will incrementally remove vertices in the order they were placed, which is very useful if you make a mistake. The only option you need to know about is Extrude Depth, which sets the depth to which the engine will automatically extrude the brush too. Like the extrude tool make sure your extrude depth will keep you on the grid.


    BSP holes
    While BSP is quite robust you can into a few issues, the most important being BSP Holes. Holes appear when the engine gets confused with brushes and doesn't know what to do, so it does nothing.

    Editing or clipping brushes can sometimes cause faces to get collapsed together or deleted entirely. This is probably the main cause of holes, and it's fairly easy to fix by using the create tool. To do this select every vertex around the hole, do so in a clockwise motion, the select create. This will make a new face across the selected vertices. Selecting the vertices anticlockwise will create a face that points inwards, selecting in a random order will create a very messed up face, which may make the engine crash so be careful.


    A cube with a face missing, causing a BSP hole.

    In some cases a face will be pointing the wrong way, you can test this by moving the camera inside the brush with it selected; if you see a shaded face where you wouldn't expect it select it and press flip to reorientate the face. Brushes with a single face can also cause major holes.


    A single faced brush causes a massive hole.

    Triangulation and Planar faces
    Brushes must have planar (flat) faces. This means that the engine must be able to draw a flat surface between all the vertices of any face. In some cases you may move a vertex of a face and cause it to become non planar; this will cause the engine will automatically create a new edge, and thus a new face in order to keep everything planar. This can cause a few issues.

    Firstly there are multiple ways to split a 4 or more sided face, and the engine won't necessarily do what you expect. You can however use the Turn tool to change between the options quickly. You can also delete the faces and use the crate tool to form new faces as you see fit.


    Two different ways to triangulate after the same edit.

    Secondly when these triangular faces intersect with other brushes they can cause holes, or just flat crazy behaviour in general. One fix is to use the Triangulate tool, followed by the Optimize tool. This forces the engine to turn all of the brushes faces to triangles, then to make the brush as simple as possible.


    Same brush set-up, one intersecting one not. On the left the triangulate - optimize trick was used to resolve the issue

    However, their is an issue with this trick. The optimize tool can render more complex brushes uneditable by removing supporting vertices and edges. Most of the time you'll want to try your best to keep faces planar, a good tip for this is to use the clip tool; or with square faces always move edges rather than vertices.

    Getting caught on BSP
    BSP collision isn't perfect. Sometimes players will get caught on a floor or wall and be unable to move without any obvious reason. This often happens at brush seems, where two or more brushes meet. If this happens you can try a few things to fix it:
    • Simplify the brushes in the area to remove unnecessary seems.
    • Change the order of brushes. I try to make it so that effected brushes are processed as early as possible, and avoid layering addition and subtracting too much.
    • Use the triangulate - optimize trick as mentioned above.

    If these fail to resolve the issue it may be necessary to make some minor changes to the design, or entirely rebuild the area using a different brush approach.

    Working Methods
    There's no wrong way to work with BSP as long as you're not creating holes or snagging players however there are a few basic things to watch out for. Firstly always try to use as few brushes as possible, but also try to keep brushes fairly simple. This is a balancing act. It would be theoretically possible to create an entire level from one BSP brush, but it wouldn't be advisable. The more brushes you add the longer it will take to build geometry, as there will be more pages of instructions.

    For example, there are two ways to build a room from BSP. The first is to create a large additive cube with a smaller subtractive brush inside; this gives you a room with only 2 brushes. The other way is to use additive brushes to form each wall, followed by the floor and ceiling; this method would use 6 brushes rather than 2. In cases where you know you want a room of that size and shape it would be more efficient, and less risky to use the 2 brush method.

    Personally I like to work with additive brushes. I find it gives me more fine control over the level and makes editing easier, it fits the way I design; you may be different. Don't be afraid of trying things. BSP is quite resilient when you stick to the grid no matter what method you use.

    Go make some BSP
    I've not covered everything here but this should see you though most of the majority of maps you're likely to create early on. If you have any questions or need help you can reply to this thread, send me a forum PM or find me in the #UnrealTournament irc channel.

    For more on BSP see the Official Unreal Engine Documentation!
    Last edited by NATO_chrisjm; 02-06-2015, 03:15 PM.

    #2
    Nicely illustrated and succinct intro to mapping with BSP. Hope this encourages some more people to try their hands at building a map or two.

    NATO, you should put this up on the wiki, and when you do link to it here as well.
    Join Project: Open Tournament: OpenTournamentGame.com | Project Trello | Discord | YouTube

    Subscribe to /r/UnrealSeries - The subreddit for free & uncensored discussion of Unreal series games!

    Unreal Prime Weapons: Impact Hammer | Enforcer | BioRifle | Shock Rifle | Link Gun | Ripper | Minigun | Flak Cannon | Rocket Launcher | Sniper Rifle | Grenade Launcher | Dispersion Pistol

    Comment


      #3
      Very cool, nice job man!

      Comment


        #4
        Thanks all, I'm planning on doing a few more of these aimed at newcomers

        Originally posted by Wail View Post
        NATO, you should put this up on the wiki, and when you do link to it here as well.
        I thought about doing this, but I couldn't really navigate the wiki system having not used it before. I need to sit down and work it out.

        Comment


          #5
          NATO thanks for this! I always wondered how you created weird shapes in your levels. Do you utilize the pen tool? If so, how about a tutorial on that? Maybe advanced bsp editing?

          Comment


            #6
            I wouldn't advise using that method if you're entirely new to the engine or level design; largely because a good understanding of BSP is useful, and getting more in editor time is preferable. Also going over to a 3d app, make the change, export, and import takes a lot longer than to making the change and rebuild. For rapid iteration BSP blows this method out of the water.

            Also I would also advise against using meshes that large, if you want to use this method I'd split up your meshes a fair bit more than using one massive on e for one level.

            It would also be great if you could throw some screenshot tags around the image, it's enormous.

            Comment


              #7
              I'm with NATO on this.
              I would highly encourage level designers to work as much as possible with BSP especially when in the phase of building the basic core gameplay of the map. No matter how experienced one is with external 3D apps, you cannot make quick iterations with the 3D app workflow. Yes, it is possible, but it is cumbersome. There is something to be said for the simplicity and effectiveness of making a quick change and hitting Alt+P to play out how that change will affect the map without having to go through what can be a tedious process.

              Very nice write up NATO, I would also second the write up for the pen tool. It is very useful when making complex shapes that I think some beginners might benefit from knowing when they can be useful, the usefulness and pitfalls of making overly complex shapes, etc.

              cheers. ^_^
              MyArtstation
              @jayoplus

              Comment


                #8
                I tried the editor for 2 months and working with the bsp was a bit frustrating i have to say.
                When placing boxes i could not make them snap to one another. You can only snap to grid it seems but when importing a box i could not make them snap to the other box so i had to overlap them.
                I couldn't find a mirror tool either to copy half of my ctf map and mirror it to finish it.

                Comment


                  #9
                  Snapping to existing BSP is not currently a feature, you can only snap directly to the grid.

                  Mirror commands are under Transform on the right click menu when you have a brush selected. Hope that helps

                  Comment


                    #10
                    Good write up. Covers BSP nicely, though I would maybe suggest including a couple of the common keyboard shortcuts, such as ALT+Transform Widget to duplicate, CTRL+ALT for adding to a current selection etc.

                    Comment


                      #11
                      Should I always build exteriors using adds?

                      Comment


                        #12
                        Originally posted by Jay22 View Post
                        Should I always build exteriors using adds?
                        The old style "Massive box with sky painted on it" style of skybox isn't really used any more. Instead people often use sky sphere meshes, there's a highly customisable sky sphere blueprint in the project which should work for you. If you want to add some background geometry (buildings etc) then adding some large additive brushes in the distance works well. Hope that helps!

                        Tidal Blast: Frankly at this stage in dev all you're doing is pushing faces and verts about, you need do no more than that. In fact doing more than that is inefficient due to the rate of iteration. I'd much rather do that in engine. Using a 3d app won't massively expedite that process and has extra necessary steps to go from 'create space' to 'run around in it'. With BSP I don't have to consider UVmaps, collision, lightmaps etc, nor do I need to learn, own and operate a secondary app. For people absolutely brand spanking new to level design, or the editor, this by far the best method to use.

                        I'd also point out that all the Epic levels are done in BSP. Surely if your method was more efficient they'd be meshed. They would also have no issues distributing not only the map, but the extra asset files needed to support a meshed map. They also have occlusion culling, which one large mesh would not.

                        Take a look at DM-Salt. It would have taken me just as long, if not longer, to do it in max/maya. The working process would have been approximately identical since more or less everything is a primitive. If I'd been working in max I could have probably made it look nicer, but it doesn't need to, and that would have just added to the time.

                        Sure, if you have your level 100% down, and all you need to do is throw it together, then working in a 3d app is probably more efficient. But if you're actually designing, it's going to be no faster than working with BSP. Level design is a slow, thoughtful and iterative process. It's not about how fast you can create space.

                        I've never worked on something the vain of GTA (which this gangstar seems to be), for that something like your method might be more useful since you start dealing with enormous spaces. I can't attest to that since I've not worked on something like it. However, UT isn't at this scale.

                        The current BSP tools could do with updating. But seriously, they're not bad enough to invalidate themselves to your mesh method. Simply put the drawbacks for it, while relative minor for an experienced designer, don't stack up against the BSP advantages at this stage in development.

                        TLDR; I don't agree, while your method isn't bad, I don't think it's advisable if this kind of tutorial is new information to you.

                        EDIT: Also I'll take a look at adding the pen tool to this soon
                        Last edited by NATO_chrisjm; 02-02-2015, 12:35 PM.

                        Comment


                          #13
                          Updated with pen tool

                          Comment


                            #14
                            Nicely done NATO. I'm getting inspired to start mapping again
                            My UT2004 Maps

                            Comment


                              #15
                              Nice precise tutorial. I agree also with NATO, it's so much less overhead of work to use BSP in the editor to prepare a block layout. You can iterate really quickly: not export/import operations required. Btw, BSP is there only for this purpose so better use that tool.
                              RASTE IN PEACE !
                              Maps: DM-Hydraulics | DM-Affliction
                              Weapon: Redeemer

                              Comment

                              Working...
                              X