Download

Creating a Base building game...Can you spawn CSGs with various properties @ runtime?

I am going to set up a Grid system and modular building system. This seems like CSGs would fit perfectly in simple wall construction. Furthermore, CSGs allow for Subtractive geometry so creating Doors and Windows would be extremely straight forward…That is…if you can build CSGs through code at Runtime.

Please let me know if you guys know anything about this!

Thanks.

It might be worth trying to get in touch with some of the people working on Fortnite, seems like the techniques they’re using are exactly what you’re looking to implement. Also, they mentioned that after the release (or time coming up to the release) some of the crew would be posting blogs about how and why they did certain things, so it might be worth keeping an eye out for that.

Sorry I can’t offer any technical information though.

Thanks for the response regardless :smiley:

Fortnite appears to use a modular system where a “Wall” is built out of 9 model pieces. So removing a piece just removes that model piece and you can place doors or w/e in the holes. I’m not entirely sure though.

I need more information on how CSGs are handled by the editor. If you can spawn/create CSGs and subtractive CSGs in realtime, I have a lot of ideas on how to do my building system.

Ok…from researching UDK, if the same rules apply here, it is not possible to create CSGs during runtime.

Edit: didn’t see your post, but yeah it might be worth looking into custom mesh generation techniques and try to piece together some type of runtime BSP system from the current engine code. From the comments in the FBSPOps class, it looks like some of that code ranges back to 1999, so the performance difference from then to now might have opened up more possibilities.
[hr][/hr]
The FBSPOps class seems to do what you want, but it’s under the Editor and UnrealEd scope so I’m not sure if you’d be able to access it at runtime. Also, there may be certain calculations happening somewhere else to determine intersections between n brushes in order to generate a new mesh, so having those calculations done at runtime may cause performance issues.

If you’re pretty comfortable with C++, look through the source code for that class and see if there’s anything in there that you could use.

Honestly it might be easier to swap static meshes out :stuck_out_tongue:

Would just need a modulated Wall piece model for:
No Doors No Windows
Wall with Door
Wall with Left Window
Wall with Right Window
Wall with Two Windows

Only allow a door OR windows.

OR I can build my wall out of pieces (like Fortnite) which would give me a bit of extra flexibility in what goes on the walls.

Wheres the fun in that?! :smiley:

But yeah the modular static mesh route is probably the easiest route to go down and it’ll let you focus more on the detail of the pieces rather than spend time fixing up any brush complications.

Good luck with the project :slight_smile: