Browse Source

DamageDealer, debug output, project stuff

- AgentComponentManager debug status now prints string instead of enum integer value
- CombatComponentManager has DamageDealerHitEntity(), which is as of yet untested. The interface will likely be radically different; I put this in just for testing
- Updated Notes and TODO
- Added some build options to Sublime project
master
Macoy Madson 6 years ago
parent
commit
3da5ee8cfe
  1. 1
      Notes.md
  2. 83
      TODO.tasks
  3. 26
      src/game/agent/AgentComponentManager.cpp
  4. 4
      src/game/agent/AgentComponentManager.hpp
  5. 19
      src/game/agent/combat/CombatComponentManager.cpp
  6. 2
      src/game/agent/combat/CombatComponentManager.hpp
  7. 36
      src/project/galavantSublime/galavant.sublime-project

1
Notes.md

@ -4,6 +4,7 @@ Miscellaneous notes regarding working on Galavant, the code, and other random sh
## Working With Unreal
- I fucked up Nativized Blueprints on my machine when I updated from 4.17 to 4.18, so they may be broken on your machine too. Either way, I have disabled Blueprint nativization for the time being. I suspect a 100% fresh install of GalavantUnreal will resolve this. *Update:* I had to delete a duplicate of the NativizedAssets plugin from GalavantUnreal/Intermediate/Plugins which was in a folder "LinuxNoEditor" just to compile. Perhaps my workflow created this folder erroneously? This appears to have fixed Nativized Blueprints for me. I'll leave this note here in case it happens again to me or anyone else
- When making changes to Galavant's libraries, simply touch a GalavantUnreal source file to ensure
you get the latest Galavant changes when using Unreal's hot reloading
- After rebuilding Unreal, you may need to delete GalavantUnreal/Binaries/* if you get 'Game Module Could Not Be Loaded' error on startup

83
TODO.tasks

@ -1,11 +1,6 @@
------------------
Todo
------------------
Pickups sort of working, sometimes they aren't picked up, Actors are being destroyed strangely
Possibility that pickup actor is falling through the floor
(invisible other component hitting KillZ?) YES, it's KillZ
Minimap
HUD Minimap is difficult to use with regards to rotation (needs better view cone)
Instead of doing this weird shit, just render the world and have UI create icons for player
@ -13,69 +8,83 @@ Minimap
Minimap noise doesn't match world
Scaling is completely wrong between WorldResource position and noise sample
Actually, this doesn't seem to be the problem
Minimap is extremely slow
Position vs GlobalPosition
As soon as possible, I need to decide if I need Chunk XYZ with Position XYZ
This depends on whether I ever want to support really large worlds
How large? I'd have to do the math (yes, the monster math)
Player Movement
Get full body instead of floating arms
Combat System
Animations
This is going to be tricky. Procedural would be cool, but difficult. At least shoot for
procedural impact effects
Figure out how to actually make animations in Blender (try Unreal .fbx export/import)
Note on .fbx import/export: I had to add the following to SSlateFileOpenDlg::GetFilterExtension:
if (!FilterExt)
return false;
(this is fixed on 4.17 now)
Could do UI only for now to experiment with timing
Hook up ragdoll physics for deaths/unconscious
Sound
Can start with simple sounds: blood hit, sword hit/parry, sword swing
Milestones
Goal #1: Minecraft-quality
Goal #2: Minecraft but with strategy (this can be the stopping point for now)
Goal #3: Something closer to Chivalry instead of Minecraft
Consider spawning Game Logic-only colliders which anchor to Unreal bones for combat. These colliders
could be made into ragdoll colliders on true impact or somehow tell the thing it collided what the
force and direction is so the animation can react. Here's a perfect feature for this:
https://docs.unrealengine.com/latest/INT/Engine/Animation/PhysicallyDrivenAnimation/
Add player HUD UI - Only needs Minimap, Need bars
Debugging
Fix debug text over AgentCharacter for combat test
Make it possible to e.g. hover over agents and inspect their values as soon as the game starts up.
Add player HUD UI - Only needs Minimap, Need bars
Cereal integration
Goal retrying needs rethinking (goal retry status is forgotten once goal completely fails)
After extended period of time, PlanComponentManager is constantly trying to unsubscribe things
Development
Future Features
Cereal integration
Position vs GlobalPosition
As soon as possible, I need to decide if I need Chunk XYZ with Position XYZ
This depends on whether I ever want to support really large worlds
How large? I'd have to do the math (yes, the monster math)
Agents
Goal retrying needs rethinking (goal retry status is forgotten once goal completely fails)
After extended period of time, PlanComponentManager is constantly trying to unsubscribe things
Fix Agents having unpredictable Need levels on second Play In Editor (I'm guessing the above Pause
Galavant loop will help with this)
Replaying in editor seems to do strange things with needs/timers. Are things being reset properly?
Also noticed manhattan distance for movement doesn't stop them. Resource positions might be borked
Pickups sort of working, sometimes they aren't picked up, Actors are being destroyed strangely
Possibility that pickup actor is falling through the floor
(invisible other component hitting KillZ?) YES, it's KillZ
Development/workflow improvements
Automatic apply UEngine patch script
Need something to free mouse
AGalavantUnrealFPCharacter::ToggleMouseLock() doesn't work
LogMeshReduction: No automatic skeletal mesh reduction module available
Fix Agents having unpredictable Need levels on second Play In Editor (I'm guessing the above Pause
Galavant loop will help with this)
Replaying in editor seems to do strange things with needs/timers. Are things being reset properly?
Consider spawning Game Logic-only colliders which anchor to Unreal bones for combat. These colliders
could be made into ragdoll colliders on true impact or somehow tell the thing it collided what the
force and direction is so the animation can react. Here's a perfect feature for this:
https://docs.unrealengine.com/latest/INT/Engine/Animation/PhysicallyDrivenAnimation/
Need something to free mouse
AGalavantUnrealFPCharacter::ToggleMouseLock() doesn't work
Need Projectile impact sound
------------------
Doing
------------------
Collision detection for combat
Need to delete Galavant editor build due to assert from FPCharacter
May need to repackage due to blueprint no longer matching code
Projectile impact doesn't harm entity
------------------
Done
------------------
Visual Studio Code integration
Finish hooking up sounds
Landed sound doesn't trigger
Use animation notifications instead to get timing perfect
Hook up ragdoll physics for deaths/unconscious
Figure out how to actually make animations in Blender (try Unreal .fbx export/import)
Note on .fbx import/export: I had to add the following to SSlateFileOpenDlg::GetFilterExtension:
if (!FilterExt)
return false;
(this is fixed on 4.17 now)
Add game control keybinds
Escape closes
P toggles Galavant pause/play game time

26
src/game/agent/AgentComponentManager.cpp

@ -2,8 +2,8 @@
#include "util/Logging.hpp"
#include "entityComponentSystem/PooledComponentManager.hpp"
#include "entityComponentSystem/EntityComponentManager.hpp"
#include "entityComponentSystem/PooledComponentManager.hpp"
#include "game/agent/combat/CombatComponentManager.hpp"
#include "util/Math.hpp"
@ -13,6 +13,25 @@ namespace gv
ResourceDictionary<AgentGoalDef> g_AgentGoalDefDictionary;
AgentComponentManager g_AgentComponentManager;
const char* GetGoalStatusString(AgentGoal::GoalStatus status)
{
switch (status)
{
case AgentGoal::GoalStatus::None:
return "None";
case AgentGoal::GoalStatus::StartGoal:
return "Start Goal";
case AgentGoal::GoalStatus::InProgress:
return "In Progress";
case AgentGoal::GoalStatus::Failed:
return "Failed";
case AgentGoal::GoalStatus::Succeeded:
return "Succeeded";
default:
return "[Status string not added]";
}
}
AgentComponentManager::AgentComponentManager() : gv::PooledComponentManager<AgentComponentData>(100)
{
DebugName = "AgentComponentManager";
@ -276,7 +295,8 @@ void AgentComponentManager::Update(float deltaSeconds)
if (goal.Status != AgentGoal::GoalStatus::InProgress &&
goal.Status != AgentGoal::GoalStatus::StartGoal)
{
LOGD_IF(DebugPrint) << "Agent Goal concluded with status " << (int)goal.Status;
LOGD_IF(DebugPrint) << "Agent Goal concluded with status "
<< GetGoalStatusString(goal.Status);
goals.erase(headGoalIt);
}
}
@ -387,4 +407,4 @@ Need* AgentComponentManager::GetAgentNeed(Entity entity, NeedType needType)
return nullptr;
}
}
}

4
src/game/agent/AgentComponentManager.hpp

@ -30,6 +30,8 @@ struct AgentGoal
};
typedef std::vector<AgentGoal> AgentGoalList;
const char* GetGoalStatusString(AgentGoal::GoalStatus status);
struct AgentComponentData
{
bool IsAlive = true;
@ -82,4 +84,4 @@ public:
};
extern AgentComponentManager g_AgentComponentManager;
};
};

19
src/game/agent/combat/CombatComponentManager.cpp

@ -1,5 +1,7 @@
#include "CombatComponentManager.hpp"
#include "game/agent/AgentComponentManager.hpp"
#include "util/Time.hpp"
namespace gv
@ -105,4 +107,21 @@ void CombatComponentManager::Update(float deltaSeconds)
}
}
}
void CombatComponentManager::DamageDealerHitEntity(Entity hitEntity)
{
for (Combatant& combatant : Combatants)
{
if (combatant.entity == hitEntity)
{
Need* bloodNeed = g_AgentComponentManager.GetAgentNeed(hitEntity, NeedType::Blood);
if (!bloodNeed)
break;
bloodNeed->Level -= 20.f;
break;
}
}
}
}

2
src/game/agent/combat/CombatComponentManager.hpp

@ -111,6 +111,8 @@ public:
void ActivateCombatAction(Entity combatant, CombatAction action);
void Update(float deltaSeconds);
void DamageDealerHitEntity(Entity hitEntity);
};
extern CombatComponentManager g_CombatComponentManager;

36
src/project/galavantSublime/galavant.sublime-project

@ -1,6 +1,7 @@
{
// You'll need to replace all instances of /home/macoy/Development/code/3rdParty/repositories/UnrealEngine
// with your Unreal Engine install location. There may be other folders that need correction
// and /media/macoy/SSD/Development/code/3rdParty/repositories/UnrealEngine with your Unreal
// Engine install location. There may be other folders that need correction
// You'll also need to copy JamUnrealBuildOutput.sublime-syntax to your Sublime User folder
// (Preferences -> Browse Packages... -> User) to build using the provided build systems
"folders":
@ -95,20 +96,38 @@
// This is useful when it complains that Linux headers have changed
{
"name": "GalavantUnreal Quick Clean",
"name": "GalavantUnreal Quick Clean (linux headers changed error fix)",
"shell_cmd": "rm -r Intermediate/Build",
"working_dir": "$project_path/../../../../galavant-unreal/GalavantUnreal"
},
{
"name": "GalavantUnreal Fix 'Game Module Could Not Be Loaded'",
"name": "GalavantUnreal Fix 'Game Module Could Not Be Loaded' (DOESN'T WORK)",
"shell_cmd": "rm -r Binaries/Linux",
"working_dir": "$project_path/../../../../galavant-unreal/GalavantUnreal"
},
// TODO: @Hack: Need to figure out why this .so isn't being copied automatically
{
"name": "GalavantUnreal Generate Project Files",
"shell_cmd": "/home/macoy/Development/code/3rdParty/repositories/UnrealEngine/GenerateProjectFiles.sh -project=/home/macoy/Development/code/repositories/galavant-unreal/GalavantUnreal/GalavantUnreal.uproject -game -editor",
"name": "GalavantUnreal Fix 'Game Module Could Not Be Loaded' (MAYBE WORKS)",
"shell_cmd": "cp /media/macoy/SSD/Development/code/3rdParty/repositories/UnrealEngine/Engine/Plugins/Runtime/CustomMeshComponent/Binaries/Linux/libUE4Editor-CustomMeshComponent-Linux-Debug.so Binaries/Linux",
"working_dir": "$project_path/../../../../galavant-unreal/GalavantUnreal"
},
{
"name": "GalavantUnreal Generate Project Files (Makefile; No VSCode)",
// I don't think I need to build a custom version of the editor
// "shell_cmd": "/home/macoy/Development/code/3rdParty/repositories/UnrealEngine/GenerateProjectFiles.sh -project=/home/macoy/Development/code/repositories/galavant-unreal/GalavantUnreal/GalavantUnreal.uproject -game -editor",
"shell_cmd": "/home/macoy/Development/code/3rdParty/repositories/UnrealEngine/GenerateProjectFiles.sh -project=/home/macoy/Development/code/repositories/galavant-unreal/GalavantUnreal/GalavantUnreal.uproject -game",
"working_dir": "$project_path/../../../../galavant-unreal/GalavantUnreal",
"syntax":"JamUnrealBuildOutput.sublime-syntax"
},
{
"name": "GalavantUnreal Generate Project Files (VSCode; No Makefile)",
// I don't think I need to build a custom version of the editor
// "shell_cmd": "/home/macoy/Development/code/3rdParty/repositories/UnrealEngine/GenerateProjectFiles.sh -project=/home/macoy/Development/code/repositories/galavant-unreal/GalavantUnreal/GalavantUnreal.uproject -game -editor",
"shell_cmd": "/home/macoy/Development/code/3rdParty/repositories/UnrealEngine/GenerateProjectFiles.sh -project=/home/macoy/Development/code/repositories/galavant-unreal/GalavantUnreal/GalavantUnreal.uproject -game -vscode",
"working_dir": "$project_path/../../../../galavant-unreal/GalavantUnreal",
"syntax":"JamUnrealBuildOutput.sublime-syntax"
},
@ -131,6 +150,13 @@
"syntax":"JamUnrealBuildOutput.sublime-syntax"
},
{
"name": "GalavantUnreal Cook (Maybe doesn't work)",
"shell_cmd": "mono AutomationTool.exe BuildCookRun -nocompileeditor -nop4 -project=/home/macoy/Development/code/repositories/galavant-unreal/GalavantUnreal/GalavantUnreal.uproject -cook -skipstage -ue4exe=UE4Editor -targetplatform=Linux -utf8output",
"working_dir": "/home/macoy/Development/code/3rdParty/repositories/UnrealEngine/Engine/Binaries/DotNET",
"syntax":"JamUnrealBuildOutput.sublime-syntax"
},
{
"name": "Standalone Full Build Debug (build Galavant lib and Unreal)",
"shell_cmd": "cd galavant && jam -j4 -q -sUNREAL=true GalavantPseudotarget && cd ../galavant-unreal/GalavantUnreal && make GalavantUnreal-Linux-Debug && cp -r -u -v Binaries/ LOCAL_package/package/LinuxNoEditor/GalavantUnreal/",

Loading…
Cancel
Save