Dungeon Architect

Hey,

I just spent 2 hours trying to do the random transform checking for collisions and repositioning etc, and failed miserably. This is one of those that I will spend days trying to on my own.
Is there any way you can help me please? I’m sure it’s childsplay to you but to me is proving too much. Most of my attempts end up with an editor crash with some horrible infinite loop scenario…

Can anyone take’s example from the video and modify the blueprint to check for collisions with the dungeon walls, other meshes etc and take a screengrab of it please?
I just wanna move on to the exciting stuff and this is making my already limited time feel so wasted!

Thanks!
Daz

Ah, sorry should have told you this earlier. Now that I think of it, the theming engine runs in a separate thread and is not allowed to spawn actors from a non-game thread. So I queue all the spawning commands and finally run them all in the game thread.
So, you cannot check for physics collisions since the previous dungeon objects would not have been spawned by the time you check for collisions

Order of execution:

  • Generate Layout
  • Create mesh & actor spawn commands (with position / rotation), but don’t spawn them
  • After the generation thread ends, go back to the main game thread and run all the commands (to actually spawn the meshes) over multiple frames to avoid lag

As a workaround, would it be too costly to make these objects Movable with physics enabled? If not, you could just spawn them (even if they collide) and when the game starts, the physics engine would would recover the colliding objects over the next few frames
Colliding cubes

Runtime (penetration recovery by the physics engine)

could you expose “empty” marker to themes?

Your way fills entire area, and it does not solve my problem:
For eg when you create corridor you will have 2-3 tiles of floor (ground) then 2 walls, then empty space (or when doing your way you get at best ground level plane).
So when you fill it your way you get flat floor outside dungeon, and what i need is filling up to top of walls level.

So only one way is to expose (and create) markers for empty spaces inside dungeon and around it (in square that is 2-3 cells bigger than dimension of dungeon).

I tried to add second floor to dungeon (with filling up mesh as ground), but it generated stairs, and i could not change theme for second floor. This also forces to have flat dungeon without height variation.

Then there is problem of corners, if i put decoration on walls and corner is 90deg, both walls may have overlapping decorations.
Same problem goes for decorations on floors, it is hard to add any deco bigger than 1 cell, because they will overlap somewhere.

i guess i’ll wait for next build upload or revert to 1.1.0, but with 1.1.1 - getting error message - Plugin ‘DungeonArchitect’ failed to load because module ‘DungeonArchitectRuntime’ could not be found. Please ensure the plugin is properly installed, otherwise consider disabling the plugin for this project.

That is what I had. I found that the problem was the project needs to be converted to C++ prior to adding the Plugins folder. So when you make a new project open up the File window and add C++ Class just name it whatever and save it. Then close the project, add the Plugins, and now it will work.

This will probably be cleaned up in a later build, but right now I’m having trouble packaging any projects with dungeon architect in them; the build always fails with the following chain of errors:

MainFrameActions: Packaging (Windows (64-bit)): UnrealBuildTool: Unreal Projects\ProjectName\Plugins\4.9\DungeonArchitect\Source\DungeonArchitectRuntime\Classes\Dungeon\SceneProviders\SceneProviderCommand.cpp(19) : error C2039: ‘SetFolderPath’ : is not a member of ‘AActor’
MainFrameActions: Packaging (Windows (64-bit)): UnrealBuildTool: C:\Program Files (x86)\Epic Games\4.9\Engine\Source\Runtime\Engine\Classes\GameFramework/Actor.h(58) : see declaration of ‘AActor’
MainFrameActions: Packaging (Windows (64-bit)): UnrealBuildTool: Unreal Projects\ProjectName\Plugins\4.9\DungeonArchitect\Source\DungeonArchitectRuntime\Classes\Dungeon\Builders\DungeonBuilderOrganic.cpp(156) : error C2039: ‘GetLandscapeInfo’ : is not a member of ‘ALandscape’
MainFrameActions: Packaging (Windows (64-bit)): UnrealBuildTool: C:\Program Files (x86)\Epic Games\4.9\Engine\Source\Runtime\Core…/Landscape/Classes/Landscape.h(30) : see declaration of ‘ALandscape’
MainFrameActions: Packaging (Windows (64-bit)): UnrealBuildTool: Unreal Projects\ProjectName\Plugins\4.9\DungeonArchitect\Source\DungeonArchitectRuntime\Classes\Dungeon\Builders\DungeonBuilderOrganic.cpp(163) : error C2039: ‘GetLandscapeExtent’ : is not a member of ‘ULandscapeInfo’
MainFrameActions: Packaging (Windows (64-bit)): UnrealBuildTool: c:\program files (x86)\epic games\4.9\engine\source\runtime\landscape\classes\LandscapeInfo.h(87) : see declaration of ‘ULandscapeInfo’
MainFrameActions: Packaging (Windows (64-bit)): UnrealBuildTool: Unreal Projects\ProjectName\Plugins\4.9\DungeonArchitect\Source\DungeonArchitectRuntime\Classes\Dungeon\Builders\DungeonBuilderOrganic.cpp(170) : error C2065: ‘FLandscapeEditDataInterface’ : undeclared identifier
MainFrameActions: Packaging (Windows (64-bit)): UnrealBuildTool: Unreal Projects\ProjectName\Plugins\4.9\DungeonArchitect\Source\DungeonArchitectRuntime\Classes\Dungeon\Builders\DungeonBuilderOrganic.cpp(170) : error C2146: syntax error : missing ‘;’ before identifier ‘LandscapeEdit’
MainFrameActions: Packaging (Windows (64-bit)): UnrealBuildTool: Unreal Projects\ProjectName\Plugins\4.9\DungeonArchitect\Source\DungeonArchitectRuntime\Classes\Dungeon\Builders\DungeonBuilderOrganic.cpp(170) : error C3861: ‘LandscapeEdit’: identifier not found
MainFrameActions: Packaging (Windows (64-bit)): UnrealBuildTool: Unreal Projects\ProjectName\Plugins\4.9\DungeonArchitect\Source\DungeonArchitectRuntime\Classes\Dungeon\Builders\DungeonBuilderOrganic.cpp(173) : error C2065: ‘LandscapeEdit’ : undeclared identifier
MainFrameActions: Packaging (Windows (64-bit)): UnrealBuildTool: Unreal Projects\ProjectName\Plugins\4.9\DungeonArchitect\Source\DungeonArchitectRuntime\Classes\Dungeon\Builders\DungeonBuilderOrganic.cpp(173) : error C2228: left of ‘.GetHeightDataFast’ must have class/struct/union
MainFrameActions: Packaging (Windows (64-bit)): UnrealBuildTool: type is ‘unknown-type’
MainFrameActions: Packaging (Windows (64-bit)): UnrealBuildTool: Unreal Projects\ProjectName\Plugins\4.9\DungeonArchitect\Source\DungeonArchitectRuntime\Classes\Dungeon\Builders\DungeonBuilderOrganic.cpp(180) : error C2039: ‘GetLandscapeInfo’ : is not a member of ‘ALandscape’
MainFrameActions: Packaging (Windows (64-bit)): UnrealBuildTool: C:\Program Files (x86)\Epic Games\4.9\Engine\Source\Runtime\Core…/Landscape/Classes/Landscape.h(30) : see declaration of ‘ALandscape’
MainFrameActions: Packaging (Windows (64-bit)): UnrealBuildTool: Unreal Projects\ProjectName\Plugins\4.9\DungeonArchitect\Source\DungeonArchitectRuntime\Classes\Dungeon\Builders\DungeonBuilderOrganic.cpp(181) : error C2065: ‘FLandscapeEditDataInterface’ : undeclared identifier
MainFrameActions: Packaging (Windows (64-bit)): UnrealBuildTool: Unreal Projects\ProjectName\Plugins\4.9\DungeonArchitect\Source\DungeonArchitectRuntime\Classes\Dungeon\Builders\DungeonBuilderOrganic.cpp(181) : error C2146: syntax error : missing ‘;’ before identifier ‘LandscapeEdit’
MainFrameActions: Packaging (Windows (64-bit)): UnrealBuildTool: Unreal Projects\ProjectName\Plugins\4.9\DungeonArchitect\Source\DungeonArchitectRuntime\Classes\Dungeon\Builders\DungeonBuilderOrganic.cpp(181) : error C3861: ‘LandscapeEdit’: identifier not found
MainFrameActions: Packaging (Windows (64-bit)): UnrealBuildTool: Unreal Projects\ProjectName\Plugins\4.9\DungeonArchitect\Source\DungeonArchitectRuntime\Classes\Dungeon\Builders\DungeonBuilderOrganic.cpp(182) : error C2065: ‘LandscapeEdit’ : undeclared identifier
MainFrameActions: Packaging (Windows (64-bit)): UnrealBuildTool: Unreal Projects\ProjectName\Plugins\4.9\DungeonArchitect\Source\DungeonArchitectRuntime\Classes\Dungeon\Builders\DungeonBuilderOrganic.cpp(182) : error C2228: left of ‘.SetHeightData’ must have class/struct/union
MainFrameActions: Packaging (Windows (64-bit)): UnrealBuildTool: type is ‘unknown-type’
MainFrameActions: Packaging (Windows (64-bit)): UnrealBuildTool: Unreal Projects\ProjectName\Plugins\4.9\DungeonArchitect\Source\DungeonArchitectRuntime\Classes\Dungeon\Builders\DungeonBuilderOrganic.cpp(183) : error C2065: ‘LandscapeEdit’ : undeclared identifier
MainFrameActions: Packaging (Windows (64-bit)): UnrealBuildTool: Unreal Projects\ProjectName\Plugins\4.9\DungeonArchitect\Source\DungeonArchitectRuntime\Classes\Dungeon\Builders\DungeonBuilderOrganic.cpp(183) : error C2228: left of ‘.Flush’ must have class/struct/union
MainFrameActions: Packaging (Windows (64-bit)): UnrealBuildTool: type is ‘unknown-type’
MainFrameActions: Packaging (Windows (64-bit)): UnrealBuildTool: Unreal Projects\ProjectName\Plugins\4.9\DungeonArchitect\Source\DungeonArchitectRuntime\Classes\Dungeon\Builders\DungeonBuilderOrganic.cpp(186) : error C2065: ‘LandscapeEdit’ : undeclared identifier
MainFrameActions: Packaging (Windows (64-bit)): UnrealBuildTool: Unreal Projects\ProjectName\Plugins\4.9\DungeonArchitect\Source\DungeonArchitectRuntime\Classes\Dungeon\Builders\DungeonBuilderOrganic.cpp(186) : error C2228: left of ‘.GetComponentsInRegion’ must have class/struct/union
MainFrameActions: Packaging (Windows (64-bit)): UnrealBuildTool: type is ‘unknown-type’
MainFrameActions: Packaging (Windows (64-bit)): UnrealBuildTool: -------- End Detailed Actions Stats -----------------------------------------------------------
MainFrameActions: Packaging (Windows (64-bit)): UnrealBuildTool: ERROR: UBT ERROR: Failed to produce item: Unreal Projects\ProjectName\Plugins\4.9\DungeonArchitect\Binaries\Win64\UE4-DungeonArchitectRuntime.lib
MainFrameActions: Packaging (Windows (64-bit)): UnrealBuildTool: Total build time: 110.98 seconds
MainFrameActions: Packaging (Windows (64-bit)): CommandUtils.Run: Run: Took 111.0084658s to run UnrealBuildTool.exe, ExitCode=5
MainFrameActions: Packaging (Windows (64-bit)): BuildCommand.Execute: ERROR: BUILD FAILED

I downloaded this to check it out since the way you built this is far more complex than your other examples. I instantly started having a problem with all of the empty space.

@anonymous_user_f2166112 guys last build was not released properly. I’m working on fixing and will test it thoroughly before the next release. Got it working in Mac and fixed the release build issue reported by @HInoue. The editor specific features need to be within the #WITH_EDITOR macro in C++

@ Ah, I use a plane from the starter content pack for the ground mesh (the one that comes with UE4). Please add the starter content, then add the dungeon asset again to your project

Edit: Updated original post with this extra step

1> Yeah I used this method, but it does result in some of the dynamic crates dropping out of the world (when their proxy is further out of the wall than in for example).
I feel like their needs to be a way of fine-tuning random placed objects a little, within extents built into your (amazing) plugin.
So I’m using RoomOpenSpace and your Random transform function to populate these areas but this can result in crates sticking through walls because the Ground tiles near the walls are still included in the calculation. Could there be a way of defining a radius from this RoomOpenSpace marker or having the option of a hard rule we can flag on that tells it not to spawn anything in Ground Cells that are adjacent or overlapping walls pieces?

2> My second thing is how to connect one dungeon to another? So if I have one dungeon on top of another, how do I connect these up?
Or at the least, Is it possible to define a cell type that is EXIT and possibly ENTRANCE or something and have rules governing these cells (such as spawning distance away from each other etc.).
I basically want to be able to have a start point next to an entrance cell, and then the player will navigate the area as normal, looking for the Exit which we can guarantee if we want (At generation time) that it will be the furthest distance away from the Entrance point as is possible in the currently generated dungeon.

3> I kind of defaulted to using the Design Time editor with the build option, but if I want to do RunTime instead how do I make the player spawn point be in a valid location?

Thx
Daz

@ - thanks! that works!
@ - great work! just when i thought it can’t get any better, and you go and do a infinity blade theme!!! must finish 1 game at a time… resisting making one based off of infinity assets at the moment.

New update available:

Version 1.1.2

  • Fixed issues with game code not building due to editor specific code. Added WITH_EDITOR macro
  • Fixed breaking changes with XCode clang compiler to make it work in mac
  • Includes Win64 and Mac binaries

@

's something I can’t explain.

I’ve been working with the DungeonDesignTime (DDT) mode and been creating my theme and as you can see the result so far works okay - though lots of work still needed:


But despite it looking okay in the main editor window, the Preview window in the theme is all messed up. I kinda ignored this because it looked fine in-game:

However, when I switched to DungeonRuntime and made the settings of Dungeon1 exactly the same as DDT mode and pressed play I got this:


and this in the preview window (this time an accurate representation of what I see in the game window (Except this has stairs too - which I explicitly turn off - check the settings!)

What am I doing wrong? Or is it a bug? Quite a few strange issues there

Cheers,
Daz

Daz, the preview window’s dungeon config still has the default values (grid size 400,400,200). You can sync that to you main window by clicking the Properties button in the preview window in the theme editor and select Dungeon. Then expand the config section in the details window and set the values correctly there. The theme file will remember these settings when you open it the next time.

Let me know if it works out

The plugins requires more documentation and proper video tutorials. I’ll be giving it priority.

In the Realtime demo, I’m resetting the dungeon config in the level blueprint (to give it a random seed to get a new level every time). So you need to set your dungeon config in the Level blueprint because the demo overrides it

@HInoue Fixed the bug you mentioned in #290](Dungeon Architect - Work in Progress - Unreal Engine Forums)

Due to the newer optimizations in the instanced mesh scene provider, a hash is generated and saved for each node in the theme file. So the older theme files had to be re-saved. The theming engine now regenerates the hash if it is not available so it works with older theme files

Edit: Fix will be available in 1.1.3. In the mean time, just re-save your old theme file if you face this issue

thanks, that solved all the problems. Although i had to change some of my blueprinted static meshes to moveable on the RunTime demo for it to stop spamming the game log with errors and causing stuttering. Once I changed this it was exactly the same as the DDT one.

Got two more questions!

1> How do we know where to place and what dimensions to choose for adding a NavMesh?
2> Did you read my earlier questions regarding an ENTRANCE and EXIT type object, and the sprading of props around some kind of radius from the centre rather than everywhere, even near walls (to stop my crates and other objects from clipping through geometry?

Cheers.
LOVE this, you’re an amazing developer :slight_smile:

Daz

, thank you! I can verify that every bug I’ve mentioned in this thread is now fixed, and really quickly too- I seriously appreciate all of the work you’re putting into this product :slight_smile:

In the context of runtime dungeon generation, you don’t have a way of knowing it yet. In post #93](Dungeon Architect - Game Development - Epic Developer Community Forums), I created a nav mesh volume large enough to cover a huge area. There’s a flag you have to set in the engine if you want your nav meshes to generate during runtime (for dungeons generated at runtime). It is mentioned in #93](Dungeon Architect - Game Development - Epic Developer Community Forums)

For entrance / exit, you could use platform volumes like the way I use in the multi-story building demo. However, UE4 doesn’t allow me to spawn volumes during runtime or from blueprints. So its C++ heavy. I’ll look at a workaround. I’m building a simple tower defence game (blueprints only) using infinity blade assets and will be looking at implementing this somehow

As for markers, there is a better way. I’ll expose a Marker Emitter blueprint which you guys can attach to the dungeon actor. This BP gets called and gives you an opportunity to emit your own markers into the scene. So you iterate through all the rooms, get their bounds and scatter your own markers (circular or otherwise) anyway you like on top of the existing stuff. Will post more on this later

Thanks! :smiley:

Thanks! :slight_smile:

You can now emit your own markers into the scene using blueprints.

The dungeon generation pipeline is:
Generate Layout in Memory > Emit Markers > Replace markers with meshes (using theming graph)

Now an extra step is added
Generate Layout in Memory > Emit Markers > Emit custom markers from BP > Replace markers with meshes (using theming graph)

This opens up lots of possibilities for theming as you are no longer bound by what I emit from the builder.

In this example, I created an emitter blueprint that iterates through all rooms and adds markers along a circle. This marker will be encountered by the theming engine so it can be defined in the theme file
watch?v=SbNBVTnSRXY

You can register multiple emitters (e.g. for each effect)

The Marker Emitter Blueprint

The theme file (D_RoomRunes)

Other possibilities are slanted roofs, curved roofs / structures etc, room corner pillars etc. You can place these markers anywhere in the map with any name. I’ll create more samples tomorrow