Skip to content

Commit 01d637f

Browse files
committed
feat(gameplay): working on some upgrades to systems
* Updated exposure settings in config * Added UltraDynamicSky submodule for better lighting and weather system (related to #37) * Updated portal actor to not show all the time, but instead to have a trigger range which scales up the portal when entering, and then scales down and hides the portal when exiting * Added campfire actor which takes the static mesh and particle system that was separate in the level and puts them together. Implements the interactible and highlighting interfaces and allows the user to change the time of day * Created a blockout actor for a small hosue to make blocking out overworld villages easier * Updated lan and tam skeletons to be compatible with each other and rand skeleton * Updated game modes (large/medium/small and base c++) to support saving and loading the time of day using the game instance on begin play / end play so that level transitions can allow the levels to have the same time * Added emonds field map and started testing the modeling (mainly grid) tools plugin * Enabled the modeling tools, uv editing, and SK editing plugins in the project * Updated all the maps to use the UltraDynamicSky for the lighting to make it simpler and more consistent to set up lighting between the levels, and to have really nice nighttime lighting :) * Added portals between overworld and emonds field village * Updated game instance blueprint to override the save/load time of day interface to get the ultra dynamic sky actor for getting / setting time of day.
1 parent 5d0155d commit 01d637f

27 files changed

+107
-0
lines changed

.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,6 @@
2222
[submodule "unreal/Plugins/BlockoutToolsPlugin"]
2323
path = unreal/Plugins/BlockoutToolsPlugin
2424
url = [email protected]:well-known-game-studio/blockouttoolsplugin
25+
[submodule "unreal/Content/UltraDynamicSky"]
26+
path = unreal/Content/UltraDynamicSky
27+
url = [email protected]:well-known-game-studio/ultra-dynamic-sky

unreal/Config/DefaultEditor.ini

+3
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,6 @@ bBlueprintIsNotBlueprintType= true
99

1010
[/Script/AdvancedPreviewScene.SharedProfiles]
1111

12+
[/Script/UnrealEd.EditorPerformanceProjectSettings]
13+
NonRealtimeScreenPercentageMode=BasedOnDisplayResolution
14+

unreal/Config/DefaultEngine.ini

+3
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ r.DynamicGlobalIlluminationMethod=1
2727
r.ReflectionMethod=1
2828
r.Shadow.Virtual.Enable=1
2929
r.CustomDepth=3
30+
r.DefaultFeature.AutoExposure.ExtendDefaultLuminanceRange=True
31+
r.DefaultFeature.AutoExposure=True
32+
r.DefaultFeature.AutoExposure.Method=0
3033

3134
[/Script/Engine.Engine]
3235
+ActiveGameNameRedirects=(OldGameName="TP_ThirdPersonBP",NewGameName="/Script/VoxelRPG")

unreal/Content/UltraDynamicSky

Submodule UltraDynamicSky added at d17b6bb
68.7 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
4.79 KB
Binary file not shown.
65.5 KB
Binary file not shown.
-255 Bytes
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
346 Bytes
Binary file not shown.
92.3 KB
Binary file not shown.
4.14 KB
Binary file not shown.
4.79 KB
Binary file not shown.
95.6 KB
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#include "WotGameInstance.h"
2+
3+
void UWotGameInstance::SaveTimeOfDay_Implementation()
4+
{
5+
// Let the subclasses implement this
6+
}
7+
8+
void UWotGameInstance::LoadTimeOfDay_Implementation()
9+
{
10+
// Let the subclasses implement this
11+
}
12+
13+
bool UWotGameInstance::IsDaytime_Implementation()
14+
{
15+
// Let the subclasses implement this
16+
return false;
17+
}

unreal/Source/VoxelRPG/Private/WotGameModeBase.cpp

+35
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,41 @@ void AWotGameModeBase::StartPlay()
2323
// Continuous timer to spawn more bots. Actual amount of bots and whether it
2424
// is allowed to spawn determined by logic later in the chain...
2525
GetWorldTimerManager().SetTimer(TimerHandle_SpawnBots, this, &AWotGameModeBase::SpawnBotTimerElapsed, SpawnTimerInterval, true, SpawnTimerInitialDelay);
26+
27+
LoadTime();
28+
}
29+
30+
void AWotGameModeBase::EndPlay(const EEndPlayReason::Type EndPlayReason)
31+
{
32+
Super::EndPlay(EndPlayReason);
33+
34+
switch (EndPlayReason) {
35+
case EEndPlayReason::LevelTransition:
36+
SaveTime();
37+
break;
38+
case EEndPlayReason::Destroyed:
39+
case EEndPlayReason::EndPlayInEditor:
40+
case EEndPlayReason::RemovedFromWorld:
41+
case EEndPlayReason::Quit:
42+
default:
43+
break;
44+
}
45+
}
46+
47+
void AWotGameModeBase::SaveTime_Implementation()
48+
{
49+
UWotGameInstance* GameInstance = Cast<UWotGameInstance>(GetGameInstance());
50+
if (GameInstance) {
51+
GameInstance->SaveTimeOfDay();
52+
}
53+
}
54+
55+
void AWotGameModeBase::LoadTime_Implementation()
56+
{
57+
UWotGameInstance* GameInstance = Cast<UWotGameInstance>(GetGameInstance());
58+
if (GameInstance) {
59+
GameInstance->LoadTimeOfDay();
60+
}
2661
}
2762

2863
AActor* AWotGameModeBase::FindPlayerStart_Implementation(AController* Player, const FString& IncomingName)

unreal/Source/VoxelRPG/Public/WotGameInstance.h

+18
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,22 @@ class VOXELRPG_API UWotGameInstance : public UGameInstance
1414
// Store the FName of the last portal the player used
1515
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Portal")
1616
FName LastPortalName;
17+
18+
// Store the Current time of day in seconds
19+
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Time")
20+
float CurrentTimeOfDayInSeconds;
21+
22+
// Sets the current time of day in seconds to be the
23+
// CurrentTimeOfDayInSeconds variable
24+
UFUNCTION(BlueprintCallable, BlueprintNativeEvent, Category = "Time")
25+
void LoadTimeOfDay();
26+
27+
// Gets the time of day in seconds and stores it in the
28+
// CurrentTimeOfDayInSeconds variable
29+
UFUNCTION(BlueprintCallable, BlueprintNativeEvent, Category = "Time")
30+
void SaveTimeOfDay();
31+
32+
// Checks if it is daytime and returns true if it is
33+
UFUNCTION(BlueprintCallable, BlueprintNativeEvent, Category = "Time")
34+
bool IsDaytime();
1735
};

unreal/Source/VoxelRPG/Public/WotGameModeBase.h

+11
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,24 @@ class VOXELRPG_API AWotGameModeBase : public AGameModeBase
2222

2323
virtual void StartPlay() override;
2424

25+
virtual void EndPlay(const EEndPlayReason::Type EndPlayReason) override;
26+
2527
virtual AActor* FindPlayerStart_Implementation(AController* Player, const FString& IncomingName) override;
2628

2729
UFUNCTION(Exec)
2830
void KillAll();
2931

3032
protected:
3133

34+
UFUNCTION(BlueprintImplementableEvent, Category = "Time")
35+
void OnTimeOfDayChanged(float TimeOfDay);
36+
37+
UFUNCTION(BlueprintCallable, BlueprintNativeEvent, Category = "Time")
38+
void SaveTime();
39+
40+
UFUNCTION(BlueprintCallable, BlueprintNativeEvent, Category = "Time")
41+
void LoadTime();
42+
3243
UPROPERTY(EditDefaultsOnly, Category = "AI")
3344
TSubclassOf<AActor> MinionClass;
3445

unreal/VoxelRPG.uproject

+16
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,22 @@
103103
{
104104
"Name": "CommonUI",
105105
"Enabled": true
106+
},
107+
{
108+
"Name": "ModelingToolsEditorMode",
109+
"Enabled": true
110+
},
111+
{
112+
"Name": "SkeletalMeshModelingTools",
113+
"Enabled": true
114+
},
115+
{
116+
"Name": "StaticMeshEditorModeling",
117+
"Enabled": true
118+
},
119+
{
120+
"Name": "SunPosition",
121+
"Enabled": true
106122
}
107123
]
108124
}

0 commit comments

Comments
 (0)