[RELEASED] Realtime CSG - level design for Unity

Realtime CSG is a level design tool for Unity that allows you to design levels in Unity using boolean operations / CSG;

It uses an unique algorithm that makes it possible to perform these boolean operations in real-time! Even while having thousands of brushes in the scene.

If you’d like to know more, just visit the Real-time CSG site here!

Some key features:


You can create your own prefabs that you can then drag & drop in the scene. While dragging your prefabs the scene will update in real-time and your prefabs will align to the surface beneath your mouse. All while aligning to the grid of course!


You can create your brushes, the building blocks with which you build your level, by just drawing and extrude the shape you just drew!


You can do this on any surface, not just the grid plane


Curved edges can be used to created curved surfaces


You can also quickly create standard shapes such as cubes, cylinders and stairs


Brushes can also be edited by moving vertices, edges or rotating and scaling polygons.
It’s also possible to chamfer vertices or edges


As for texture tools, there are plenty of things to help you there.
For example, you can easily drag your mouse over multiple surfaces and the
material will follow your mouse over all these surfaces .

Keep in mind the project is still quite young, so more and more will be added over time! This is just the beginning. If you have a need for certain features, let me know!

7 Likes

Thanks for this man looks like a lot of hard work went in to this, cant wait to check it out.

1 Like

Please let me know what you think when you do! :slight_smile:

What sets this apart from SabreCSG? Just that it is realtime?

Are there any plans to have Realtime CSG work at run-time so that players could create levels with an in-game level editor?

1 Like

Hi FuRy & PartyBoat!
Off the top of my head, some other differences besides the real-time feedback (which is a pretty big usability improvement IMHO) is that realtime-CSG:

  • has Intersection operations besides just Additive and Subtractive operations
  • has full hierarchical CSG (meaning that you can define sub-shapes that you can subtract, add and intersect with)
  • has the ability to work on a rotated grid that can be resized differently for X, Y and Z
  • works with drag & drop

As for plans to make it work in Runtime, yes there are plans for that but it’ll take some time before that’s ready

Can you explain what ‘realtime’ means in this sense? Despite being in the title of the asset I’m not sure I understand.
For example in SabreCSG, when you switch on ‘auto-rebuild’, geometry rebuilds right as you modify a brush. Does ‘realtime’ mean that it rebuilds faster or are there other benefits?
Anyways, nice to see a new player has entered the field. So far it’s looking very promising.

Hi 2dgame, SabreCSG auto-rebuild basically rebuilds the entire model every time you move a brush in it.
This will be responsive as long as you don’t have too many brushes, but at some point this will break down.
I’m not sure how many brushes, could be tens or a couple of hundred. I know Unreal, for instance, will become unusably slow way before you even reach a hundred brushes.

Realtime CSG works differently under the hood and it’s responsiveness won’t change much when adding more brushes (well at some point Unity itself will start to choke on the number of objects in the scene, but I can’t do much about that!)

I’ve imported brushes from half-life black mesa levels containing thousands of brushes and realtime CSG remained real-time. So essentially, realtime CSG is more scalable when it comes to it’s performance.

Thanks for clarifying!
About that half-life thing. That was pretty impressive.

How did you do that? Is the plugin capable of loading bsp/map files, so we can do this ourselves?

1 Like

Thanks :slight_smile:
I wrote that half life importer for testing purposes, it’s a bit hacky though
I’m considering cleaning it up a bit and releasing it on the side on github (open source)
The importer imported .map files

1 Like

This is really cool - reminds me of using unreal editor and udk.
Can imported meshes be used as brushes? I think yes - but it wasn’t explicitly explained above and I didn’t see an example of it in the videos.

Awesome work!

Hi!
I’m afraid that you can’t import meshes to use them as brushes, sorry.
What exactly did you have in mind?

That’s incorrect, SabreCSG’s Auto Rebuild feature only rebuilds brushes that it needs to. As you edit changes are tracked and the build engine selectively builds the brushes that have changed, ignoring unchanged brushes. Here’s a video of editing in realtime on a scene of 2500 brushes with SabreCSG:

https://www.youtube.com/watch?v=gOeuMaeIhBY

1 Like

o

Ok, my mistake, I guess that’s something both tools are similar in. I thought SabreCSG used BSP, my mistake.

Similar functionality as I remember unreal ed (2004) and possibly udk used to have.
I might be assuming a bit too much from past experience also. As I remember in udk most everything was considered a brush - that could be used to boolean combine or out of other volumes. So if I wanted to remove a complex tunnel/dungeon shape - I could roughly model the shape in 3D and import it in to remove the space from a volume.

That is probably a bad example and backwards thinking for designing a dungeon. I might give your tool a look soon and see how it works.

Can you briefly explain brushes?

Brushes are simple primitives that are completely convex … which basically means that they can’t have any inward angles.
So a cube is convex, a sphere is convex, a cylinder is convex … an L shape is not
Note that the draw tool allows you to draw non-convex shapes and extrude them, but it simply subdivides the non-convex shapes into multiple convex ones…

1 Like

Version 1.100 is now available on the beta download site and has the ability to go back forth between an exported FBX and the original CSG model!

While we’re on the topic of exporting I’d like to start a conversation about a workflow I was thinking of since I started using SabreCSG, but equally applies here. This is a bit of a long shot, but how I see it the ideal workflow would be this:
You block out a level in Realtime CSG. At some point you export the mesh to work on some finer details in Blender for example (maybe even ProBuilder), maybe bevel some edges etc. Now, what if at this point you could still continue work on the brushes in Realtime CSG. I wouldn’t mind if brushes that got tinkered with aren’t modifyable anymore. Do you think this doable somehow? I think it would greatly improve the utility of the plugin.

You mentioned you had this map file importer for Realtime CSG. Not sure if this is of help but I did read that earlier versions of Blender had quake map file exporting capabilities. If you google it you find a couple of posts. Here’s one:Make *.map Based Levels In Blender 2.49 – KatsBits.com (legacy)
Here you apparently can still download the plugin for Blender (didn’t try it): Quake (Game) Map Exporter for Blender 3D download | SourceForge.net
Could this be a start for a common ground between Realtime CSG and Blender? Any thoughts for another way to have a two-way workflow?

Hi!

The problem here is that it’s almost impossible to identify what pieces of the geometry are part of the original brushes because a lot of geometry has been destroyed at that point …
It should, in theory at least, however be possible to split the blender created mesh into multiple brushes though … but this is a slow operation that gets exponentially slower the more complicated a mesh is… having multiple materials greatly complicates this…

I was actually thinking about adding map import capability to realtime-CSG … but this would only work if it’s actually a .map file, importing a .bsp file would be more complicated to convert into brushes (I’m not sure if the second link exports a map)

So, I tried out that .map export addon for Blender I linked. Couldn’t open the resulting file in the trenchbroom map editor. I guess it doesn’t work. (I’m sure you do, but just in case you don’t know the trenchbroom editor, it’s an open source map editor for .map files. Might be a good resource for your importing code if you still want to do that).