A random sentence for a random mind.

[227] and [Blender] Bulletproof BSP tutorial (227J+ ONLY)

For questions and discussion about UnrealEd, UnrealScript, and other aspects of Unreal Engine design.

Moderators: Semfry, ividyon

User avatar Kajgue
N-Team Leader N-Team Leader
Posts: 288
Joined: 12 Nov 2007, 18:07
Location: London, UK
Contact:

Subject: [227] and [Blender] Bulletproof BSP tutorial (227J+ ONLY)

Post Posted: 05 May 2023, 00:10

It's been a long time coming, I've been saying (and intending) for a while on the USP discord server that I actually plan to make this tutorial.

Note by Semfry: this is also available in article form on the website, although any updates will be delayed a little: https://www.unrealsp.org/articles/level-design/making-bulletproof-bsp-with-blender

Important: This method in this tutorial only functions with 227J and onwards currently, as it provides alternative means to handle collision in order to make BSP compiling more simplified. Most Ue1 games don't have this!!! Also due to constant changes in Blender versions, this tutorial focuses on Blender 2.93.1!!!

Image

BULLETPROOF BSP TUTORIAL

Index:

0: Introduction

1: Tools and Resources (what you're going to need)
1.A: Downloading and installing Blender (2.93.1)
1.B: Downloading Colin Basnetts Blender .t3d batch export plugin
1.C: Downloading 227J release ver or later
1.D: Downloading a scale reference model (Optional)

2: Blender Setup
2.A: Setting up the plugin
2.B: Preferred primary mouse button
2.C: Setting up important hotkeys
2.D: Making sure 'Walk' Navigation is set rather than 'Fly'

3: Preparing the .blend file
3.A: Setting an Unreal style grid up in your blend file
3.B: Increasing the draw distance within Blenders 3d viewport
3.C: Placing a bounding box in your 3d space
3.D: The view controls of Walk Navigation
3.E: Making the 65536 bounding box 'hollow'

4: Mapping world geometry in Blender
4.A: Important hotkeys
4.B: Adding some starting geometry inside our map
4.C: Examples of editing our geometry (Optional)

5: Moving our geometry over to UnrealEd
5.A: Exporting our brush objects from Blender as .t3d
5.B: Importing our .t3d brushes and adding them as nonsolid in Ued
5.C: Creating world collisions for our geometry
5.D: BSP key steps summary (optional)
5.E: Collision volumes as a more robust collision solution

0. Introduction:

This tutorial is intended to guide the user to be able to craft maps potentially as big as the Ued bounds permit (65536 on the X, Y and Z axis from one side to another) and the max node limit allows (262,144 nodes) without needing to be pre-occupied with the bane of a U Engine mappers existence that's caused us probably many sleepless nights which have always been cryptically known as BSP holes. The tutorial involves tools such as Blender (I will personally be using version 2.93.1 just because this is the version i'm mostly familiar with. Any later version can be used for this process though a few hotkeys and interface locations might have different placements), Colin Basnett's batch .t3d export plugin and UEd 2.2 for this procedure. I'll also put a TL;DR summary version at the end for users already experienced with Blender + UEd, or even if you've covered this tutorial already and you just want some key points to be reminded of certain steps.

The entire logic to this modus operandi is that everything we create we make as easy and as fool proof for UnrealEd's compiler to digest during the rebuild process, we will be placing Non-solid brushes into the map with not necessarily any volumetricity, imported as non-solid brushes with gaps and holes. This skips any need for complex and sometimes problematic collision calculations which the compiler would otherwise be potentially working out (or in many occasions make mistakes with), for collision we will be using both invisible static meshes that were converted from the original 'visual' nonsolid brushes, and once our level nears completion: collision volumes which match the visual geometry for a more robust collision solution. The static mesh world collisions will still remain however, because as far as i know collision volumes don't block light rays.

Additionally, part of the reason we're using Blender to make the map rather than sprinkling Ued with a bunch of vertex edited triangular sheets is not just because this would be slower and arduous, but sadly UnrealEd's brush generators seem to create less stable brushes in comparison.

Having said that, it's worth mentioning a notable drawback during gameplay, that being decals currently not showing up on geometry created this way in 227, this may change some time in the future though.

1. Tools and Resources:

(1.A)
Downloading and installing Blender (2.93.1)


Go ahead and grab Blender if you don't have it already, in this tutorial I'll be using 2.93.1 but future versions can also be used if need be. If you already have another version of Blender installed, you can also grab 2.93.1 as a 'portable' install and can have both (or more) versions can mutually co-exist on your hard drive.

Blender homepage

Want a direct link to Blender 2.93.1 portable? Here: https://download.blender.org/release/Bl ... ws-x64.zip

(Put the whole link there for display for peace of mind that it comes directly from the Blender foundation's previous versions archives)

(1.B)
Downloading Colin Basnetts Blender .t3d batch export plugin


Once that's installed, we will be grabbing Colin Basnett batch .t3d export plugin from Github.

https://github.com/DarklightGames/io_scene_t3d

Once you go to the link here, you need to click on the green 'Code' button and then click 'Download as ZIP'.

► Show Spoiler
- If stuck


(1.C)
Downloading 227J release ver or later


The next awkward part would be to make sure you have Unreal installed (but if you're reading this i'm assuming you do).
► Show Spoiler


Assuming you already have Unreal installed, I would recommend obtaining and installing 227J release (or later if you have beta access) from OldUnreal:
OldUnreal download page


(1.D)
Downloading a scale reference model (optional)


When we actually get to start mapping in Blender, we should think about having something as a size reference to place in our 3d scene so we can get a sense of how big our environments are. One option would be to export one of the human playermodels using a single frame .obj file, otherwise we can use the one this tutorial provides which matches the proportions of a human in Unreal.

Generic human male model

Download it and keep it somewhere that you'll remember.

End of section 1

2. Blender Setup

(2.A)
Setting up the plugin


Next, the normal and easy way to install Blender plugins is through the preferences interface within Blender, under the addons category; but if I recall there were numerous people who mentioned to me that this specific plugin wasn't being loaded when selecting the downloaded plugins .zip file from that menu, so we will have to put the contents of the .zip into your blender addons directory manually just to make sure. Make sure Blender is closed for a moment before doing this.

As I'm using windows (10), the folder found directly inside the .zip would go here.
► Show Spoiler


For you, this directory will have a different address based on what your user account name would be on your PC, which is why I deleted my name on the image to prevent confusion. If your system username happens to be Montgomery for an example, the address would be -
C:\Users\Montgomery\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons


Next, open Blender and click outside of the splash screen to make it disappear. The first thing we'll do is go to Edit > Preferences on the menu bar.

► Show Spoiler
- If stuck


When the preferences window appears, click the 'add-ons' tab on the left, then scroll down to where the plugin you installed shows up (it will be in alphabetical order), you're looking for Import-Export: Unreal .t3d exporter, and make sure this plugin is enabled by setting the 'tick' to the left of the plugin title.

► Show Spoiler
- If stuck


Now, before closing the preferences window, make sure you save your changes to your preferences by clicking the 3 small horizontal bars at the bottom left of the window then clicking Save Preferences.

► Show Spoiler
- If stuck


(2.B)
Preferred primary mouse button


The neat thing about Blender is that you can essentially assign almost any function a hotkey or combination of keys. The one most crucial and immediate hotkey I will recommend setting up is free look navigation with WASD to move around basically the same thing as noclipping in an FPS, which Blender calls Walk Navigation for some reason. There is also Fly Navigation too but this feels like trying to manoeuvre a spaceship, so we're better off with Walk Navigation. The default kind of view navigation which Blender uses is some weird camera orbit navigation which is very awkward for 3d environments, but perhaps a lot more useful for modelling single assets/characters etc (even though I still use Walk Navigation to model assets too).

Before we do that though, just take note of the top of the keymap tab.

(Optional if you've never used Blender before feel free to ignore this)
► Show Spoiler


(Optional but important)
► Show Spoiler


This image annotates the locations of the import/export preset button locations and where to select the primary mouse button, relevant to the optional sections directly above.
► Show Spoiler


(2.C)
Setting up important hotkeys


Now, we want to go onto where the controls are assigned, mainly the button to define Walk Navigation. Below in the preferences window with the Keymap tab selected are where the control scheme is located, and this interface is sectioned out into almost a directory tree. To find where Walk Navigation is assigned, expand 3d View > 3d View (Global) and if scrolling down you should notice View Navigation (Walk/Fly), if you're unsure what to assign this too, I would recommend using the middle mouse to trigger this action, as there are alot of keymaps already occupied for multiple other things.

Image

At this point you might also wish to disable the action which pressing middle mouse does by default, so that they don't conflict, known as Rotate View (further up the list).

Image

(2.D)
Making sure 'Walk' Navigation is set rather than 'Fly'


This *should* all be set by default, but in case a different Blender version has different defaults, make sure to set these.

Image

Again finally, save your preferences by clicking the 3 horizontal bars at the bottom left of the preferences window and then pressing Save Preferences.

Image

It should now be safe to close the preferences window.

End of section 2

In this section we learnt how to configure some crucial preferences and hotkeys and how to enable plugins.

3. Preparing the .blend file

(3.A)
Setting an Unreal style grid up in your Blend file


Initially, what we're going to need to do is to set up an Unreal style grid, and figure out where to easily reach the grid scaling in case we want to map on a grid spacing of 1, 2, 4, 8, 16, 32 etc. If you look to the right of the Blender interface, you should notice a properties menu with a selection of tabs, switch to the 'Scene properties' tab, circled just past the right of the 3d view. Here you will find the Unit standards that correspond to your .blend file, and change Unit system which is on Metric by default, to None, while the rest is fine to leave on default.

Lastly, take note of the stopwatch symbol at the bottom of the screenshot, which has 'Start' and 'End' directly next to it, for mapping we don't need 'End' to be any higher than 1, infact if we accidently tap the spacebar at any point, this might cause some scene complications if we make geometry edits without noticing that our timeline is playing. So change this value from 250 (default) to 1.
Image

Next, look at the magnet icon at the top of your 3d view, enabling this will make sure grid snapping is on, then you'll want to make sure to open up the Snapping dropdown on the icon directly right of it and ensure thatMove, Rotate and Scale in the screenshot below are 'on'.

Image

Next, we're going to look to the top right of the 3d view where there is a tiny arrow directly next to the 'Overlays' toggle, clicking that arrow will show us some settings, most importantly the grid scale! Change the 'Subdivisions' value from 10 to 1 to prevent it from subdividing our grid.

This screenshot shows that the grid scale is set to the equivalent of 1uu, when working with BSP geometry it's advised to never go lower than this!
Image


A few pixels to the right of this is another dropdown menu, but for viewport shading, make sure to open that at enabled 'Backface Culling' and change the Color display from 'Material' to 'Texture', which will allow solid shading view to display the texture you have set on a surfaces material entry.
Image


We're now very close to actually get stuck into mapping in Blender.

(3.B)
Increasing the draw distance within Blenders 3d viewport


Finally, below the viewport shading dropdown which you previously opened, and to the right of the widget there is a very small arrow pointing to the left which sits on the lip of the 3d view.

Click that to expand
Image


It will open up showing some surplus menus. The tab it's on by default will be important when manipulating geometry. Whatever 3d item is currently selected, whether it's an object, a vertex, an edge or poly: it will tell you it's transformation orientations there. When exporting brushes, you will need to make sure that all transformation orientations are applied (UEd has a similar system with brush scale atleast) to the object beforehand.
Image

But for now, click on the view tab, which will open up some other important options.
Image
Clip Start and End define the view distance, (or where it abruptly stops rendering). By default the 'End' value is 1000 which is exactly the same as 1000 unreal units, this kind of distance is tiny for seeing an Unreal map, feel free to raise this to something much higher. I typically raise this value to 65536 (the same extent as an Unreal map). This will still cut off things in the corners of the map when at the opposite ends of it, but should still be ample unless you have a parallax backdrop also. I would also advise raising the Clip Start to 1 to get a bit of depth precision back, but this aspect entirely depends on your computer hardware.

(3.C)
Placing a bounding box in your 3d space


Once we start importing the geometry into UEd we'll be making from within Blender, this method relies on creating an Additive map, which is the voidal inverse of what Unreal has since release, historically done. An Additive Map just means that the map starts as an empty nonsolid void which you place additives (or in this case, non-solids) in, rather than a standard map that uses a solid void and requires volumetric subtractives to be carved out.

Modus operandi reminder
► Show Spoiler


So now that we're all set up, the first thing we'll do is to delete the 3 starting objects, the Light, default cube and camera, unless you prefer to keep them there for whatever reason. Then, in Object mode, we will create a cube that shall be 65536 in size. To do this, where it says 'Add' near the top left of the 3d view needs to be expanded, then Mesh > Cube.

Image
Once clicking, this item the cube will start existing and we'll have some extra options.

Next we will set the initial size.
Image

Image
Change the 'Size' value to 65536. This will be the exact equivalent of the maximum size an Unreal map can be.

We no longer see the object as it has encapsulated the camera. The purpose of this cube is mostly to stop us from going outside the bounds, so next what we want to do is head to the object properties >
Image
1. Expand Viewport Visibility
2. Tick Wireframe and All Edges
3. Scroll further down the Object Properties menu
Image
4. Change Display As from Textured to Wire.

(3.D)
The view controls of Walk Navigation


Walk Navigation controls:
W = Move Forward
S = Move Backward
A = Strafe Left
D = Strafe Right
MWheelUP = Increase Speed
MWheelDOWN = Decrease Speed
Q = Fly Downwards
E = Fly Upwards
Left Mouse Button = Confirm Camera Travel and regain control of the mouse
Right Mouse Button = Cancel Camera Travel and teleport back to where you were before activating Walk Navigation


If in the earlier step we set up the Walk Navigation correctly to your desired button (let's just assume you went with middle mouse button), if you now click the middle mouse, you'll be able to move the camera around. You might have noticed as moving the camera that the map bounds you recently set up should be visible.

(3.E)
Making the 65536 bounding box 'hollow'


Select the 65536 bounding box again, we'll now need to make it 'hollow' so we also have faces pointing inwards too (this can have a few other undocumented uses also) to make sure that our skybox will have something to be projected onto.

With the cubic bounding box object selected, open the Modifier tab
Image

... And then select the 'Solidify' modifier
Image


The modifier will now be added onto the modifier stack and will provide some options.

We'll want to change the thickness from the default value of 0.01 to 256. If the offset remains as -1.0000, this should create inwards facing polys inside the bounding cube. You might be able to also have the thickness lower but I think '256' is a safe value to keep the player from skipping a tick and falling through collision. The newly generated inward facing polys will also be our fake backdrop.
Image

Next, apply the modifier by opening the following dropdown menu. This will make the modifier's effect part of the cube object's real geometry.
Image

At this point you might wish to save this .blend file to use as a template for mapping. To save, go to File > Save (or save as). Now that our bounding box is set up, we can actually start to map.

End of section 3

In this section we learnt how to add a cube, size it, how to move the free look camera, change the view distance, configure an Unreal style grid while enabling snapping and some basic use of a solidify modifier.

4. Mapping world geometry in blender

This part will actually cover creating and editing geometry, and also include a legend of important hotkeys for both Edit mode and Object mode when handling geometry and more. We will start getting practical experience on creating our own worlds and creations in this program and referencing the hotkeys to figure out how to do that.

This process will be split between both Object and Edit mode as BSP would be considered rather low poly. Object mode allows us to manage the positioning of Objects in our scene, such as where they are located and other transformations. Before exporting any brushes as .t3d, we must make sure all those objects have their transformations applied, (the same thing as Transform Permanently in UnrealEd). While Edit mode will allow us to edit the geometry of a specific object, giving us operational abilities such as moving, rotating, extruding, bevelling, spinning (like revolve in UEd), insetting, filling, subdividing, joining, splitting, merging, separating, grid snapping etc selected 3d items (verts, edges and polys etc). Edit mode will also allow us to UV unwrap (precise texture alignments) and then UV edit the faces we've selected. The amount of control we have from these operations sum total is much greater, in some ways faster and more precise than UEd would ever permit.

You can switch between modes (such as Object or Edit mode) up here.
Image
An object such as a 3d shape needs to be selected in order to enter Edit mode


(4.A)
Important hotkeys


The best resource for all of the hotkeys and edit mode operations under Blender's disposal would be it's official documentation https://docs.blender.org/manual/en/latest/ . The documentation seems to only support the latest version, but most hotkeys should remain the same.

Selecting is done with your mouse button of choice which you earlier configured in the Keymap tab of the Preferences window.

Hotkeys

CTRL+Z = Undo.

CTRL+SHIFT+Z = Redo.

NUMPAD 5 = Toggles between PERSPECTIVE and ORTHOGRAPHIC view.

NUMPAD 7 = Switches to TOP view (holding CTRL while pressing the hotkey inverses the direction).

NUMPAD 1 = Switches to FRONT view (holding CTRL while pressing the hotkey inverses the direction).

NUMPAD 3 = Switches to SIDE view (holding CTRL while pressing the hotkey inverses the direction).

CTRL+D = Duplicates and moves the duplicate to a new location using the mouse. Works in Object mode and Edit mode (among others)

TAB = Toggles edit mode on the fly (will switch back to the previous mode you were in if the hotkey is pressed again).

G = Moves selected items around in conjunction with moving the mouse, works in Object mode and Edit mode. To confirm the move, press your primary mouse button and once doing so will display an expandable dialog at the bottom left of the 3d view. Pressing X, Y or Z while moving restricts the movement along that axis.

R = Rotates the selected items in conjunction with moving the mouse, works in Object mode and Edit mode. To confirm rotation, press your primary mouse button and once doing so will display an expandable dialog at the bottom left of the 3d view giving you some more specific options. Pressing X, Y or Z while rotating restricts the rotation along that axis (or the axis will default to the camera angle).
Extra Info
► Show Spoiler


S = Scales the selected items in conjunction with moving the mouse, works in Object mode or Edit mode. To confirm the scale operation, press your primary mouse button and once doing so will display an expandable dialog at the bottom left of the 3d view giving you some more specific options. Pressing X, Y or Z while scaling restricts the scale operation along that axis.
Extra Info
► Show Spoiler


E = Extrudes (then moves) the selected items in conjunction with moving the mouse. Works only in Edit mode. To confirm the extrusion, press your primary mouse button and once doing so will display an expandable dialog at the bottom left of the 3d view giving you some more specific options. Pressing X, Y or Z while extruding restricts the extrude-moving operation along that axis.

SHIFT+S = Opens the Snap Menu and affects the selected vertexes or objects depending on whether you're in Object mode or Edit mode. The Snap Menu gives you the choice to Snap selected (verts or objects) to grid which we will make use of a lot, including other options. Refer to the image below for all the options this operation provides.
► Show Spoiler


I = Insets the selected items in conjunction with moving the mouse. Works only in Edit mode. To confirm the inset, press your primary mouse button and once doing so will display an expandable dialog at the bottom left of the 3d view giving you some more specific options.
Extra info (specific options):
► Show Spoiler


CTRL+V = Opens the 'Vertex context menu' with a list of operations that only affect selected vertexes. Works only in Edit mode.

CTRL+E = Opens the 'Edge context menu' with a list of operations that only affect selected edges. Works only in Edit mode.

CTRL+F = Opens the 'Face context menu' with a list of operations that only affect selected faces (polygons). Works only in Edit mode.

ALT+N = Opens the 'Normals context menu', the important item on this menu is 'Flip' that toggles the direction of a selected face. Works only in Edit mode.

F = Fills in a new face if 3 or more vertexes are selected, while if only 2 (unconnected) vertexes are selected, this will fill in an edge between those vertexes. Avoid doing this when the two vertexes are already connected over the same polygon. Works only in Edit mode.

J = Joins two selected vertexes if they are already connected over a polygon. This is very useful to manually triangulate. Only works in Edit mode.

L = Selects linked geometry region of whatever the mouse is hovering over. Works only in Edit mode.

CTRL+L = Selects linked geometry of which connect to whatever item(s) are selected. Works only in Edit mode.

CTRL+Primary MB = Selects items on connected geometry on the closest path, and works with vertexes, edges or polygons. Works only in Edit mode. Good for speed selecting.

ALT+Primary MB = Selects a loop cut (a straight line on quad based geometry). Works only in Edit mode.

A = Select all. Works in both Object and Edit modes.

ALT+A = Deselect all. Works in both Object and Edit modes.

DELETE = Deletes the selected objects or geometry depending on which mode we're in. In Edit mode, attempting to delete something will open a delete menu with options of what to delete.

M = Opens the Merge menu of which it's options affect whichever (multiple) vertexes are selected already. Works only in Edit mode.
Extra Info
► Show Spoiler


CTRL+R = Starts a loop cut (a straight line along quads) based on where the mouse is situated while hovering over geometry. Works only in Edit mode. To confirm the loop cut, press your primary mouse button once, then you should be able to slide the loop cut across that surface. Pressing primary mouse again will display an expandable dialog at the bottom left of the 3d view giving you some more specific options.

Y = Splits off selected geometry but keeps it in the same blender object. Works only in Edit mode.

P = Separates geometry off into a new object. Pressing will bring up the Separate menu where you can choose what elements to separate. Works only in Edit mode.
Extra Info:
► Show Spoiler


H = Hides selected geometric items in Edit mode, and in Object mode hides entire objects.

ALT+H = Unhides everything associated to the object in Edit mode, and in Object mode unhides all objects in your .blend scene.

Operations without direct default hotkeys

Bevel Edges = Bevels selected edges of geometry in conjunction with moving the mouse in Edit mode. Clicking the primary mouse button during this operation will confirm it and bring up more detailed options (at the bottom left of the 3d view). This operation can be accessed with the edge context menu (CTRL+E).
DETAILED INFO:
► Show Spoiler


Subdivide = Cuts the selected edges/polys into multiple divisions in Edit mode. Selecting the operation will immediately bring up more detailed options (at the bottom left of the 3d view). This operation can be accessed with the edge context menu (CTRL+E).
DETAILED INFO:
► Show Spoiler


Mark Seam and Clear Seam = Marks or clears the selected edges as a seam. Seams are important for numerous things when dealing with BSP geometry but mainly they are used to separate the UV islands on the UV map during Edit mode. This operation can be accessed with the edge context menu (CTRL+E).
OTHER USES:
► Show Spoiler


Triangulate faces = Changes all selected geometry into triangulated polygons during Edit mode, which all of our imported geometry into UEd will end up being (Colin Basnetts exporter should automatically triangulate everything anyway). This operation can be accessed with the face context menu (CTRL+F).

Tris to Quads = Changes all selected triangulated polygons into quads (surfaces with 4 vertexes and 4 edges) during Edit mode. This operation can be accessed with the face context menu (CTRL+F).

Poke Faces = Joins the vertexes on any selected face directly to a single vertex into the middle during Edit mode. This operation can be accessed with the face context menu (CTRL+F).

Solidify faces = Adds depth on the back face of selected polygons during Edit mode. Triggering the operation will instantly bring up more detailed options (at the bottom left of the 3d view). This operation can be accessed with the face context menu (CTRL+F).
DETAILED INFO:
► Show Spoiler


Bevel Vertices = Bevels selected vertexes during Edit mode. Performs mostly the same operation as Bevel Edges but applies the effect to vertexes instead. This operation can be accessed with the vertex context menu (CTRL+V).

Flip = Flips the selected normals during Edit mode (swaps the facing direction of a polygon). This operation can be accessed with the normals context menu (ALT+N).

(4.B)
Adding some starting geometry inside our map


After going over some crucial hotkeys that can be referred back to at any time, now is the time we'll be acquiring some practical experience even though it will remain simple. The best and most powerful example that we'll be using is creating an outdoor area that should be mostly your creation. If we think of vertex editing in UEd, that's what we'll mostly be doing here by selecting vertexes and other geometric elements then pressing G to move those selected items around which I think will be the best way to start. Since we're making a purely additive world, we'll need to make sure when we're ready to finalize the environment that there are no holes or leaks for the player to fall through (referring to actual gaps between geometry rather than Unreals BSP holes, where if we perform certain parts methodically we shouldn't be getting any BSP holes at all).

To begin, we'll create some starting geometry to work with; we will be in object mode for this (and our geometry should be separate from the bounding box).

Add a plane by clicking Add > Mesh > Plane on the top left of the 3d view.
Image

... and then make it something sizeable and familiar like 8192 (the size is entered at the bottom left of the 3d view once the plane is added).

Now with the newly created plane selected, we will enter Edit mode to edit this specific object (the mode can be switched at the top left of the 3d view). Once we enter Edit mode we'll also get some new useful options in the same menu in which we can change the grid scaling.
Image
Enable Edge Length in this drop down menu, it will tell us the length of selected edges. You may also want to turn off 'Floor' which is above the grid scale, that will remove the visual grid floor (this might get in the way for you depending on your preference).

Now we can start manipulating our plane, which we may wish to subdivide.
► Show Spoiler


Image
Increase the Number of cuts to 15 for now, which will give us 16 rows and 16 columns (the cuts counts the edges made in between), if we ever need more detail to work with we can make other operations later on.

If we glance carefully though, we'll notice that the length of edges is 512 units (same as uu) as we enabled the Edge Length Overlay earlier, this may be a little small to start working with, but this is very easy to change.

If the 3d Cursor has not moved from it's original position, and the geometry also hasn't moved from it's original position, it should be safe for us to scale this subdivided plane up by a factor of 2. If we check the top of the 3d view we'll see where we can set our pivot point, by default it's on median point which refers to the median location of the selected geometry to perform certain transformations, but because we want to have to snap things back to the grid as less as possible we might want to change the pivot point to the 3d Cursor for this next step.

Where to change the pivot point:
► Show Spoiler


Scale the geometry up (assuming everything is still selected) with S and then control the scale amount with the mouse. As we told Blender to snap when scaling as well as rotating earlier on this tutorial, moving the mouse during this process should dynamically scale it up (the opposite way would have the opposite affect) with snapping applied. If you're comfortable with scaling it up with the mouse to reach a factor of 2 you can, but if you want to precisely specify the amount, if you confirm the scale and look to the bottom left of the 3d view we should see some specific options.

Image

As our geometry was snapped to grid earlier, if we make sure the scale is exactly 2.000 we can guarantee that it will still remain on the grid, but if you want to be *sure* you can snap selected to grid with SHIFT+S and then choosing 'Selection to Grid', which when working with BSP we'll need to do this methodically, especially prior to exporting brush objects.

Image

At this point, we can deselect all geometry (ALT+A), then we can start selecting elements of the geometry (Vertexes, edges or polys) and move them around with G to move.

We need to know how we can change which elements of the geometry we select however, those buttons are found directly right of where you selected 'Edit mode'.

► Show Spoiler

From here, there are multiple things you can do. I'd like to make it more up to you what you want to create to start feeling ownership over your experience. The next parts of this section are optional and will feature some examples of how some of the operations listed above can be used in a basic example map, I have a feeling though you may already have started playing around with the tools at hand (which is good, but if not that's not an issue either).

(4.C)
Examples of editing our geometry (Optional)


Joining:
We can also control the means of triangulation by selecting two vertices across a face and pressing J, as controlling our triangulation is also a means of structuring our geo.
► Show Spoiler


Moving:
We can move any selected elements around with G, that includes vertices, edges or faces.
► Show Spoiler


Moving stuff in TOP orthographic view
With a fairly sized grid of polygons set up, we can begin by moving some of the vertices on the grid around (G) while in the top orthographic view (NUMPAD 7).
► Show Spoiler


Moving, joining, extruding and deleting
Combining joining (J) and moving (G) we can start to plan and structure our geometry. I then selected these faces (after switching to face select) by first selecting a single one, then fast selecting the rest on shortest path (holding CTRL while selecting) which are currently on the ground. I then extrude the selection (E and then moving the mouse) upwards.
► Show Spoiler


More detailed Moving tips:
I move some of the vertices on the top of the cliff wall around by switching to Vertex selection selecting those vertices and pressing G again. I can also choose to move (G) on a single axis (pressing X, Y or Z while moving), I restricted certain vertices to move on vertically.
► Show Spoiler


Marking temporary seams as a way of controlling our selections:
Another trick we can do if wanting to select a large area without needing to select each element one by one, we can go into edge select mode and select some edges to use as a border between selections, then go into the Edge context menu (CTRL+E) and select Mark seam, highlighting the edges as red to tell us that it's a seam.

From doing this, we can switch to face selection mode then select everything behind the red line (the seam) by hovering the mouse over the area and pressing L.
► Show Spoiler


Don't forget to save your progress every now and then!

Scale reference:
As we manipulate our geometry more, adding cliffs and environmental facets, we might want to know how large our environment scales up in comparison to a player or other character. Feel free to use an .obj of any exported Unreal character, otherwise we can import the one we acquired from this tutorial earlier. We'll need to be back in object mode for this (TAB toggles in and out of Edit mode), then we'll reach up to the menu at the top of the interface, and click File > Import > Wavefront (.obj) and then navigate to the .obj file that we need (depending where you saved it). Make sure to not split the verts, we should keep vertex order.
► Show Spoiler


Extruding vertices and filling gaps:
We also have the option to extrude an individual vertex to extend out an edge (E), once we do, the new vertex will be floating and not attached to any polys. By selecting 3 or more verts and pressing F we can fill in a new face, this is useful for attaching floating edges/verts to actual geometry.
► Show Spoiler


Merging:
Another way which we can eliminate a few extra vertices is using Merging. Selecting more than 1 vertex then pressing M will open the Merge Menu. Merge options include At Center (merges to the median point of the selection), At Cursor (merges selected vertices to the 3d cursor location), Collapse, At First (Merges to the location of the first selected vertex in your selection chain), At Last (Merges to the location of the last selected vertex in your selection chain).
► Show Spoiler


Subdividing + Loop Cut & slide:
After a while of continuing to manipulate our geometry, we may start to have something more cohesive, one thing i haven't yet covered though is loop cutting. We might try to add some detail onto the walls of our cliffs, which we can do with selecting all the vertical edges on the cliff walls and then using the edge context menu (CTRL+E). Or if the geometry we intend to subdivide is made mostly out of quads, we can use Loop Cut and Slide (CTRL+R) which will target a row of edges to subdivide without needing to select each edge individually.
► Show Spoiler


Grid snapping:
All of our vertices of our brush geometry should be on the grid before we export the objects as .t3d. I can select all of my object's geometry (A) and then snap the selection to grid (SHIFT+S then select 'Selection to Grid')
► Show Spoiler


Separating select geo into a separate object and UV Unwrapping:
To prevent us from having to select every face manually in UEd to apply a texture, we should make it a habit to separate different parts of the geometry that will use a different texture, that will make it a separate brush and we will have the option in UEd to select faces by matching brush. We most likely want to give our ground an appropriate texture like grass or mud, therefore we can mark a seam around the edges of our ground by selecting those edges, pressing CTRL+E and then Mark seam, then switch to face select, hover over the ground and press L to select by linked, then we can separate our selection by pressing P to open the separate menu, then we choose 'Selection'.
► Show Spoiler


Don't forget to save!

End of section 4


In section 4, we learnt how to add primitive objects in Object mode, how to perform a variety of geometry operations in Edit mode, including a list of important hotkeys and operations we can perform.

Continued in next post ...
Last edited by Kajgue on 13 Jun 2024, 23:20, edited 6 times in total.
N-Team leader
The Silver Blades clan chief
Image

User avatar Kajgue
N-Team Leader N-Team Leader
Posts: 288
Joined: 12 Nov 2007, 18:07
Location: London, UK
Contact:

Subject: Re: [227] and [Blender] Bulletproof BSP tutorial

Post Posted: 05 May 2023, 00:10

5. Moving our geometry over to UnrealEd

Next, we'll learn to export our brush models using Colin Basnett's .t3d exporter. Afterwards, we'll learn a few extra things we should do to preserve our brush health. Then, we'll create world collisions for our environment and put them into a group so we can select, hide or modify them quickly while in UEd. At any point, if we need to make changes to our geometry, we can just edit them again in our .blend file, re-export them and replace the corresponding brushes we have in Ued. At the start it can feel a bit tedious but I think eliminating the risk of BSP holes is worth it.

(5.A)
Exporting our brush objects from Blender as .t3d


Make sure that all your verts are on grid, that some of your BSP is nicely separated into a few different objects (this also helps with replacing parts later on) and unwrapped.

Next, we'll give our objects names, batch exporting our brush objects will give them the same file names as their object names. With an object selected, the name can be changed in the Object Properties tab, on the top field (Also name your bounding box!)
► Show Spoiler

- If stuck

Once you've named all of your objects, select your bounding box and all of your map geometry, make sure not to select the generic human scale reference(s) as we won't need those as brushes (and they won't have their verts on grid).
Image

Next, go to File > Export > Unreal T3D (multiple) (.t3d) you will notice another .t3d export option on your list but that only exports a single .t3d
Image

Export as multiple and then choose a directory to then export.
► Show Spoiler

- If stuck

Now that we've exported our brushes, let's make sure our Blender project is saved and we'll open UnrealEd.

(5.B)
Importing our .t3d brushes and adding them as nonsolid in Ued


Open UnrealEd 2.2 and then choose File > New Additive which will open a blank 'open void' map. Then go to Brush > Import
Now, for every brush you import like this (without volume), you must choose 'Nonsolid (contains gaps or holes)' and ignore 'Merge faces'.

Image
Now, with your bounding box imported, right click on the red coloured brush wire and choose Polygons > Separate
Image
The positive aspect for this is that it slightly increases BSP health though also makes the lightmaps on poly edges a bit more noticeable.

Now we're finally going to add this to the map, select 'Add Special Brush' and choose 'Non-solid' solidity.
► Show Spoiler

- If stuck

Then click OK. You'll probably wish to use the inwards facing polys for the fake backdrop later on so make sure they're unlit (being unlit will stop the surface from generating lightmaps and preserve some performance).

Also make sure to set the ForceViewZone flag of imported brush surfaces, as this eliminates some remaining BSP issues that can possibly crop up.

Image

(5.C)
Creating world collisions for our geometry

Next, select the brush you just added then right click. Go to Convert > To Static Mesh

Image

Then a small window should appear specifying the package as Emitter. Instead we want to change this to create a new package for our world collisions (afaik myleveling them creates a few issues with sublevels), for my own convenience I've named the package TutorialCol and named the static mesh TutBoundBox, but your naming schemes are up to you!

Success.
Image

Now we want to SAVE this mesh package, which is something we should also do methodically before we add any static meshes into our map (just incase a crash occurs before we save the mesh package). The default mesh saving location should be ..\Unreal\Meshes, this is where the game looks for .usm static mesh packages.

Image
Now we add the mesh to the map. We want the brush origin point to be at x: 0 y: 0 z: 0 , in other words the center of the map. With this method, we shouldn't ever need to have to actually move our map brushes after importing them into Ued, if their origins were also in the center of the 3d space in Blender then the offset geometry will always be positioned where it needs to be, and saves alot of time.

If the static mesh does get added at a weird position, simply right click on it and Reset > Move To Origin
Image

Now if we see the static mesh surface Z fighting (flickering) with the brush, this means it's positioned correctly.

Now add a new group, which I normally call WorldCol that we will add all of our static mesh world collisions into.
► Show Spoiler

- If stuck

Then add the static mesh (must be selected) to the new group (must be highlighted).
► Show Spoiler

- If stuck

The purpose of adding our world collisions to groups is so that we can hide them in the editor on demand, and also we can select all actors in the group at once to tweak their properties.
How to hide a group in the editor
► Show Spoiler


Your world collisions must be set to hidden! Their purpose is never to be visible, just to use their geometry to collide with.
Image

Lastly, under the Collision properties of all of your static mesh world collisions, make sure that we have BlockAISight and PathCollision set to true.
Image


Now that you know what you need to do when importing brushes and setting up their world collisions, if these key steps are carried out correctly, your map should not have any issue with BSP problems. If you want a summary of those key steps to recap at any time, they are included below.

(5.D)
BSP key steps summary (optional)


Somewhat a TL;DR

1. File > New Additive
2. Import .t3d as Non-Solid (contains gaps or holes) (Ignore Merge faces)
3. Right click red-brush then Polygons > Separate
4. Add special with Non-Solid solidity
5. Set all surf flags to ForceViewZone
6. Convert each brush to Static Mesh with Slider set far left (1) always
7. Keep your new mesh package saved, especially before adding any meshes into the map
8. Static mesh collisions must be at the same position as brushes
9. Add static meshes to a world collisions group which you can keep hidden
10. Set PathCollision and BlockAISight to True in the properties of your world collisions actors.

(5.E)
Collision volumes as a more robust collision solution


After importing more of our world geometry and setting up their world collisions as detailed in this section, we may notice that this sometimes won't be enough to prevent players and characters glitching through the map. Normally if the player is falling at a decent speed or sliding down ramps at certain angles, the engine sometimes won't have enough updates/ticks to keep track that the player is definitely within the world, so once we consider our level more 'finished' or ready to do some playtests, we may want to start placing collision volumes in the shape of our geo.

First we need to go back to Blender and re-open our .blend project. I think the first place we should start with is creating a volume for our ground.

Image
In Object mode, duplicate our ground (CTRL+D) and make sure the ground isn't moved anywhere. If we did accidently move our ground brush object, we can fix that.

Image

If these options for our duplication operation are still up, we can make sure the X: Y: and Z: are left on 0 for each value. If we ended up doing another action which would result in this being closed, we can keep the duplicate ground selected and then change our transform to X: 0, Y: 0 and Z: 0 at the top right of the 3d view in the dock able options.

► Show Spoiler

- If stuck

Next, we want to rename our duplicated brush object to something we'll know how to tell the difference from the original. I'll just add VolCol at the end of mine.

► Show Spoiler

- If stuck

Next, we'll want to add volume to our collision volume mesh. We can also do this with the Solidify modifier again like we did with the bounding box. Keep in mind not to make the thickness too high to avoid cutting into other rooms (if they happen to exist where you're increasing the thickness of solidify) but it still should be high enough in certain places to prevent the player from clipping through the world collisions, in most cases 64 units thickness should be enough.

► Show Spoiler

- If stuck

Don't forget that the visual ground mesh will now be in the same place as the collision volume, if we ever plan to change what texture one shows in Blender (or their colour) then we will end up seeing Z fighting. We might want to change our collision volume to only appear as wireframe in Blender like we did with our bounding box much earlier in the tutorial.

► Show Spoiler

- If stuck

(Optional)
► Show Spoiler


We'll now export our collision volume meshes to .t3d again (if need be, feel free to check earlier parts of the tutorial if we forget how to export as .t3d).

We can close Blender again for now if we want. Open UEd and then load our map, if we see that our world collisions have unhidden themselves again, go to the Group browser and then Refresh the groups.
Image

Now we'll import the collision volume .t3d that we just exported from Blender, we can do this the same way we imported the rest of the geometry.

With our collision volume geometry imported as the red brush, now right click on Add Volume Brush
Image
We'll chose the very top one 'Blocking Volume'
Image
A collision volume will be added, you might have to hide the red brush or change it to a default cube/move it around to see the yellow wires to indicate that our blocking volume was added successfully.
Image
Feel free to also add all the collision volumes to your World Collision group too!


In this last section, we learnt how to batch export .t3d brushes from Blender, the (meticulous) steps needed to import them without any risk of BSP issues, we also set up a collision volume which is alot more effective at keeping pawns in the map compared to the wafer thin static meshes (though these should still stay for shadow casting).
End of tutorial

Thanks for reading! :)
N-Team leader
The Silver Blades clan chief
Image

User avatar Darkon
White Tusk White Tusk
Posts: 2240
Joined: 12 Nov 2007, 15:11
Location: P46153

Subject: Re: [227] and [Blender] Bulletproof BSP tutorial

Post Posted: 15 May 2023, 18:56

Thanks, Kajgue! :tup:
Never trust a Dutchman in a tulip fight.

User avatar Kajgue
N-Team Leader N-Team Leader
Posts: 288
Joined: 12 Nov 2007, 18:07
Location: London, UK
Contact:

Subject: Re: [227] and [Blender] Bulletproof BSP tutorial

Post Posted: 15 May 2023, 19:16

No problem, let me know if you have any questions, if some things weren't clear enough or generally if you had any feedback. :tup:

I also realize now that i missed going into deeper detail about texture aligning (UV Mapping), but to be fair that uses most of the same hotkeys as 3d editing does. I kinda feel like the best way to help people learn is to avoid handholding as much as possible and allow them to have ownership over the experience they get. At some point i should still also append a UV section just summarizing that moving UV's around uses the same hotkeys etc.
N-Team leader
The Silver Blades clan chief
Image

User avatar Sat42
Skaarj Warlord Skaarj Warlord
Posts: 922
Joined: 14 Jul 2013, 16:42
Contact:

Subject: Re: [227] and [Blender] Bulletproof BSP tutorial

Post Posted: 16 May 2023, 22:02

Hey Kajgue! This is BLOODY BRILLIANT!!! Thank you for making this great tutorial, I already learned a lot from you but this comprehensive, all-in-one package is nothing short of fantastic and will definitely help me get back into it! \o/ :tup:
Nali: Magic or Telekinesis
Waffnuffly wrote:It's tarydium-doped smoothies. Drunk by the player, I mean. The player is tripping balls. The whole game actually takes place in a large city and the player thinks he's on an alien world.

User avatar Kajgue
N-Team Leader N-Team Leader
Posts: 288
Joined: 12 Nov 2007, 18:07
Location: London, UK
Contact:

Subject: Re: [227] and [Blender] Bulletproof BSP tutorial

Post Posted: 29 May 2023, 18:44

Sat42 wrote:Hey Kajgue! This is BLOODY BRILLIANT!!! Thank you for making this great tutorial, I already learned a lot from you but this comprehensive, all-in-one package is nothing short of fantastic and will definitely help me get back into it! \o/ :tup:


:tup: :D
N-Team leader
The Silver Blades clan chief
Image


Who is online

Users browsing this forum: No registered users and 4 guests

Copyright © 2001-2024 UnrealSP.org

Powered by phpBB® Forum Software © phpBB Limited