Skip to content

Commit 3090e67

Browse files
committed
Merge branch 'development' into browncoat-mission
2 parents 1dd6cde + c732e59 commit 3090e67

19 files changed

+38
-12
lines changed

Data/Browncoats.rte/Activities/RefineryAssaultFunctions.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ function RefineryAssault:HandleMessage(message, object)
2727
self.saveTable.introCinematicDone = true;
2828

2929
if self:GetFogOfWarEnabled() then
30-
SceneMan:MakeAllUnseen(Vector(1, 1), self.humanTeam);
30+
local fogResolution = 4;
31+
SceneMan:MakeAllUnseen(Vector(fogResolution, fogResolution), self.humanTeam);
3132
end
3233

3334
-- Shorthand to make debug skipping this actually matter

Source/Entities/ACrab.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -689,8 +689,9 @@ bool ACrab::IsWithinRange(Vector& point) const {
689689
}
690690

691691
bool ACrab::Look(float FOVSpread, float range) {
692-
if (!g_SceneMan.AnythingUnseen(m_Team) || m_CanRevealUnseen == false)
692+
if (!g_SceneMan.AnythingUnseen(m_Team) || m_CanRevealUnseen == false) {
693693
return false;
694+
}
694695

695696
// Set the length of the look vector
696697
float aimDistance = m_AimDistance + range;

Source/Entities/AHuman.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1233,8 +1233,9 @@ bool AHuman::IsWithinRange(Vector& point) const {
12331233
}
12341234

12351235
bool AHuman::Look(float FOVSpread, float range) {
1236-
if (!g_SceneMan.AnythingUnseen(m_Team) || m_CanRevealUnseen == false)
1236+
if (!g_SceneMan.AnythingUnseen(m_Team) || m_CanRevealUnseen == false) {
12371237
return false;
1238+
}
12381239

12391240
// Set the length of the look vector
12401241
float aimDistance = m_AimDistance + range;

Source/Entities/Actor.cpp

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -570,8 +570,9 @@ Controller::InputMode Actor::SwapControllerModes(Controller::InputMode newMode,
570570
}
571571

572572
bool Actor::Look(float FOVSpread, float range) {
573-
if (!g_SceneMan.AnythingUnseen(m_Team) || m_CanRevealUnseen == false)
573+
if (!g_SceneMan.AnythingUnseen(m_Team) || m_CanRevealUnseen == false) {
574574
return false;
575+
}
575576

576577
// Use the 'eyes' on the 'head', if applicable
577578
Vector aimPos = GetEyePos();
@@ -1089,13 +1090,10 @@ void Actor::Update() {
10891090
// Update the viewpoint to be at least what the position is
10901091
m_ViewPoint = m_Pos;
10911092

1092-
// "See" the location and surroundings of this actor on the unseen map
1093-
if (m_Status != Actor::INACTIVE)
1094-
Look(45 * m_Perceptiveness, g_FrameMan.GetPlayerScreenWidth() * 0.51 * m_Perceptiveness);
1095-
10961093
// Check if the MO we're following still exists, and if not, then clear the destination
1097-
if (m_pMOMoveTarget && !g_MovableMan.ValidMO(m_pMOMoveTarget))
1098-
m_pMOMoveTarget = 0;
1094+
if (m_pMOMoveTarget && !g_MovableMan.ValidMO(m_pMOMoveTarget)) {
1095+
m_pMOMoveTarget = nullptr;
1096+
}
10991097

11001098
///////////////////////////////////////////////////////////////////////////////
11011099
// Check for manual player-made progress made toward the set AI goal
@@ -1268,6 +1266,16 @@ void Actor::Update() {
12681266
}
12691267
}
12701268

1269+
void RTE::Actor::CastSeeRays() {
1270+
// "See" the location and surroundings of this actor on the unseen map
1271+
if (m_Status != Actor::INACTIVE) {
1272+
const int lookIterations = 6; // How many see rays to cast per frame
1273+
for (int i = 0; i < lookIterations; ++i) {
1274+
Look(45 * m_Perceptiveness, g_FrameMan.GetPlayerScreenWidth() * 0.51 * m_Perceptiveness);
1275+
}
1276+
}
1277+
}
1278+
12711279
void Actor::FullUpdate() {
12721280
PreControllerUpdate();
12731281
m_Controller.Update();

Source/Entities/Actor.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -664,6 +664,9 @@ namespace RTE {
664664
/// Updates this MovableObject. Supposed to be done every frame.
665665
void Update() override;
666666

667+
/// Cast see rays for this actor.
668+
void CastSeeRays();
669+
667670
/// Updates the full state of this object in one call. (PreControllerUpdate(), Controller::Update(), and Update())
668671
virtual void FullUpdate() override;
669672

Source/Managers/MovableMan.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1367,6 +1367,14 @@ void MovableMan::Update() {
13671367
g_PerformanceMan.StopPerformanceMeasurement(PerformanceMan::ScriptsUpdate);
13681368

13691369
{
1370+
auto actorsSeeFuture = g_ThreadMan.GetPriorityThreadPool().parallelize_loop(m_Actors.size(),
1371+
[&](int start, int end) {
1372+
ZoneScopedN("Actors See");
1373+
for (int i = start; i < end; ++i) {
1374+
m_Actors[i]->CastSeeRays();
1375+
}
1376+
});
1377+
13701378
{
13711379
ZoneScopedN("Actors Update");
13721380

@@ -1438,6 +1446,8 @@ void MovableMan::Update() {
14381446
particle->PostUpdate();
14391447
}
14401448
}
1449+
1450+
actorsSeeFuture.wait();
14411451
} // namespace RTE
14421452

14431453
//////////////////////////////////////////////////////////////////////
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)