Skip to content

Commit

Permalink
ver 1.6.7
Browse files Browse the repository at this point in the history
  • Loading branch information
shun126 committed Sep 18, 2024
1 parent 6288deb commit 37ed829
Show file tree
Hide file tree
Showing 41 changed files with 1,804 additions and 840 deletions.
22 changes: 19 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,26 @@
# Change Log - Procedural 3D Dungeon Generator Plug-in

## Unreleased-1.6.* (36)
## Unreleased-1.6.* (37)
### Changes
### 変更点

## Unreleased-1.6.6 (35)
## 20240915-1.6.7 (36)
### Changes
* Added support for indoor staircase generation
* Added sublevels that prioritize generation
* Improved passageway generation
* Improved room separation method
* Fixed a bug that caused MissionGraph to generate levels that could not be cleared
* Fixed several bugs
### 変更点
* 室内の階段生成に対応
* 生成を優先するサブレベルを追加
* 通路生成の改善
* 部屋の分離方法の改善
* MissionGraphがクリアできないレベルを生成する不具合を修正
* いくつかの不具合を修正

## 20240901-1.6.6 (35)
### Changes
* Added candidate number of levels
* Added automatic generation of Foliage
Expand All @@ -20,7 +36,7 @@
* 大規模なリファクタリングを実施
* いくつかの不具合を修正

## Unreleased-1.6.5 (34)
## 20240812-1.6.5 (34)
### Changes
* Fixed layer calculation for TransformWorldToRadarWithLayer
* Some refactoring
Expand Down
4 changes: 2 additions & 2 deletions DungeonGenerator.uplugin
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"FileVersion": 3,
"Version": 35,
"VersionName": "1.6.6",
"Version": 36,
"VersionName": "1.6.7",
"FriendlyName": "Procedural 3D Dungeon Generator",
"Description": "Procedural 3D dungeon generator plugin. Easy generation of levels, mini-maps and missions.",
"Category": "Procedural",
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ The [Unreal Engine marketplace](https://www.unrealengine.com/marketplace/slug/36
* Sub-levels can be applied as dungeon rooms
* A mini-map of the dungeon can be generated.
* Interior decoration. [beta version]
* Foriage decoration. [beta version]

# 👾 Demo
[DungeonGenerator Demo](https://github.com/shun126/UE5-DungeonGeneratorDemo) is a BluePrint sample project for first-person exploration.
Expand Down
4 changes: 2 additions & 2 deletions Source/DungeonGenerator/DungeonGenerator.Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ public DungeonGenerator(ReadOnlyTargetRules Target) : base(Target)
"Engine",
"NavigationSystem",
"NetCore",
"JsonUtilities",
"SlateCore",
"UMG",
"Foliage"
Expand All @@ -45,7 +44,8 @@ public DungeonGenerator(ReadOnlyTargetRules Target) : base(Target)
{
PrivateDependencyModuleNames.AddRange(
new string[] {
"UnrealEd"
"UnrealEd",
"JsonUtilities",
});
}

Expand Down
3 changes: 0 additions & 3 deletions Source/DungeonGenerator/Private/Core/Debug/Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ All Rights Reserved.
// 定義すると通信のためのデバッグ情報を出力します
//#define DEBUG_ENABLE_INFORMATION_FOR_REPLICATION

// 定義すると生成失敗しても生成を継続します
#define DEBUG_FORCED_GENERATION_CONTINUES

// 定義すると生成時間を計測します
#define DEBUG_ENABLE_MEASURE_GENERATION_TIME

Expand Down
28 changes: 28 additions & 0 deletions Source/DungeonGenerator/Private/Core/Debug/Debug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,34 @@ namespace dungeon
mRgbImage.get()[y * mWidth + x] = color;
}

void Canvas::HorizontalLine(int32_t startX, int32_t endX, int32_t y, const RGBCOLOR color) const noexcept
{
startX = std::max(0, std::min(startX, static_cast<int32_t>(mWidth - 1)));
endX = std::max(0, std::min(endX, static_cast<int32_t>(mWidth - 1)));
y = std::max(0, std::min(y, static_cast<int32_t>(mHeight - 1)));
if (startX > endX)
std::swap(startX, endX);

for (int32_t x = startX; x <= endX; ++x)
{
mRgbImage.get()[y * mWidth + x] = color;
}
}

void Canvas::VerticalLine(int32_t x, int32_t startY, int32_t endY, const RGBCOLOR color) const noexcept
{
x = std::max(0, std::min(x, static_cast<int32_t>(mWidth - 1)));
startY = std::max(0, std::min(startY, static_cast<int32_t>(mHeight - 1)));
endY = std::max(0, std::min(endY, static_cast<int32_t>(mHeight - 1)));
if (startY > endY)
std::swap(startY, endY);

for (int32_t y = startY; y <= endY; ++y)
{
mRgbImage.get()[y * mWidth + x] = color;
}
}

void Canvas::Rectangle(int32_t left, int32_t top, int32_t right, int32_t bottom, const RGBCOLOR color) const noexcept
{
left = std::max(0, std::min(left, static_cast<int32_t>(mWidth - 1)));
Expand Down
27 changes: 27 additions & 0 deletions Source/DungeonGenerator/Private/Core/Debug/Debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,12 @@ namespace dungeon
//! Draw point
void Put(int32_t x, int32_t y, const RGBCOLOR color) const noexcept;

//! Draw line
void HorizontalLine(int32_t startX, int32_t endX, int32_t y, const RGBCOLOR color) const noexcept;

//! Draw line
void VerticalLine(int32_t x, int32_t startY, int32_t endY, const RGBCOLOR color) const noexcept;

//! Draw rectangle
void Rectangle(int32_t left, int32_t top, int32_t right, int32_t bottom, const RGBCOLOR color) const noexcept;

Expand All @@ -149,4 +155,25 @@ namespace dungeon
std::unique_ptr<RGBCOLOR[]> mRgbImage;
};
}

static constexpr float ImageScale = 10.0f;
static constexpr bmp::RGBCOLOR BaseDarkColor = { 95, 84, 62 };
static constexpr bmp::RGBCOLOR BaseLightColor = { 173, 153, 112 };
static constexpr bmp::RGBCOLOR StartColor = { 0, 128, 0 };
static constexpr bmp::RGBCOLOR GoalColor = { 0, 0, 128 };
static constexpr bmp::RGBCOLOR LeafColor = { 0, 128, 128 };
static constexpr bmp::RGBCOLOR AisleColor = LeafColor;
static constexpr uint8_t LightGridValue = 96;
static constexpr uint8_t DarkGridValue = 48;
static constexpr bmp::RGBCOLOR LightGridColor = { LightGridValue, LightGridValue, LightGridValue };
static constexpr bmp::RGBCOLOR DarkGridColor = { DarkGridValue, DarkGridValue, DarkGridValue };
static constexpr bmp::RGBCOLOR OriginXColor = { 0, 0, 255 };
static constexpr bmp::RGBCOLOR OriginYColor = { 0, 255, 0 };
static constexpr bmp::RGBCOLOR OriginZColor = { 255, 0, 0 };

inline uint32_t Scale(const uint32_t value)
{
return static_cast<uint32_t>(value * ImageScale);
}

}
22 changes: 15 additions & 7 deletions Source/DungeonGenerator/Private/Core/GenerateParameter.h
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,12 @@ namespace dungeon
void SetAisleComplexity(const uint8_t complexity) noexcept;
bool IsAisleComplexity() const noexcept;

/**
* 部屋の中にスロープを生成する
*/
bool IsGenerateSlopeInRoom() const noexcept;
void SetGenerateSlopeInRoom(const bool generateSlopeInRoom) noexcept;

/*
スタート部屋のサイズ
*/
Expand All @@ -176,7 +182,6 @@ namespace dungeon
void SetGoalRoomSize(const FIntVector& size) noexcept;

private:

/**
ダンジョンの幅
*/
Expand All @@ -192,8 +197,6 @@ namespace dungeon
*/
uint32_t mHeight = 0;



/**
生成する階層の数の候補
最終的に生成される階層の数ではありません。
Expand All @@ -206,7 +209,7 @@ namespace dungeon
*/
uint8_t mNumberOfCandidateRooms = 1;

/*
/**
Horizontal room-to-room coupling
有効にすると部屋と部屋を結合します
Expand All @@ -218,12 +221,17 @@ namespace dungeon
*/
bool mUseMissionGraph = true;

/*
/**
通路の複雑さ(追加する通路の数)
Aisle complexity (0 being the minimum aisle)
*/
uint8_t mAisleComplexity = 0;

/**
* 部屋の中にスロープを生成する
*/
bool mGenerateSlopeInRoom = true;

/**
部屋の最小の幅
*/
Expand Down Expand Up @@ -269,12 +277,12 @@ namespace dungeon
*/
std::shared_ptr<Random> mRandom;

/*
/**
スタート部屋のサイズ
*/
FIntVector mStartRoomSize = { 0, 0, 0 };

/*
/**
ゴール部屋のサイズ
*/
FIntVector mGoalRoomSize = { 0, 0, 0 };
Expand Down
10 changes: 10 additions & 0 deletions Source/DungeonGenerator/Private/Core/GenerateParameter.inl
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,16 @@ namespace dungeon
return mUseMissionGraph == false && mAisleComplexity > 0;
}

inline bool GenerateParameter::IsGenerateSlopeInRoom() const noexcept
{
return mGenerateSlopeInRoom;
}

inline void GenerateParameter::SetGenerateSlopeInRoom(const bool generateSlopeInRoom) noexcept
{
mGenerateSlopeInRoom = generateSlopeInRoom;
}

inline const FIntVector& GenerateParameter::GetStartRoomSize() const noexcept
{
return mStartRoomSize;
Expand Down
Loading

0 comments on commit 37ed829

Please sign in to comment.