Dungeon Architect

Thanks! I will play around with it see if the GetRandomCellLocation function is sufficient, if not maybe you can expose a few more things to blueprint.

One more question - when I run the runtime sample project I get a compile error originating from Rules/PillarCornerSelector, because the ‘Model’ input on ‘Is Pillar On Corner’ is not connected. Connecting the ‘Model’ output of ‘Select Node’ to this seems to make the error go away, but I thought I would report it!

I been thinking of having Dungeon Architect also support more organic dungeons (e.g. caves) and realized that with some tweaks to the existing builder, it can be done to generate something like this:


Since it goes through the same pipeline, all the tooling (volumes, paint tool etc) will work seamlessly

The colorful grid based shot is from my C# prototype which I built before starting Dungeon Architect.
The Red squares are the rooms, red lines are the delaunay triangulation of the rooms, and the green lines is the minimum spanning tree of the triangulation (with some loop tolerance), which defines how the rooms are connected

The organic layout you see above is mostly in photoshop, but those actions can be performed in code.

's how I plan to go about it:

#1 The dungeon builder builds this kind of layout, if the Grid Builder is selected
http://i.imgur.com/ptEpR13m.png

#2 If the organic builder is selected, it would produce the exact same layout, except the rooms would be connected through a straight line (instead of being constrained to the XY axis)
It would also rasterize the layout in a 2D float array (to emulate the photoshop filters I’ve applied in the next steps) with cells as ellipses and corridors as thick lines
http://i.imgur.com/CUAUBXfm.png

#3 Apply a blur filter on the rasterized data grid
http://i.imgur.com/Wv2zJ3sm.jpg
[Photoshopped]

#4 Apply difference Clouds (Perlin noise applied on top of the existing data)
http://i.imgur.com/SyASzKPm.jpg
[Photoshopped]

#5 Adjust Levels (Add a multiplier and throw out data outside a certain range)
http://i.imgur.com/zkZ446Tm.jpg
[Photoshopped]

#6 Run this data through a marching square algorithm to create a polyline

#7 Add Wall markers through out this polyline, so you can define how your cave walls look in your theme definition file

#8 Triangulate the polyline using constrained delaunay triangulation to create the ground mesh (since I’m not sure if it will be a good idea to have ground markers)

http://i.imgur.com/OayjUTz.gif

Thanks @mattmillus, I’ll fix it

Is there anyway you could add a feature to make a underground cave or dungeon of sorts and make it so it goes up to make a entrance? Like a mine/cave/dungeon would you know so you could go below the map in a cave/mine/dungeon its just something i thought of xD like control the angle the dungeon is created at etc.

Wow that organic cave looks great, excited about that as well!

After using the system for a number of hours there are two more things I want to report or inquire about:

  1. I created a super simple theme (starter content ‘Shape_Plane’ scaled 4x for floor and ‘Shape_Cube’ scaled for wall/fence/half-wall). In each case the mesh node has a material override set to give it a proper material. This always works fine in the preview window inside your theme editor. However, when I actually generate the dungeon (realtime via button or runtime via blueprint) the material overrides only seem to apply if ‘Instanced’ is DISABLED. When its checked, the dungeon generates fine, but nothing has materials. Im not sure if this is a bug or not.

  2. I am struggling a bit with ceiling generation. Everything works fine when I have the entire dungeon on a single level - I simply add a second node to ‘Ground’ for the ceiling (rotated 180 on Y) and turn off ‘Consume on attach’ for the floor node before it. This works great. The problem comes when I want stairs in the dungeon. When you are at the top of a flight of stairs looking towards them, the ceiling above the stairs is the height of the room the stairs are based in - not the room you are standing in. This means you can see through the level in quite an extreme way. It seems one of the following is probably the case
    -I am totally misunderstanding something
    -I should be making the stairs mesh have a built in slanted ceiling (but then how do I have the normal ceiling not spawn there?)
    -I should be setting a special rule that assigns different ground tiles when the cell has stairs in it, so that I can assign a slanted mesh over the stairs (but can this be done via blueprint?)
    -Markers for ‘ceiling’ and ‘stair ceiling’ which are separate from ‘floor’ need adding to the engine before this can be done (in which case hopefully you can add this next release!)

Any guidance you have on this is appreciated!

I suspect this is because they’re being put into a single InstancedStaticMesh, which must use the same material (or materials) on all the instances for it to work.

You can work around this by make a duplicate Shape_Plane for each material you’ll be using.

@ - perhaps you can have it detect material overrides and separate those nodes into different InstancedStaticMesh actors. It may be a good idea to allow limiting how many instances will go into each ISM too, and put extras into a separate ISM, to better help culling etc and mobile performance in the case of tons and tons of instances.

Oh and for my part I’d love to have the starting location thing exposed to BP.

Edit: The organic dungeon looks amazing!

@mattmillus The ISM is not taking into account the material overrides. Its a bug and I’ll fix it. Regarding the empty space seen from an elevated height, you could cover that up with a mesh by adding it to the “Stair” marker. You could place a half wall mesh in the stair marker and move it up.

@frostyshield The dungeon is built relative to the position of the dungeon actor. So you could move the dungeon actor to a different location and rebuild (e.g. below your ground terrain) and have the terrain move down and connect to the door (with a hole near the door). Is that what you were asking for?

Thanks for the info. However I need a way to not spawn a normal “floor” marker based ceiling over the stairs - otherwise I cant walk up or down them unless the cell height is set to at least twice the character height (which makes for dungeons with unrealistically high ceilings). Basically I want a dungeon with a cell size of 400x400x150 (or 300x300x150) that has ceilings and stairs. Any way to do this?

@mattmillus - I think we’re going to need some screenshots to be able to tell exactly what’s going on.

I think I got your point. I’ve added a selector helper function so you can selectively exclude the ceiling mesh if a stair is present in that ground location. I’ve placed the following logic in the ceiling mesh attached to the ground marker


This way it will not include a ceiling mesh where there are stairs

Then on the stair marker, I attach a mesh like this with a offset
http://i.imgur.com/GCl1Iacm.jpg

And it cleanly covers up the ceiling everywhere. (Be sure to adjust the collision of the mesh so it doesn’t block the character)
http://i.imgur.com/aCL8nLam.jpg http://i.imgur.com/dnpHUTzm.jpg

watch?v=OR1bw9ucz0w

I’ll publish a new build soon with this ContainsStair selection function

$99? Easy purchase. Thankyou so much

Hey - Just shot you a PM as I do not want to derail your thread :slight_smile:

@HeadClot Thanks!

Uploaded a new build to my website. Moved the files over to Amazon S3 for faster download

@BTLRoach You’re welcome! :slight_smile:

, I’ve sent a PM as well.

Hello,

We are looking to buy this and implement it with 4.9 and draw a UI to build a runtime editor. Will it support 4.9 out of the box yet?

Hi @Mandinga, 4.9 is supported out of the box

Thanks, that solution looks great!

Hi,
Just a supporting word : this is one is truly a good piece of software, perfectly fitting the quality of the unreal engine.
Very rich and versatile. Nice work.

Thanks FreemanCIT :slight_smile: