we shooting
This commit is contained in:
@@ -29,6 +29,7 @@ void SurvivalAgentPlugin::Initialize(IBaseInterface* pInterface, PluginInfo& inf
|
||||
Blackboard* blackboardPtr{ CreateBlackboard() };
|
||||
m_BehaviourTree = new BT::BehaviorTree(blackboardPtr,
|
||||
new BT::Selector({
|
||||
BigThink::ZombieHandling(),
|
||||
BigThink::PurgeZoneHandling(),
|
||||
BigThink::ItemHandling(),
|
||||
BigThink::PickUpHandling(),
|
||||
@@ -51,17 +52,24 @@ Blackboard* SurvivalAgentPlugin::CreateBlackboard() {
|
||||
blackboardPtr->AddData("MaxFailSafe", 2.f);
|
||||
blackboardPtr->AddData("FailSafeDoOnce", false);
|
||||
|
||||
blackboardPtr->AddData("TargetZombie", EnemyInfo{});
|
||||
blackboardPtr->AddData("angleDiff", float{});
|
||||
blackboardPtr->AddData("TimerShotgun", std::chrono::steady_clock::time_point{});
|
||||
blackboardPtr->AddData("TimerShotgunDoOnce", false);
|
||||
blackboardPtr->AddData("MaxTimeShotgun", 1.f);
|
||||
blackboardPtr->AddData("TimerPistol", std::chrono::steady_clock::time_point{});
|
||||
blackboardPtr->AddData("TimerPistolDoOnce", false);
|
||||
blackboardPtr->AddData("MaxTimePistol", 1.f);
|
||||
|
||||
blackboardPtr->AddData("TargetItem", ItemInfo{});
|
||||
blackboardPtr->AddData("NextFreeSlot", 0);
|
||||
|
||||
blackboardPtr->AddData("TargetHouse", HouseInfo{});
|
||||
blackboardPtr->AddData("TimerBeforeLeaving", std::chrono::steady_clock::time_point{});
|
||||
blackboardPtr->AddData("TimerBeforeLeavingDoOnce", false);
|
||||
blackboardPtr->AddData("MaxTimeBeforeLeaving", 5.f);
|
||||
blackboardPtr->AddData("MaxTimeBeforeLeaving", 3.f);
|
||||
|
||||
return blackboardPtr;
|
||||
|
||||
|
||||
}
|
||||
|
||||
void SurvivalAgentPlugin::UpdateBlackboard(const SteeringPlugin_Output& steering) {
|
||||
@@ -105,7 +113,7 @@ void SurvivalAgentPlugin::InitGameDebugParams(GameDebugParams& params)
|
||||
params.SpawnPurgeZonesOnMiddleClick = true;
|
||||
params.PrintDebugMessages = true;
|
||||
params.ShowDebugItemNames = true;
|
||||
params.Seed = 0; //-1 = don't set seed. Any other number = fixed seed //TIP: use Seed = int(time(nullptr)) for pure randomness
|
||||
params.Seed = -1; //-1 = don't set seed. Any other number = fixed seed //TIP: use Seed = int(time(nullptr)) for pure randomness
|
||||
}
|
||||
|
||||
void SurvivalAgentPlugin::Update_Debug(float dt)
|
||||
@@ -176,8 +184,8 @@ void SurvivalAgentPlugin::Update_Debug(float dt)
|
||||
//This function calculates the new SteeringOutput, called once per frame
|
||||
SteeringPlugin_Output SurvivalAgentPlugin::UpdateSteering(float dt)
|
||||
{
|
||||
auto steering = SteeringPlugin_Output();
|
||||
bool spin{};
|
||||
auto steering = SteeringPlugin_Output(Elite::Vector2{}, m_pInterface->Agent_GetInfo().MaxAngularSpeed, true, false);
|
||||
bool spin{ false };
|
||||
|
||||
UpdateBlackboard(steering);
|
||||
|
||||
@@ -188,7 +196,6 @@ SteeringPlugin_Output SurvivalAgentPlugin::UpdateSteering(float dt)
|
||||
|
||||
if (spin) {
|
||||
steering.AutoOrient = false;
|
||||
steering.AngularVelocity = 3.14f;
|
||||
}
|
||||
|
||||
if (m_GrabItem) {
|
||||
@@ -203,6 +210,7 @@ SteeringPlugin_Output SurvivalAgentPlugin::UpdateSteering(float dt)
|
||||
|
||||
return steering;
|
||||
|
||||
|
||||
}
|
||||
|
||||
//This function should only be used for rendering debug elements
|
||||
@@ -210,6 +218,13 @@ void SurvivalAgentPlugin::Render(float dt) const
|
||||
{
|
||||
//This Render function should only contain calls to Interface->Draw_... functions
|
||||
m_pInterface->Draw_SolidCircle(m_Target, .7f, { 0,0 }, { 1, 0, 0 });
|
||||
|
||||
m_pInterface->Draw_Circle(m_pInterface->Agent_GetInfo().Position, 500.f, { 1.f, 0.f, 0 });
|
||||
m_pInterface->Draw_Circle(m_pInterface->Agent_GetInfo().Position, 400.f, { 1.f, 1.f, 0 });
|
||||
m_pInterface->Draw_Circle(m_pInterface->Agent_GetInfo().Position, 50.f, { 1.f, 1.f, 1.f });
|
||||
m_pInterface->Draw_Circle(m_pInterface->Agent_GetInfo().Position, 15.f, { 0.f, 1.f, 1.f });
|
||||
m_pInterface->Draw_Circle(m_pInterface->Agent_GetInfo().Position, 8.f, { 0.f, 1.f, 1.f });
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user