Tutorial: newbspguy editing basics Last edited 1 year ago2023-11-03 17:30:43 UTC

You are viewing an older revision of this wiki page. The current revision may be more detailed and up-to-date. Click here to see the current revision of this page.
This tutorial will show you the basics of using newbspguy to edit already compiled BSP files.

This tutorial uses UnrealKaraulov's fork of wootguy's bspguy due to the many added features, and the decoupling from a strictly Sven Co-op focused workflow of the original.
This tutorial is a work in progress. Feel free to edit and add relevant information that might be missed
  • TODO: Images

Preface

The workflow of editing already-compiled maps is totally different from making a map from scratch.

In the past, it was easier to just decompile a BSP back to .MAP, and start building up from there, because the typical modding workflow assumes you start from a map in an editor. However, there are several drawbacks to this method: However, as of 2023, there now exists tools that let you edit already compiled BSPs directly, namely, bspguy and its fork newbspguy. The original tool was created exactly to port GoldSrc maps over to Sven Co-op, but both tools, especially the latter, can be used just as well to edit maps for any GoldSrc game/mod.

Pros, Cons, and Caveats

The advantages of editing BSPs in place are: The disadvantages are as follows: Do note of these differences for compiled BSPs:

Setting up newbspguy

  1. Extract newbspguy into a folder.
  2. Run the program.
  3. Open File > Settings.
  4. Under General, click Reset All Settings.
  5. Under General > Game directory, set to location of your Half-Life installation.
  6. Under FGDs, add the FGD of your target mod. Please note that [new]bspguy doesn't support JACK's extended FGD.
  7. Under Asset paths, add relative paths in the following format: <mod folder>/. There should be at least these entries:
    • valve/
    • <the target mod>/ (if that isn't valve)
  8. Click "Apply settings". Close the options window.
General settingsGeneral settings FGDsFGDs Asset pathsAsset paths

Editing maps

Provided you've set up the correct FGD and asset path(s), you are now set to edit the maps for your target mod. Here are some tasks that you should be able to master:

Adding point entities

  1. Create > Entity
  2. Right-click on the new entity > Properties
  3. Click on class, and in the dropdown menu, select the target entity.
  4. Edit the entity as you would in Hammer/JACK.
User posted image User posted image User posted image User posted image

Adding and sizing solid entities

  1. Create > BSP Solid Model
  2. Right-click on the new brush entity > Transform
  3. Set Target: Object and 3D Axes: Scale
  4. Grab the edge handle and drag it to the desired size. Repeat for all directions as required.
  5. Reset to 3D Axes: Move. Close Transform window.
  6. Right-click on the new entity > Properties
  7. Click on class, and in the dropdown menu, select the target entity.
  8. Edit the entity as you would in Hammer/JACK.
User posted image User posted image User posted image User posted image User posted image User posted image User posted image User posted image User posted image

Duplicate entities

Simply copy and paste them. Both point and solid entities are supported.

You can also duplicate the BSP model of solid entities. This is only useful if the duplicated entity is in a different lighting condition from the original. You can then apply a different lightmap from the original BSP model. However do note that lightmap editing feature can be unstable. Duplicating a BSP model adds towards the BSP model count, so don't go wild on it.

Editing keyvalues

Editing keyvalues is the same as in Hammer or JACK. These notes might be useful:

[Re]texturing a face

  1. Switch to face editing mode by clicking on the second icon on the top right corner.
  2. Click on a face.
  3. Edit the face's name and shift values.
  4. Switch back to Object selection mode when you're done (first icon on top left).
You cannot make drastic edits to a face's scale since the face's lightmap is intrinsically tied to the texture scale, and large changes will corrupt the lightmaps.
  • Angle edits not tested. It shouldn't be a problem if the "Lock angles" is checked (ie. only rotating the textures instead of skewing them)
User posted image User posted image User posted image

Adding a sign

  1. Create a solid model as shown above. Set the size to match the sign's size in pixels, and set the entity to be func_wall or func_illusionary.
  2. Assign the texture to the front face of the entity.
  3. Shift the texture to fit the face. Oftentimes it'd be easier to scale the model to fit the texture instead, then move it back to the intended position.
  4. Uncheck "Special" flag. The face will turn black, because there is no lightmap data on it.
  5. Select the face of the wall behind the sign. Be sure to pick a face roughly the same size or slightly larger as the sign (preferably the latter) in both dimensions.
  6. Right click > Copy lightmap.
  7. Select the sign face. Right click > Paste lightmap.
User posted image User posted image User posted image User posted image User posted image User posted image

Adding brushes at an angle

You can either start by duplicating existing brush models, or creating a new one for scratch. For the latter, follow the previous method of applying a texture and lightmap to all faces.

Now the issue of turning the solid entity at an angle... The hard way would be to jump into the vertex editing mode and moving the vertices into position, with a lot of math if you want to keep the scale. A simpler way would be to turn the brush into a func_tank and set its angle and origin. it'd face the given direction at spawn. The default spawn flags should be sufficient; obviously don't set it to active.
User posted image

10 Comments

Commented 1 year ago2023-12-11 09:21:49 UTC Comment #105713
Now problems with parsing J.A.C.K fgd files solved.
Worldspawn model vertices can be edited using Face tool, but it not easy, and map crash if do big changes.
Whole map can be exported to .obj with all textures (for example convert part of map to .MDL to bypass BSP limits) but without lightmaps.
Also part of map can be compiled as func_wall and exported to .BSP model with working lightmap and collision to bypass BSP limits.

Also can export .wad from embedded textures. Import textures back to map. Can export files needed for HLRAD.exe for recompile lightmaps. Any bsp solid entity can be exported as .BSP model with working collision and lightmap.

New update has many bugfixes. Please create issue on GitHub if have problems or feature requests
Commented 1 year ago2023-12-11 09:23:04 UTC Comment #105714
And now it support languages using language.ini files.
Commented 1 year ago2023-12-18 21:37:16 UTC Comment #105764
^ Thanks for the plentiful added features! 😁

This tutorial definitely needs a part 2 for the more advanced tasks e.g. vertex manipulation, bsp import/export, lightmap editing.
Commented 11 months ago2023-12-23 09:26:55 UTC Comment #105780
The disadvantages are as follows:
You cannot edit world brushes whatsoever.
You cannot do crazy texture scaling since it's tied to the lightmap size.
You cannot edit clip nodes.
in newbspguy world vertices can be edited via face tool (but without collision changes).
textures can be scaled as need because now lightmap can be recalculated after any changes.
Clipnodes can be edited only for non worldspawn models via Vertex Transformation widget.
Commented 11 months ago2023-12-24 16:42:33 UTC Comment #105783
Great tool! Especially when map sources were lost. I with texture and lightmap editing was easier. E.g. making textures "aligned to face" or scaling to -1. For lightmaps I see there's much planned ahead. Like exporting multiple faces, or adding flood fills. I'm looking forward to see more features in the future! Great work and especially nice to see small, fast and native code!
Commented 11 months ago2023-12-24 22:52:25 UTC Comment #105784
You can select and export multiple faces lightmap, or all lightmaps atlas. For filling flood I can't understand
Commented 11 months ago2023-12-25 16:44:55 UTC Comment #105787
night builds can be unstable, check older versions in releases if one not working.
Commented 11 months ago2024-01-01 07:44:43 UTC Comment #105827
@karaulov
textures can be scaled as need because now lightmap can be recalculated after any changes.
You still need to be careful because the maximum lightmap size for a face is apparently 16x16 luxels. A lot of faces you'll find in maps are already at 16 luxels on either (or both) sides. GoldSrc doesn't support lightmaps larger than that size, and scaling down a texture that results in a face with lightmaps over that size crashes the engine. (IDK if it's supported on svengine). Hence my verdict is don't do it.

As for vertex editing, I just don't recommend it at all too. It's way more cumbersome, and way way harder to get satisfactory result than to get completely broken result. I honestly don't know how a face whose vertices are non-planar would act inside the game. If there's face splitting ability in world faces and easier vertex shifting via handles vs textboxes then it might be feasible, but still not recommended because of the non-planar thing. *

The main takeaway is that just because it's doable with the BSP structure doesn't mean the game engine that's going to parse and run the BSP would like it. If the game engine doesn't like it, don't do it.
I still don't have any draft for a part 2 of this tutorial. 😅
EDIT 1:
* Tested face vertex editing. It messes up lightmaps elsewhere on a map.
Commented 10 months ago2024-01-25 21:06:47 UTC Comment #105928
added bugfixes, now lightmap resize works
aaalso added cull face feature
full VIS editor (but button create new leaf not works because still don't know how to add new leaf, game cant see new leaves)
fps optimization
updated cmd line options
Commented 10 months ago2024-01-26 05:31:51 UTC Comment #105932
And new feature added : map can be scaled in one click. (For example possible make map bigger in 2x size, etc)

You must log in to post a comment. You can login or register a new account.