Level 3, bug fixes

This commit is contained in:
Oleg Petruny 2024-09-26 15:15:45 +02:00
parent 33ea9807d6
commit 70f24eab32
33 changed files with 113 additions and 40 deletions

View File

@ -54,7 +54,7 @@ r.DefaultFeature.AutoExposure=False
r.AntiAliasingMethod=3
r.Mobile.AntiAliasing=3
r.ForwardShading=True
r.DefaultFeature.LightUnits=3
r.DefaultFeature.LightUnits=2
r.MSAACount=4
r.DefaultFeature.LensFlare=False
r.ReflectionCaptureResolution=128
@ -72,6 +72,10 @@ r.DefaultFeature.AmbientOcclusionStaticFraction=True
r.DefaultFeature.AmbientOcclusion=True
r.AllowOcclusionQueries=True
vr.RoundRobinOcclusion=False
r.DefaultFeature.AutoExposure.Method=2
r.DefaultFeature.AutoExposure.Bias=0.100000
r.Substrate=False
r.CustomDepthTemporalAAJitter=False
[/Script/WorldPartitionEditor.WorldPartitionEditorSettings]
CommandletClass=Class'/Script/UnrealEd.WorldPartitionConvertCommandlet'

BIN
Content/Blueprints/Items/BP_CompanionCube.uasset (Stored with Git LFS) Normal file

Binary file not shown.

BIN
Content/Blueprints/Items/BP_PictureMalevic.uasset (Stored with Git LFS) Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
Content/Levels/Level_3/L_Level3.umap (Stored with Git LFS) Normal file

Binary file not shown.

BIN
Content/Levels/Level_3/L_Level3_BuiltData.uasset (Stored with Git LFS) Normal file

Binary file not shown.

Binary file not shown.

BIN
Content/Levels/Test/L_Test.umap (Stored with Git LFS)

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -284,5 +284,5 @@ void UInteractableScreenCapturer::Process()
running = false;
}
);
}
}
}
}

View File

@ -81,6 +81,17 @@ void AInteractable::BeginPlay()
player = Cast<APlayerBase>(PC->GetPawn());
}
void AInteractable::EndPlay(const EEndPlayReason::Type EndPlayReason)
{
if(activated)
{
activationLockers.Empty();
_Deactivate(static_cast<EActivatorType>(activated));
}
Super::EndPlay(EndPlayReason);
}
void AInteractable::_Activate(EActivatorType type)
{
#ifdef INTERACTABLE_DEBUG

View File

@ -49,10 +49,12 @@ public:
protected:
virtual void BeginPlay() override;
virtual void EndPlay(const EEndPlayReason::Type EndPlayReason) override;
UPROPERTY(EditAnywhere, BlueprintReadWrite, meta = (Bitmask, BitmaskEnum = "EActivatorType"))
int32 activated = 0;
UPROPERTY()
TMap<EActivatorType, class UInteractableModificator*> modificators;
class APlayerBase* player = nullptr;

View File

@ -3,8 +3,11 @@
#include "LevelBase.h"
#include "Engine/StaticMesh.h"
#include "Engine/StaticMeshActor.h"
#include "EngineUtils.h"
#include "InputMappingContext.h"
#include "Kismet/GameplayStatics.h"
#include "LevelSequencePlayer.h"
#include "CommonFunctions.h"
@ -36,6 +39,19 @@ void ALevelBase::BeginPlay()
BroadcastNewLevelBeginPlay();
StartLevelAnimations();
ApplySaveData();
// workaround for forward shading renderer skipping meshes without custom depth,
// so custom objects are visible through obstacles
TArray<AActor*> actors;
UGameplayStatics::GetAllActorsOfClass(GetWorld(), AStaticMeshActor::StaticClass(), actors);
for(auto actor : actors)
{
if(!actor)
continue;
auto mesh = reinterpret_cast<AStaticMeshActor*>(actor)->GetStaticMeshComponent();
if(!mesh->bRenderCustomDepth)
mesh->SetRenderCustomDepth(true);
}
}
void ALevelBase::IterateToState(int32 to)

View File

@ -16,20 +16,20 @@
#include "QuickTimeEvent.h"
#include "Widgets/WidgetsManager.h"
AMainGameModeBase* AMainGameModeBase::_instance = nullptr;
TStrongObjectPtr<UWidgetsManager> AMainGameModeBase::_widgetsManager = nullptr;
TStrongObjectPtr<UCutsceneManager> AMainGameModeBase::_cutsceneManager = nullptr;
TStrongObjectPtr<UQuickTimeEventManager> AMainGameModeBase::_quickTimeEventManager = nullptr;
TStrongObjectPtr<UDialogueManager> AMainGameModeBase::_dialogueManager = nullptr;
TStrongObjectPtr<UQuestManager> AMainGameModeBase::_questManager = nullptr;
TStrongObjectPtr<ALevelBase> AMainGameModeBase::leadLevel = nullptr;
void AMainGameModeBase::StartPlay()
{
_instance = this;
_widgetsManager = TStrongObjectPtr<UWidgetsManager>{ NewObject<UWidgetsManager>(this, widgetManagerClass) };
_cutsceneManager = TStrongObjectPtr<UCutsceneManager>{ NewObject<UCutsceneManager>(this) };
_quickTimeEventManager = TStrongObjectPtr<UQuickTimeEventManager>{ NewObject<UQuickTimeEventManager>(this) };
_dialogueManager = TStrongObjectPtr<UDialogueManager>{ NewObject<UDialogueManager>(this) };
_questManager = TStrongObjectPtr<UQuestManager>{ NewObject<UQuestManager>(this) };
AGameModeBase::StartPlay();
@ -90,6 +90,12 @@ void AMainGameModeBase::CallLevelEvent(int32 id)
leadLevel->CallEvent(id);
}
void AMainGameModeBase::UpdateQuests(TArray<FText> items)
{
if(_instance && _instance->questsUpdateDelegate.IsBound())
_instance->questsUpdateDelegate.Broadcast(items);
}
void AMainGameModeBase::SwitchCameraMode()
{
static TWeakObjectPtr<APawn> _playerPawn = nullptr;

View File

@ -32,6 +32,9 @@ public:
UFUNCTION(BlueprintCallable)
static void CallLevelEvent(int32 id);
UFUNCTION(BlueprintCallable)
static void UpdateQuests(TArray<FText> items);
void SwitchCameraMode();
static TStrongObjectPtr<class ALevelBase> leadLevel;
@ -43,9 +46,9 @@ protected:
TSubclassOf<class UWidgetsManager> widgetManagerClass;
private:
static AMainGameModeBase* _instance;
static TStrongObjectPtr<class UWidgetsManager> _widgetsManager;
static TStrongObjectPtr<class UCutsceneManager> _cutsceneManager;
static TStrongObjectPtr<class UQuickTimeEventManager> _quickTimeEventManager;
static TStrongObjectPtr<class UDialogueManager> _dialogueManager;
static TStrongObjectPtr<class UQuestManager> _questManager;
};

View File

@ -70,7 +70,7 @@ void ACrossyRoadManager::End()
PrimaryActorTick.SetTickFunctionEnable(false);
for(int32 handler : inputHandlers)
player->inputComponent->RemoveActionBindingForHandle(handler);
player->inputComponent->RemoveBindingByHandle(handler);
player->UnlockPlayer(FPlayerLock::All());
player->ReturnPlayerView();
@ -196,9 +196,6 @@ void ACrossyRoadManager::RotateLine(USplineComponent* line)
void ACrossyRoadManager::Up()
{
if(ended)
return;
auto line = lines[0];
auto diffY = lines[0]->GetComponentLocation().Y - lines[1]->GetComponentLocation().Y;
for(int32 i = 1; i < lines.Num(); ++i)
@ -222,7 +219,7 @@ void ACrossyRoadManager::Down()
void ACrossyRoadManager::Left()
{
if(ended || playerLineTime >= 1.0f)
if(playerLineTime >= 1.0f)
return;
playerLineTime += 0.1f;
@ -237,7 +234,7 @@ void ACrossyRoadManager::Left()
void ACrossyRoadManager::Right()
{
if(ended || playerLineTime <= 0.0f)
if(playerLineTime <= 0.0f)
return;
playerLineTime -= 0.1f;

View File

@ -66,7 +66,7 @@ void ASubwaySurfManager::End()
PrimaryActorTick.SetTickFunctionEnable(false);
for(int32 handler : inputHandlers)
player->inputComponent->RemoveActionBindingForHandle(handler);
player->inputComponent->RemoveBindingByHandle(handler);
player->UnlockPlayer(FPlayerLock::All());
player->ReturnPlayerView();

View File

@ -274,7 +274,7 @@ void APlayerBase::InteractableActivated(AInteractable* interactable, EActivatorT
if(!interactable)
return;
if(interactionLocked)
if(interactionLocked || interactable->IsHidden())
return;
interactable->_Activate(type);

View File

@ -9,18 +9,18 @@
#include "MainGameModeBase.h"
#include "Widgets/WidgetsManager.h"
UQuestManager::UQuestManager()
void AQuestManager::BeginPlay()
{
if(auto gamemode_base = UGameplayStatics::GetGameMode(GetWorld()))
{
if(auto gamemode = Cast<AMainGameModeBase>(gamemode_base))
{
//gamemode->questsUpdateDelegate.AddDynamic(this, &UQuestManager::Update);
gamemode->questsUpdateDelegate.AddDynamic(this, &AQuestManager::Update);
}
}
}
void UQuestManager::Update(TArray<FText> quests)
void AQuestManager::Update(TArray<FText> quests)
{
if(auto WM = AMainGameModeBase::GetWidgetsManager())
WM->UpdateJournal(quests);

View File

@ -2,19 +2,22 @@
#pragma once
#include "UObject/Object.h"
#include "GameFramework/Actor.h"
#include "QuestManager.generated.h"
UCLASS(BlueprintType)
class UQuestManager : public UObject
UCLASS(Blueprintable, BlueprintType)
class AQuestManager : public AActor
{
GENERATED_BODY()
public:
UQuestManager();
protected:
virtual void BeginPlay() override;
UFUNCTION()
void Update(TArray<FText> quests);
};

View File

@ -17,13 +17,13 @@ void UInteractableHintWidgetManager::Append(const UInteractableModificator* modi
{
FScopeLock Lock(&hintsLock);
if(!IsValid(modificator))
if(!modificator)
{
hints->SetVisibility(ESlateVisibility::Visible);
return;
}
if(hintsMap.Contains(modificator))
if(hintsMap.Contains(modificator) || !modificator->GetMappingContext())
return;
const auto& mappings = modificator->GetMappingContext()->GetMappings();
@ -57,7 +57,7 @@ void UInteractableHintWidgetManager::Remove(const UInteractableModificator* modi
{
FScopeLock Lock(&hintsLock);
if(!IsValid(modificator))
if(!modificator)
{
hints->SetVisibility(ESlateVisibility::Hidden);
return;

View File

@ -255,4 +255,5 @@ void UWidgetsManager::ShowJournal()
void UWidgetsManager::UpdateJournal(TArray<FText> text)
{
journalWidget->Update(text);
ShowJournal();
}