Func_luxe - Import TrenchBroom maps into luxe!

For the past several months, I’ve been working on a module for the luxe engine that lets you create levels and entities in TrenchBroom (alongside the luxe editor). Upon compiling your luxe game, it will turn that map into a prototype object that you can place into your luxe scenes, or update it if it’s changed. This includes not only the geometry, texturing, and collisions in the map, but also your entities and their functionality.

@ruby0x1 did initial porting of the map parsing code based on the excellent plugin, func_godot, and I’ve been fleshing it out, adding features, and getting it ready for prime time ever since.

Want to help test or develop this module? Join the TrenchBroom group! I’ll open things up for collaboration once the first testable version is ready to rock and let the group know!

What’s TrenchBroom?

TrenchBroom is a map editor for Quake-based games. It allows you to quickly sketch out environments and architecture on a 3D grid and then export them out for games like Quake, Quake 2, Half-Life, Heretic 2, and so on. It’s a modern editor dating back to 2016 that has a simple interface, nice workflow, and best of all, can be expanded with custom game configurations including what entities designers have available to them when making levels.

Why Quake maps?

Maybe this sounds like a niche need for a game project. Maybe it is, but what was initially created to support the Quake mapping community is now a really nice level editor (TrenchBroom) that works with a very simple file format (MAP) which makes a great starting place for quickly creating 3D worlds for your games.

This is what the MAP format looks like, changed little since 1996:

// entity 1456
{
"classname" "door_sliding"
"is_open" "0"
"open_position" "0 0 -1.1"
"speed" "8"
"auto_close" "4"
"targetname" "door1"
"usable" "0"
"_tb_group" "3644"
// brush 0
{
( -724 -10 69 ) ( -724 -9 69 ) ( -724 -10 70 ) environment/tex_metal_08 0 0 0 0.25 0.25
( -723 -10 69 ) ( -723 -10 70 ) ( -722 -10 69 ) environment/tex_metal_08 0 0 0 0.25 0.25
( -723 -10 4 ) ( -722 -10 4 ) ( -723 -9 4 ) special/clip 0 -32 0 0.25 0.25
( -721 -7 70 ) ( -721 -6 70 ) ( -720 -7 70 ) environment/tex_metal_08 0 0 0 0.25 0.25
( -721 -9 70 ) ( -720 -9 70 ) ( -721 -9 71 ) environment/tex_metal_08 0 0 0 0.25 0.25
( -721 -7 70 ) ( -721 -7 71 ) ( -721 -6 70 ) special/clip 0 0 0 0.25 0.25
}
// brush 1
{
( -760 -9.75 8 ) ( -760 -8.75 8 ) ( -760 -9.75 9 ) special/clip 0 0 0 0.125 0.125
( -738 -9.75 8 ) ( -738 -9.75 9 ) ( -737 -9.75 8 ) environment/tex_glass_01 0 0 0 0.125 0.125
( -738 -9.75 8 ) ( -737 -9.75 8 ) ( -738 -8.75 8 ) special/clip 0 0 0 0.125 0.125
( -724 -9.25 67 ) ( -724 -8.25 67 ) ( -723 -9.25 67 ) special/clip 0 0 0 0.125 0.125
( -724 -9.25 8.25 ) ( -723 -9.25 8.25 ) ( -724 -9.25 9.25 ) environment/tex_glass_01 0 0 0 0.125 0.125
( -724 -9.25 8.25 ) ( -724 -9.25 9.25 ) ( -724 -8.25 8.25 ) special/clip 0 0 0 0.125 0.125
}
// brush 2
{
( -760 -10 69 ) ( -760 -9 69 ) ( -760 -10 70 ) special/clip 32 0 0 0.25 0.25
( -725 -10 69 ) ( -725 -10 70 ) ( -724 -10 69 ) environment/tex_metal_08 0 0 0 0.25 0.25
( -725 -10 67 ) ( -724 -10 67 ) ( -725 -9 67 ) special/clip 0 0 0 0.25 0.25
( -724 -9 70 ) ( -724 -8 70 ) ( -723 -9 70 ) environment/tex_metal_08 0 0 0 0.25 0.25
( -724 -9 70 ) ( -723 -9 70 ) ( -724 -9 71 ) environment/tex_metal_08 0 0 0 0.25 0.25
( -724 -9 70 ) ( -724 -9 71 ) ( -724 -8 70 ) special/clip 32 0 0 0.25 0.25
}

The workflow favors boxy shapes, and if that’s not ideal for the look you’re going for, your geometry can be exported as OBJs to serve as reference in your 3D modeling package of choice.

Features / Current Status

The module has been shaping up well, and it’s baseline usable already. There’s still a lot of quirks to work on, bugs to fix, and workflow to smooth out before I start opening this up to wider testing. But I should have it there in the next month, including two example projects.

  • :green_circle: Generates geometry and collisions
  • :green_circle: Generates necessary materials automatically
  • :red_circle: Easily add entity definitions specific to your project
  • :yellow_circle: Generates FGD file (list of all entities) and sends it to TrenchBroom
  • :yellow_circle: Generates GameConfig (game info file) and sends it to TrenchBroom
  • :yellow_circle: Translates TrenchBroom entities into functional luxe entities

I’ll post occasional updates on progress leading up to putting this thing out there. :v:

5 Likes