From 5cf61121b1f9e8f3daa79cbac5e46f6547b2a8ad Mon Sep 17 00:00:00 2001 From: Dennis Dennis Date: Tue, 17 Sep 2019 00:13:52 -0400 Subject: [PATCH] created initial setup and algo for agg system --- .vscode/c_cpp_properties.json | 21 ++++ Source/NujasAI/NujasAI.Build.cs | 54 +++++++++ .../Private/AggressionScoreComponent.cpp | 106 ++++++++++++++++++ Source/NujasAI/Private/NujasAIModule.cpp | 20 ++++ .../NujasAI/Public/AggressionScoreComponent.h | 96 ++++++++++++++++ Source/NujasAI/Public/NujasAIGlobals.h | 38 +++++++ Source/NujasAI/Public/NujasAIModule.h | 14 +++ Source/NujasDebug/NujasDebug.Build.cs | 54 +++++++++ .../Private/AIStatCollectionActor.cpp | 42 +++++++ .../NujasDebug/Private/NujasDebugModule.cpp | 20 ++++ .../NujasDebug/Public/AIStatCollectionActor.h | 29 +++++ Source/NujasDebug/Public/NujasDebugModule.h | 15 +++ .../Private/BasicUsableObject.cpp | 8 +- .../NujasInventory/Public/BasicUsableObject.h | 8 +- Source/NujasWidget/NujasWidget.Build.cs | 56 +++++++++ Source/NujasWidget/Private/NujasWidget.cpp | 23 ++++ .../NujasWidget/Private/NujasWidgetModule.cpp | 20 ++++ Source/NujasWidget/Public/NujasWidget.h | 23 ++++ Source/NujasWidget/Public/NujasWidgetModule.h | 15 +++ TheJanusFramework.uplugin | 15 +++ 20 files changed, 667 insertions(+), 10 deletions(-) create mode 100644 .vscode/c_cpp_properties.json create mode 100644 Source/NujasAI/NujasAI.Build.cs create mode 100644 Source/NujasAI/Private/AggressionScoreComponent.cpp create mode 100644 Source/NujasAI/Private/NujasAIModule.cpp create mode 100644 Source/NujasAI/Public/AggressionScoreComponent.h create mode 100644 Source/NujasAI/Public/NujasAIGlobals.h create mode 100644 Source/NujasAI/Public/NujasAIModule.h create mode 100644 Source/NujasDebug/NujasDebug.Build.cs create mode 100644 Source/NujasDebug/Private/AIStatCollectionActor.cpp create mode 100644 Source/NujasDebug/Private/NujasDebugModule.cpp create mode 100644 Source/NujasDebug/Public/AIStatCollectionActor.h create mode 100644 Source/NujasDebug/Public/NujasDebugModule.h create mode 100644 Source/NujasWidget/NujasWidget.Build.cs create mode 100644 Source/NujasWidget/Private/NujasWidget.cpp create mode 100644 Source/NujasWidget/Private/NujasWidgetModule.cpp create mode 100644 Source/NujasWidget/Public/NujasWidget.h create mode 100644 Source/NujasWidget/Public/NujasWidgetModule.h diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json new file mode 100644 index 0000000..48dc985 --- /dev/null +++ b/.vscode/c_cpp_properties.json @@ -0,0 +1,21 @@ +{ + "configurations": [ + { + "name": "Win32", + "includePath": [ + "${workspaceFolder}/**" + ], + "defines": [ + "_DEBUG", + "UNICODE", + "_UNICODE" + ], + "windowsSdkVersion": "10.0.18362.0", + "compilerPath": "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.22.27905/bin/Hostx64/x64/cl.exe", + "cStandard": "c11", + "cppStandard": "c++17", + "intelliSenseMode": "msvc-x64" + } + ], + "version": 4 +} \ No newline at end of file diff --git a/Source/NujasAI/NujasAI.Build.cs b/Source/NujasAI/NujasAI.Build.cs new file mode 100644 index 0000000..f3bc32f --- /dev/null +++ b/Source/NujasAI/NujasAI.Build.cs @@ -0,0 +1,54 @@ +// Copyright 2018-2019 The Janus Project | 2034 Complex LLC. All Rights Reserved. + +using UnrealBuildTool; + +public class NujasAI : ModuleRules +{ + public NujasAI(ReadOnlyTargetRules Target) : base(Target) + { + PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs; + + PublicIncludePaths.AddRange( + new string[] { + // ... add public include paths required here ... + } + ); + + + PrivateIncludePaths.AddRange( + new string[] { + // ... add other private include paths required here ... + "NujasAI/Private" + } + ); + + + PublicDependencyModuleNames.AddRange( + new string[] + { + "Core", + // ... add other public dependencies that you statically link with here ... + } + ); + + + PrivateDependencyModuleNames.AddRange( + new string[] + { + "CoreUObject", + "Engine", + "Slate", + "SlateCore", + // ... add private dependencies that you statically link with here ... + } + ); + + + DynamicallyLoadedModuleNames.AddRange( + new string[] + { + // ... add any modules that your module loads dynamically here ... + } + ); + } +} diff --git a/Source/NujasAI/Private/AggressionScoreComponent.cpp b/Source/NujasAI/Private/AggressionScoreComponent.cpp new file mode 100644 index 0000000..87166c8 --- /dev/null +++ b/Source/NujasAI/Private/AggressionScoreComponent.cpp @@ -0,0 +1,106 @@ +// Copyright 2018-2019 The Janus Project | 2034 Complex LLC. All Rights Reserved. + +#include "AggressionScoreComponent.h" +#include "GameFramework/Character.h" +#include "Kismet/GameplayStatics.h" +#include "NujasAIGlobals.h" +#include "TimerManager.h" + +UAggressionScoreComponent::UAggressionScoreComponent() +{ + PrimaryComponentTick.bCanEverTick = false; +} + +void UAggressionScoreComponent::BeginPlay() +{ + Super::BeginPlay(); + Owner = Cast(this->GetOwner()); + InvalidateAggressionScoreTimer(); +} + +void UAggressionScoreComponent::BeginAggressionSystem(const TArray BotsToConsider) +{ + if(Owner) + { + Bots = BotsToConsider; + + Owner->GetWorldTimerManager().SetTimer + ( + AggressionScoreHandle, + this, + &UAggressionScoreComponent::CalculateAggressionScores, + 1.f, + true + ); + } +} + +void UAggressionScoreComponent::StopAggressionSystem() +{ + InvalidateAggressionScoreTimer(); + HeapAggresiveActors.Empty(); + Bots.Empty(); +} + +void UAggressionScoreComponent::AddBot(AActor* const Bot) +{ + Bots.Add(Bot); +} + +void UAggressionScoreComponent::CalculateAggressionScores() +{ + if (Bots.Num() > 0) + { + HeapAggresiveActors.Empty(); + + // do the aggression scoring here + for (AActor* const Bot : Bots) + { + /* + * Removing a specific bot from anywhere in the list is expensive. + * Better to just check if still valid. + * The list doesn't grow larger than 20 items per battle. + */ + if (!Bot) continue; + float Score = IAggressive::Execute_CanBecomeAggressive(Bot) ? 1.0 : 0.0; + Score += IAggressive::Execute_GetAggressionPriority(Bot); + + if (IsPlayerCharacter) + { + // is bot on screen? (Viewport utility) + // angle from camera? + } + + // distance from actor + + HeapAggresiveActors.Add(FAggressiveActorEntry(Bot, Score)); + + } + + // heapify + + // Pop items and make them aggressive until run out of tokens + + // rest should be made calm + } +} + +inline void UAggressionScoreComponent::InvalidateAggressionScoreTimer() +{ + if (Owner) + { + Owner->GetWorldTimerManager().ClearTimer(AggressionScoreHandle); + } +} + +FAggressiveActorEntry::FAggressiveActorEntry() +{ + this->Score = 0; + this->Bot = nullptr; +} + +FAggressiveActorEntry::FAggressiveActorEntry(AActor* Bot, float Score) +{ + this->Bot = Bot; + this->Score = Score; +} diff --git a/Source/NujasAI/Private/NujasAIModule.cpp b/Source/NujasAI/Private/NujasAIModule.cpp new file mode 100644 index 0000000..9843f7b --- /dev/null +++ b/Source/NujasAI/Private/NujasAIModule.cpp @@ -0,0 +1,20 @@ +// Copyright 2018-2019 The Janus Project | 2034 Complex LLC. All Rights Reserved. + +#include "NujasAIModule.h" + +#define LOCTEXT_NAMESPACE "FNujasAIModule" + +void FNujasAIModule::StartupModule() +{ + // This code will execute after your module is loaded into memory; the exact timing is specified in the .uplugin file per-module +} + +void FNujasAIModule::ShutdownModule() +{ + // This function may be called during shutdown to clean up your module. For modules that support dynamic reloading, + // we call this function before unloading the module. +} + +#undef LOCTEXT_NAMESPACE + +IMPLEMENT_MODULE(FNujasAIModule, NujasAI) \ No newline at end of file diff --git a/Source/NujasAI/Public/AggressionScoreComponent.h b/Source/NujasAI/Public/AggressionScoreComponent.h new file mode 100644 index 0000000..4c2053c --- /dev/null +++ b/Source/NujasAI/Public/AggressionScoreComponent.h @@ -0,0 +1,96 @@ +#pragma once + +#include "CoreMinimal.h" +#include "Components/ActorComponent.h" +#include "AggressionScoreComponent.generated.h" + + +class ACharacter; + +USTRUCT() +struct FAggressiveActorEntry +{ + GENERATED_BODY() + + FAggressiveActorEntry(); + FAggressiveActorEntry(AActor* Bot, float Score); + + AActor* Bot; + float Score; +}; + +static const uint32 DEFAULT_AGGRESSION_TOKENS = 14; + +UCLASS(ClassGroup = (NujasAI), meta = (BlueprintSpawnableComponent), HideCategories=(Tags, Cooking, Collision, ComponentReplication, Activation, AssetUserData)) +class NUJASAI_API UAggressionScoreComponent : public UActorComponent +{ + GENERATED_BODY() + + // each enemy with a specific interface should be evaluated periodically (on a timer) by this component + // + // each AI has the opportunity to become aggressive based on parameters listed below + // by default, every AI must not be aggressive + // + // each timer iteration all enemies with the Aggressive Interface must be collected, regardless of whether they are aggressive or not + // every collected actor will be re-evaluated on whether they should remain aggressive or not + // + // every ai has an aggression score count and the count will be evaluated based on there paramters: + // - Primary -> Can I become aggressive? (not in hit reaction or in a state blocking them indefinetely) + // - Secondary -> Aggression Rank based on distance to target + // - Misc -> Action Rank: a) "on/off screen" b) angle "from camera" (needs to be toggled) c) distance from target + // + // once calculated, send it to a max heap of structs that stores the aggression score and the object + // once every enemy is in the heap, pop the actors and force them into aggression until run out of available tokens + // + // every other actor should be immediately set to calm + + // todo: add player current target later when start revamping the targeting mechanic + + void CalculateAggressionScores(); + + inline void InvalidateAggressionScoreTimer(); + + UPROPERTY() + // heapify array to sort bots based on their aggression score + TArray HeapAggresiveActors; + + UPROPERTY() + // the bots that will be considered for calculating the aggression score + TArray Bots; + + UPROPERTY() + FTimerHandle AggressionScoreHandle; + + UPROPERTY() + ACharacter* Owner; + +public: + // Sets default values for this component's properties + UAggressionScoreComponent(); + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Aggression Params", meta = (ClampMin = "0", ClampMax = "100")) + // How many tokens can the aggression system give out for Bots to become aggressive + int32 MaxAggressionTokens = DEFAULT_AGGRESSION_TOKENS; + + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Aggression Params") + // Is this component attached to the player character + bool IsPlayerCharacter = true; + +protected: + // Called when the game starts + virtual void BeginPlay() override; + +public: + UFUNCTION(BlueprintCallable, Category = "Aggression") + void BeginAggressionSystem(const TArray BotsToConsider); + + UFUNCTION(BlueprintCallable, Category = "Aggression") + void StopAggressionSystem(); + + UFUNCTION(BlueprintCallable, Category = "Aggression") + /* + * The system can only add bots. + * When the encounter is over, the system will clean out leftover garbage. + */ + void AddBot(AActor* const Bot); +}; \ No newline at end of file diff --git a/Source/NujasAI/Public/NujasAIGlobals.h b/Source/NujasAI/Public/NujasAIGlobals.h new file mode 100644 index 0000000..941a5de --- /dev/null +++ b/Source/NujasAI/Public/NujasAIGlobals.h @@ -0,0 +1,38 @@ +// Copyright 2018-2019 The Janus Project | 2034 Complex LLC. All Rights Reserved. + +#pragma once + +#include "Interface.h" +#include "NujasAIGlobals.generated.h" + +UINTERFACE(Blueprintable) +class NUJASAI_API UAggressive : public UInterface +{ + GENERATED_BODY() +}; + +class IAggressive +{ + GENERATED_BODY() + +public: + // callback for when the actor turns aggressive + UFUNCTION(BlueprintImplementableEvent, Category = "Aggressive") + bool OnTurAgressive(); + + // callback when the actor is deemed none-aggressive + UFUNCTION(BlueprintImplementableEvent, Category = "Aggressive") + bool OnTurnCalm(); + + // helper func to determine the AI's priority. The priority is usually set manually depending on the AI + UFUNCTION(BlueprintImplementableEvent, Category = "Aggressive") + int32 GetAggressionPriority(); + + // helper func to tell how many tokens does an AI take. + UFUNCTION(BlueprintImplementableEvent, Category = "Aggressive") + int32 GetTokenTax(); + + // helper func to determine if the actor is in a state that would prevent them from becoming aggressive + UFUNCTION(BlueprintImplementableEvent, Category = "Aggressive") + bool CanBecomeAggressive(); +}; \ No newline at end of file diff --git a/Source/NujasAI/Public/NujasAIModule.h b/Source/NujasAI/Public/NujasAIModule.h new file mode 100644 index 0000000..b4cd424 --- /dev/null +++ b/Source/NujasAI/Public/NujasAIModule.h @@ -0,0 +1,14 @@ +// Copyright 2018-2019 The Janus Project | 2034 Complex LLC. All Rights Reserved. + +#pragma once + +#include "CoreMinimal.h" +#include "Modules/ModuleManager.h" + +class FNujasAIModule : public IModuleInterface +{ +public: + /** IModuleInterface implementation */ + virtual void StartupModule() override; + virtual void ShutdownModule() override; +}; diff --git a/Source/NujasDebug/NujasDebug.Build.cs b/Source/NujasDebug/NujasDebug.Build.cs new file mode 100644 index 0000000..226e1c9 --- /dev/null +++ b/Source/NujasDebug/NujasDebug.Build.cs @@ -0,0 +1,54 @@ +// Copyright 2018-2019 The Janus Project | 2034 Complex LLC. All Rights Reserved. + +using UnrealBuildTool; + +public class NujasDebug : ModuleRules +{ + public NujasDebug(ReadOnlyTargetRules Target) : base(Target) + { + PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs; + + PublicIncludePaths.AddRange( + new string[] { + // ... add public include paths required here ... + } + ); + + + PrivateIncludePaths.AddRange( + new string[] { + // ... add other private include paths required here ... + "NujasDebug/Private" + } + ); + + + PublicDependencyModuleNames.AddRange( + new string[] + { + "Core", + // ... add other public dependencies that you statically link with here ... + } + ); + + + PrivateDependencyModuleNames.AddRange( + new string[] + { + "CoreUObject", + "Engine", + "Slate", + "SlateCore", + // ... add private dependencies that you statically link with here ... + } + ); + + + DynamicallyLoadedModuleNames.AddRange( + new string[] + { + // ... add any modules that your module loads dynamically here ... + } + ); + } +} diff --git a/Source/NujasDebug/Private/AIStatCollectionActor.cpp b/Source/NujasDebug/Private/AIStatCollectionActor.cpp new file mode 100644 index 0000000..4c69d01 --- /dev/null +++ b/Source/NujasDebug/Private/AIStatCollectionActor.cpp @@ -0,0 +1,42 @@ +// Copyright 2018-2019 The Janus Project | 2034 Complex LLC. All Rights Reserved. + +#include "AIStatCollectionActor.h" + +// Sets default values +AAIStatCollectionActor::AAIStatCollectionActor() +{ + // Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it. + PrimaryActorTick.bCanEverTick = true; + IConsoleManager::Get().RegisterConsoleVariable( + TEXT("nujas.AI"), + 0, + TEXT("Set what kind of Nujas AI debug window you would like to view.\n") + TEXT("<=0: off\n") + TEXT(" 1: Aggression System\n") + TEXT(" 2: Positioning (not yet implemented)\n"), + ECVF_Cheat + ); +} + +// Called when the game starts or when spawned +void AAIStatCollectionActor::BeginPlay() +{ + Super::BeginPlay(); +} + +// Called every frame +void AAIStatCollectionActor::Tick(float DeltaTime) +{ + // listen for custom commands and react + static const auto CVarNujasAI = IConsoleManager::Get().FindConsoleVariable(TEXT("nujas.AI")); + if(CVarNujasAI) + { + NujasAIConsoleFlag = CVarNujasAI->GetInt(); + } + + if(NujasAIConsoleFlag == 1) + { + UE_LOG(LogTemp, Warning, TEXT("Console Flag works")); + } + Super::Tick(DeltaTime); +} \ No newline at end of file diff --git a/Source/NujasDebug/Private/NujasDebugModule.cpp b/Source/NujasDebug/Private/NujasDebugModule.cpp new file mode 100644 index 0000000..6e656e5 --- /dev/null +++ b/Source/NujasDebug/Private/NujasDebugModule.cpp @@ -0,0 +1,20 @@ +// Copyright 2018-2019 The Janus Project | 2034 Complex LLC. All Rights Reserved. + +#include "NujasDebugModule.h" + +#define LOCTEXT_NAMESPACE "FNujasDebugModule" + +void FNujasDebugModule::StartupModule() +{ + // This code will execute after your module is loaded into memory; the exact timing is specified in the .uplugin file per-module +} + +void FNujasDebugModule::ShutdownModule() +{ + // This function may be called during shutdown to clean up your module. For modules that support dynamic reloading, + // we call this function before unloading the module. +} + +#undef LOCTEXT_NAMESPACE + +IMPLEMENT_MODULE(FNujasDebugModule, NujasDebug) \ No newline at end of file diff --git a/Source/NujasDebug/Public/AIStatCollectionActor.h b/Source/NujasDebug/Public/AIStatCollectionActor.h new file mode 100644 index 0000000..c35c7a1 --- /dev/null +++ b/Source/NujasDebug/Public/AIStatCollectionActor.h @@ -0,0 +1,29 @@ +// Copyright 2018-2019 The Janus Project | 2034 Complex LLC. All Rights Reserved. + +#pragma once + +#include "CoreMinimal.h" +#include "GameFramework/Actor.h" + +#include "AIStatCollectionActor.generated.h" + +UCLASS() +class NUJASDEBUG_API AAIStatCollectionActor : public AActor +{ + GENERATED_BODY() + + // get the value on the game thread + int32 NujasAIConsoleFlag = 0; + +public: + // Sets default values for this actor's properties + AAIStatCollectionActor(); + +protected: + // Called when the game starts or when spawned + virtual void BeginPlay() override; + +public: + // Called every frame + virtual void Tick(float DeltaTime) override; +}; \ No newline at end of file diff --git a/Source/NujasDebug/Public/NujasDebugModule.h b/Source/NujasDebug/Public/NujasDebugModule.h new file mode 100644 index 0000000..c54d51e --- /dev/null +++ b/Source/NujasDebug/Public/NujasDebugModule.h @@ -0,0 +1,15 @@ +// Copyright 2018-2019 The Janus Project | 2034 Complex LLC. All Rights Reserved. + +#pragma once + +#include "CoreMinimal.h" +#include "Modules/ModuleManager.h" + +class FNujasDebugModule : public IModuleInterface +{ +public: + + /** IModuleInterface implementation */ + virtual void StartupModule() override; + virtual void ShutdownModule() override; +}; diff --git a/Source/NujasInventory/Private/BasicUsableObject.cpp b/Source/NujasInventory/Private/BasicUsableObject.cpp index 3572bc1..02f4794 100644 --- a/Source/NujasInventory/Private/BasicUsableObject.cpp +++ b/Source/NujasInventory/Private/BasicUsableObject.cpp @@ -1,26 +1,22 @@ -// Fill out your copyright notice in the Description page of Project Settings. +// Copyright 2018-2019 The Janus Project | 2034 Complex LLC. All Rights Reserved. #include "BasicUsableObject.h" // Sets default values ABasicUsableObject::ABasicUsableObject() { - // Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it. + // Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it. PrimaryActorTick.bCanEverTick = false; - } // Called when the game starts or when spawned void ABasicUsableObject::BeginPlay() { Super::BeginPlay(); - } // Called every frame void ABasicUsableObject::Tick(float DeltaTime) { Super::Tick(DeltaTime); - } - diff --git a/Source/NujasInventory/Public/BasicUsableObject.h b/Source/NujasInventory/Public/BasicUsableObject.h index 3e8a53d..4880ec1 100644 --- a/Source/NujasInventory/Public/BasicUsableObject.h +++ b/Source/NujasInventory/Public/BasicUsableObject.h @@ -1,4 +1,4 @@ -// Fill out your copyright notice in the Description page of Project Settings. +// Copyright 2018-2019 The Janus Project | 2034 Complex LLC. All Rights Reserved. #pragma once @@ -13,8 +13,8 @@ UCLASS() class NUJASINVENTORY_API ABasicUsableObject : public AActor, public IUsableInterface { GENERATED_BODY() - -public: + +public: // Sets default values for this actor's properties ABasicUsableObject(); @@ -22,7 +22,7 @@ class NUJASINVENTORY_API ABasicUsableObject : public AActor, public IUsableInter // Called when the game starts or when spawned virtual void BeginPlay() override; -public: +public: // Called every frame virtual void Tick(float DeltaTime) override; }; diff --git a/Source/NujasWidget/NujasWidget.Build.cs b/Source/NujasWidget/NujasWidget.Build.cs new file mode 100644 index 0000000..de76844 --- /dev/null +++ b/Source/NujasWidget/NujasWidget.Build.cs @@ -0,0 +1,56 @@ +// Copyright 2018-2019 The Janus Project | 2034 Complex LLC. All Rights Reserved. + +using UnrealBuildTool; + +public class NujasWidget : ModuleRules +{ + public NujasWidget(ReadOnlyTargetRules Target) : base(Target) + { + PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs; + + PublicIncludePaths.AddRange( + new string[] { + // ... add public include paths required here ... + } + ); + + + PrivateIncludePaths.AddRange( + new string[] { + // ... add other private include paths required here ... + "NujasWidget/Private" + } + ); + + + PublicDependencyModuleNames.AddRange( + new string[] + { + "Core", + "UMG" + // ... add other public dependencies that you statically link with here ... + } + ); + + + PrivateDependencyModuleNames.AddRange( + new string[] + { + "CoreUObject", + "Engine", + "Slate", + "SlateCore", + + // ... add private dependencies that you statically link with here ... + } + ); + + + DynamicallyLoadedModuleNames.AddRange( + new string[] + { + // ... add any modules that your module loads dynamically here ... + } + ); + } +} diff --git a/Source/NujasWidget/Private/NujasWidget.cpp b/Source/NujasWidget/Private/NujasWidget.cpp new file mode 100644 index 0000000..8d9f593 --- /dev/null +++ b/Source/NujasWidget/Private/NujasWidget.cpp @@ -0,0 +1,23 @@ +#include "NujasWidget.h" + +UNujasWidget::UNujasWidget(const FObjectInitializer &ObjectInitializer) + : Super(ObjectInitializer) +{ + +} + +void UNujasWidget::NativeConstruct() +{ + // Do some custom setup + + // Call the Blueprint "Event Construct" node + Super::NativeConstruct(); +} + +void UNujasWidget::NativeTick(const FGeometry &Geometry, float InDeltaTime) +{ + // Make sure to call the base class's NativeTick function + Super::NativeTick(Geometry, InDeltaTime); + + // Do your custom tick stuff here +} \ No newline at end of file diff --git a/Source/NujasWidget/Private/NujasWidgetModule.cpp b/Source/NujasWidget/Private/NujasWidgetModule.cpp new file mode 100644 index 0000000..864b403 --- /dev/null +++ b/Source/NujasWidget/Private/NujasWidgetModule.cpp @@ -0,0 +1,20 @@ +// Copyright 2018-2019 The Janus Project | 2034 Complex LLC. All Rights Reserved. + +#include "NujasWidgetModule.h" + +#define LOCTEXT_NAMESPACE "FNujasWidgetModule" + +void FNujasWidgetModule::StartupModule() +{ + // This code will execute after your module is loaded into memory; the exact timing is specified in the .uplugin file per-module +} + +void FNujasWidgetModule::ShutdownModule() +{ + // This function may be called during shutdown to clean up your module. For modules that support dynamic reloading, + // we call this function before unloading the module. +} + +#undef LOCTEXT_NAMESPACE + +IMPLEMENT_MODULE(FNujasWidgetModule, NujasWidget) \ No newline at end of file diff --git a/Source/NujasWidget/Public/NujasWidget.h b/Source/NujasWidget/Public/NujasWidget.h new file mode 100644 index 0000000..dbaa655 --- /dev/null +++ b/Source/NujasWidget/Public/NujasWidget.h @@ -0,0 +1,23 @@ +// Copyright 2018-2019 The Janus Project | 2034 Complex LLC. All Rights Reserved. + +#pragma once + +#include "UserWidget.h" +#include "NujasWidget.generated.h" + +// We make the class abstract, as we don't want to create +// instances of this, instead we want to create instances. +UCLASS(Abstract) +class NUJASWIDGET_API UNujasWidget : public UUserWidget +{ + GENERATED_BODY() + +public: + UNujasWidget(const FObjectInitializer &ObjectInitializer); + + // Optionally override the Blueprint "Event Construct" event + virtual void NativeConstruct() override; + + // Optionally override the tick event + virtual void NativeTick(const FGeometry &MyGeometry, float InDeltaTime) override; +}; \ No newline at end of file diff --git a/Source/NujasWidget/Public/NujasWidgetModule.h b/Source/NujasWidget/Public/NujasWidgetModule.h new file mode 100644 index 0000000..40cf609 --- /dev/null +++ b/Source/NujasWidget/Public/NujasWidgetModule.h @@ -0,0 +1,15 @@ +// Copyright 2018-2019 The Janus Project | 2034 Complex LLC. All Rights Reserved. + +#pragma once + +#include "CoreMinimal.h" +#include "Modules/ModuleManager.h" + +class FNujasWidgetModule : public IModuleInterface +{ +public: + + /** IModuleInterface implementation */ + virtual void StartupModule() override; + virtual void ShutdownModule() override; +}; diff --git a/TheJanusFramework.uplugin b/TheJanusFramework.uplugin index 0addc0a..5bf1b0b 100644 --- a/TheJanusFramework.uplugin +++ b/TheJanusFramework.uplugin @@ -38,6 +38,21 @@ "Name": "NujasCombat", "Type": "Runtime", "LoadingPhase": "Default" + }, + { + "Name": "NujasAI", + "Type": "Runtime", + "LoadingPhase": "Default" + }, + { + "Name": "NujasDebug", + "Type": "Runtime", + "LoadingPhase": "Default" + }, + { + "Name": "NujasWidget", + "Type": "Runtime", + "LoadingPhase": "Default" } ] }