Building caves (and cave collision)

I am trying to tackle the issue of building caves, which are in the simplest form inside-out tubes. I am wondering if there any tested and true best practices for this sort of thing, but mainly there are a few things that I am trying to figure out, namely:

  1. Is it possible (and practical?) to do “vertical modularity”, i.e. having the floor, walls and ceilings be separate pieces which are then stacked on top of each other. I worry that the seams will be too obvious and natural caves would be hard to do with this technique.
  2. Is it more beneficial having a bunch of UCX_ collision objects or just drop all of that and do complex collision? I do not need pixel-perfect collision for cave walls but it’d be great if there wasn’t an invisible wall a meter away from the physical one. This is further complicated by bumps in the structure.

Anyone have any articles / papers on this subject? I sure ain’t the first person who has this problem. :smiley: Thanks in advance!

Best regards,
Damir H.

EDIT: It seems that an efficient way is to make simplified collision geometry and then use THAT for complex collision (i.e. the actual materials for the cave will have their collision turned off.

If complex collision works simple meshes without being too much of a performance hit, then I believe this is the approach we’ll go with.

  1. It is possible. There is some material work that can be done to hide some of this, if you’re using fully dynamic lighting seams won’t be an issue unless you don’t have the material line up. There are some methods to alleviate this type of stuff. Luos has done a lot of cool stuff with his Modular Cave system he is preparing for the marketplace. You can take a look at his stuff here: [WIP] Caves, Rocks and Plant packages - Game Development - Epic Developer Community Forums

I’m not super adept with materials so I don’t have any specific advice at the moment since I’ve not attempted a similar setup myself with modular pieces and getting the blending.

  1. UCX is definitely more beneficial in a case like this. With Complex collision the mesh is using it’s own geometry as collision which can cause issues itself. This can cause an issue where the place capsule can get stuck or cause issues by getting to a place it really shouldn’t. By using simple geometry the capsule can smoothly run against walls that would otherwise not work well with the player capsule for complex collision. If needed I can setup a simple example piece as a demonstration. Just let me know. :slight_smile:

Hey Tim,

Thanks for the response!

I am worried how many UCX meshes I need to use to fully envelop the floor, walls and ceiling and still have decent collision quality.

Using a lot of collision meshes where they are not needed can be an issue, but by making sure you optimize your workflow and test often is the key thing to do. Using as few as possible while still get the fidelity you want is key here. I don’t think it’s a problem to have some extra collision primitives for your meshes if it provides a good result. If you go overboard trying to make every nook and cranny have collision when you could just use a single blocking volume or primitive that could be overkill.

It seems to me that I will have to do some testing to figure out at what point complex collision trumps collision meshes.