Browse Source
- Added an Entity field to AActor; this change needs to be applied to the UE4 code manually. The patch is in Source/UnrealEnginePatches/AActorEntityIntegration.patch - DPI scaling for the editor is now done explictly by GalavantUnrealMain; this is so I automatically have my desired DPI settings. This is a hack and will probably trip up anyone else who uses GalavantUnreal - Fixed segfault involving UnrealMovementComponent having dead Entities subscribed to it after Play In Editor has stopped and restarted. This occurred because I had transitioned to using static initialization to auto-register ComponentManagers, but for some reason (hotreloading or library separation) UnrealMovementComponent wasn't being added to the static ComponentManagers list. ComponentManagers are now explicitly added, like before - Made small changes to test Needs: death now happens through conscious state; blood need has trigger to make fainting happen if blood level is low - CombatComponentManager's Update() is now actually executed. I must've forgotten to add it before - Big refactor of ActorEntityManagement. Due to AActor Entity integration, the exact entity can be notified. I removed all the code which iterates over all actors as it is now unneeded. All Actor creation should now be done through ActorEntityManagement::CreateActorForEntity(). ActorEntities can now only have one callback, which is set during creation. At the moment, lifetime is managed via callback as well as the ability to check all Actor pointers to ensure it is a tracked actor. The latter option should be removed once the callback solution proves its robustness. I'm not going to do it right now because I want to work on other things - Made several changes to UnrealMovementComponent's actor management in order to prevent the segfault from happening. I added a debug display which is useful for seeing discrepancies in display/spawning at runtime. More work is needed on actor management. I'm noticing sometimes Actors should be right in front of player but are gone; they don't think they should exist either, which is perplexingcombatComponentRefactor

10 changed files with 260 additions and 185 deletions
Binary file not shown.
Binary file not shown.
@ -0,0 +1,65 @@ |
|||
From 48ddb51b9790eba1cee74bae9ddb12c202cf9a47 Mon Sep 17 00:00:00 2001 |
|||
From: Macoy Madson <macoymadson@gmail.com> |
|||
Date: Thu, 28 Sep 2017 19:03:32 -0700 |
|||
Subject: [PATCH] Added very basic Entity integration and lifetime callback to |
|||
AActor |
|||
|
|||
---
|
|||
Engine/Source/Runtime/Engine/Classes/GameFramework/Actor.h | 13 +++++++++++++ |
|||
Engine/Source/Runtime/Engine/Private/Actor.cpp | 2 ++ |
|||
2 files changed, 15 insertions(+) |
|||
|
|||
diff --git a/Engine/Source/Runtime/Engine/Classes/GameFramework/Actor.h b/Engine/Source/Runtime/Engine/Classes/GameFramework/Actor.h
|
|||
index 43f7768..e00a273 100644
|
|||
--- a/Engine/Source/Runtime/Engine/Classes/GameFramework/Actor.h
|
|||
+++ b/Engine/Source/Runtime/Engine/Classes/GameFramework/Actor.h
|
|||
@@ -90,6 +90,12 @@ class ENGINE_API AActor : public UObject
|
|||
*/ |
|||
|
|||
GENERATED_BODY() |
|||
+
|
|||
+/* Galavant-specific code */
|
|||
+public:
|
|||
+ UPROPERTY(BlueprintReadOnly, Category="Galavant")
|
|||
+ int Entity;
|
|||
+
|
|||
public: |
|||
|
|||
/** |
|||
@@ -3045,6 +3051,9 @@ private:
|
|||
} |
|||
}; |
|||
|
|||
+/* Galavant-specific code */
|
|||
+using ActorEntityOnDestroyFunc = void (*)(AActor* actor, int entity);
|
|||
+extern ActorEntityOnDestroyFunc ActorEntityOnDestroy;
|
|||
|
|||
struct FMarkActorIsBeingDestroyed |
|||
{ |
|||
@@ -3052,6 +3061,10 @@ private:
|
|||
FMarkActorIsBeingDestroyed(AActor* InActor) |
|||
{ |
|||
InActor->bActorIsBeingDestroyed = true; |
|||
+
|
|||
+ /* Galavant-specific code */
|
|||
+ if (InActor->Entity && ActorEntityOnDestroy)
|
|||
+ ActorEntityOnDestroy(InActor, InActor->Entity);
|
|||
} |
|||
|
|||
friend UWorld; |
|||
diff --git a/Engine/Source/Runtime/Engine/Private/Actor.cpp b/Engine/Source/Runtime/Engine/Private/Actor.cpp
|
|||
index 48ad3cd..55c71ff 100644
|
|||
--- a/Engine/Source/Runtime/Engine/Private/Actor.cpp
|
|||
+++ b/Engine/Source/Runtime/Engine/Private/Actor.cpp
|
|||
@@ -61,6 +61,8 @@ FUObjectAnnotationSparseBool GSelectedActorAnnotation;
|
|||
FOnProcessEvent AActor::ProcessEventDelegate; |
|||
#endif |
|||
|
|||
+ActorEntityOnDestroyFunc ActorEntityOnDestroy = nullptr;
|
|||
+
|
|||
uint32 AActor::BeginPlayCallDepth = 0; |
|||
|
|||
AActor::AActor() |
|||
--
|
|||
2.7.4 |
|||
|
@ -1,8 +1,19 @@ |
|||
# galavant-unreal |
|||
|
|||
A Galavant front-end using Unreal Engine 4 |
|||
|
|||
This will be a really messy project doing various testing/experimentation. |
|||
|
|||
## Dependencies |
|||
|
|||
This project depends on |
|||
1. [Galavant](https://github.com/makuto/galavant), which should be cloned into galavant-unreal/GalavantUnreal/ThirdParty/galavant (or use a symlink) (MIT License) |
|||
2. [PolyVox](https://bitbucket.org/volumesoffun/polyvox), which should be cloned into galavant-unreal/GalavantUnreal/ThirdParty/polyvox (pseudo-public domain) |
|||
2. [PolyVox](https://bitbucket.org/volumesoffun/polyvox), which should be cloned into galavant-unreal/GalavantUnreal/ThirdParty/polyvox (pseudo-public domain) |
|||
|
|||
## Building |
|||
|
|||
This section is WIP. |
|||
|
|||
### Unreal Engine Code Modifications |
|||
|
|||
Galavant requires some modifications to the UE4 code. These can be found in Source/UnrealEnginePatches and can be applied using git. (TODO: Make this process convenient) |
Loading…
Reference in new issue