Skip to content

4_5_generate interiors

Shun Moriya edited this page Sep 27, 2024 · 1 revision

What is InteriaDecorator?

This is an article that is being edited.

The InteriaDecorator system is a beta feature. The basic algorithm is ready, but we would like to reflect designers' opinions on how to have parameters.

HOW TO PROCEDURALLY GENERATE AND DECORATE 3D DUNGEON ROOMS IN UNITY C# as a reference for this system to automatically generate interiors.

This system is a beta version to incorporate the input of designers and artists. Specifications are subject to change without notice. We are seeking advice from designers and artists. Please fill in the discussion.

About DungeonInteriorDatabase

The DungeonInteriorDatabase draws DungeonInteriorParts that define the attributes of the actor that will be the interior.

DungeonInteriorDatabase

You can register multiple DungeonInteriorParts as shown in the figure, and spawn actors whose input InqueryInteriorTags matches. If InqueryInteriorTags matches more than one actor, they will be drawn according to the attributes of the parts.

About DungeonInteriorParts

The DungeonInteriorParts defines the attributes of the actor that will be the interior.

Class

Specify the class of the actor to spawn.

InteriorSystemTags and InteriorTags

Set the tag name that symbolizes the actor. If the InteriorTags tag contains all of the InqueryInteriorTags tags, this part will be selected as a candidate for spawning.

If DungeonRoomSensor class InqueryInteriorTags is set to kitchen, the actor with the kitchen tag will be spawned, Then, if cup is set to InteriorTags in the DungeonInteriorLocationComponent, the part with the tag cup will be spawned at the DungeonInteriorLocationComponent position . This iteration will generate the appropriate decor for the kitchen in the room.

List of tags reserved by the decorating system

InteriorSystemTags are the InteriorTags set by the DungeonInteriorDecorator system. The following tags are reserved.

  • Priority : major.
  • Room Type : aisle, slope, hall, hanare, start, goal.
  • Location : center, wall.

If major is enabled, it will be preferentially selected as a spawn target. centeris for placement near the center of the room,wall` is for placement along a wall.

Additional Extent to prohibit placement

If there are other actors in the mesh range of the generated actor, they will not spawn. This parameter adds an additional extent to the mesh range that prohibits placement.

After placement, an overlap check is performed and if there is an overlap, the actor is discarded.

OverlapCheck.

If this parameter is enabled, the actor will not spawn if its mesh overlaps with any other actor.

Frequency

This parameter allows you to specify the frequency of spawning, from 1% to 100%. After a query containing InteriorTags, a lottery is drawn to see if spawning is possible.

PercentageOfErrorInPlacement

The error of the position of the actor to be spawned. It is specified as a percentage of the position from the center of the collision to the edge of the collision. 0% means the center of the collision and 100% means the edge of the collision. This parameter does not affect the height, so the spawning height is at the center of the collision.

DungeonAngleTypeOfPlacement

The type of rotation of the actor during placement. Choose between no rotation (None), rotation every 180 degrees (Every180Degrees), rotation every 90 degrees (Every90Degrees), or free rotation (Free).

About DuneOnInteriorLocationComponent

If the interior actor to spawn has a DuneonInteriorLocationComponent, the DungeonInteriorDecorator system will recursively try to spawn the actor at the DuneonInteriorLocationComponent location. The DungeonInteriorDecorator system will recursively attempt to spawn the actor at the DungeonInteriorLocationComponent.

InqueryInteriorTags.

Set the tags of the actor you want to spawn at the DuneonInteriorLocationComponent location. Actors with all matching tags in InqueryInteriorTags will be drawn from the DungeonInteriorDatabase.

For example, if you have an old-fashioned cup on a table, setting cup and antique to the InqueryInteriorTags of the table actor's DungeonInteriorLocationComponent will draw from the Actors with cup and antique registered in the DungeonInteriorDatabase will be selected as spawn targets.

Example of a candle on a table.

DungeonInteriorLocationComponent

Example of an enemy standing next to a table !

DungeonInteriorLocationComponent

Vegetation Parts

Meshes

Specify the StaticMesh to be generated

Density

Specify density per square meter

CollisionChannel

Specifies the collision channel to detect terrain. Normally, it is checked for collisions with other collisions as Pawn. Change as needed.

AlignToNormal

Whether foliage instances should have their angle adjusted away from vertical to match the normal of the surface they're painted on If AlignToNormal is enabled and RandomYaw is disabled, the instance will be rotated so that the +X axis points down-slope

RandomYaw

If selected, foliage instances will have a random rotation around their vertical axis applied

GroundSlopeAngle

Foliage instances will only be placed on surfaces sloping in the specified angle range from the horizontal

CullDistance

The distance where instances will begin to fade out if using a PerInstanceFadeAmount material node. 0 disables. When the entire cluster is beyond this distance, the cluster is completely culled and not rendered at all.

Clone this wiki locally