Skip to content

Commit 8241cdf

Browse files
authored
Merge branch 'development' into radius-affecting-attachables
2 parents 8a33096 + 230d38b commit 8241cdf

File tree

4,408 files changed

+1200273
-829430
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

4,408 files changed

+1200273
-829430
lines changed

.github/actions/bundle_release/action.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ runs:
2020
zip --must-match -j CortexCommand.windows.zip \
2121
release/Cortex\ Command*/Cortex\ Command*.exe \
2222
release/Cortex\ Command*/Cortex\ Command*.pdb \
23-
external/lib/win/{fmod,SDL2}.dll
23+
external/lib/win/fmod.dll
2424
2525
- name: Compress Linux Release
2626
shell: bash

.github/workflows/ci.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ on:
1010
types: [checks_requested]
1111

1212
workflow_dispatch:
13+
14+
schedule:
15+
- cron: '1 0 * * 0'
1316

1417
# Cancel in-progress runs if newer changes to the same branch/PR are pushed.
1518
concurrency:
@@ -21,4 +24,4 @@ jobs:
2124
uses: ./.github/workflows/meson.yml
2225

2326
msbuild:
24-
uses: ./.github/workflows/msbuild.yml
27+
uses: ./.github/workflows/msbuild.yml

.github/workflows/meson.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ on:
3636
macosx-deployment-target:
3737
type: string
3838
required: false
39-
default: "10.15"
39+
default: "11.1"
4040

4141
# Triggers the workflow when called by a top-level workflow
4242
workflow_call:
@@ -63,7 +63,7 @@ on:
6363
macosx-deployment-target:
6464
type: string
6565
required: false
66-
default: "10.15"
66+
default: "11.1"
6767

6868
jobs:
6969
build-linux:
@@ -178,7 +178,7 @@ jobs:
178178
echo "::group::Installing pkg-config"
179179
sudo apt install pkg-config
180180
echo "::group::Installing mac deps"
181-
omp install libsdl2 libsdl2_image onetbb lz4 libpng minizip luajit flac
181+
omp install SDL3 onetbb lz4 libpng minizip luajit flac
182182
echo "OSXCROSS_PKG_CONFIG_PATH=${{env.OSXCROSS_TARGET}}/macports/pkgs/opt/local/libexec/onetbb/lib/pkgconfig" >> $GITHUB_ENV
183183
echo "::endgroup::"
184184
echo "::group::Installing meson"

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212

1313
compile_commands.json
1414
**/.ccls-cache
15+
**/.cache
16+
**/.clangd
17+
1518

1619
**/build*
1720

@@ -101,3 +104,4 @@ LogLoadingWarning.txt
101104
LogConsole.txt
102105
Console.dump.log
103106
Console.input.log
107+
imgui.ini

CHANGELOG.md

Lines changed: 117 additions & 44 deletions
Large diffs are not rendered by default.

Data/Base.rte/AI/HumanBehaviors.lua

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,7 @@ function HumanBehaviors.WeaponSearch(AI, Owner, Abort)
571571

572572
local maxSearchDistance;
573573
if AI.isPlayerOwned then
574-
maxSearchDistance = 100; -- don't move player actors too far
574+
maxSearchDistance = 160; -- don't move player actors too far
575575
else
576576
maxSearchDistance = FrameMan.PlayerScreenWidth * 0.45;
577577
end
@@ -615,26 +615,26 @@ function HumanBehaviors.WeaponSearch(AI, Owner, Abort)
615615
for _, deviceEntry in pairs(devices) do
616616
local device = deviceEntry.device;
617617
if MovableMan:ValidMO(device) then
618-
local pathMultipler = 1;
618+
local pathMultiplier = 1;
619619
if device:HasObjectInGroup("Weapons - Primary") or device:HasObjectInGroup("Weapons - Heavy") then
620-
pathMultipler = 0.4; -- prioritize primary or heavy weapons
620+
pathMultiplier = 0.4; -- prioritize primary or heavy weapons
621621
elseif device.ClassName == "TDExplosive" then
622-
pathMultipler = 1.4; -- avoid grenades if there are other weapons
622+
pathMultiplier = 1.4; -- avoid grenades if there are other weapons
623623
elseif device:IsTool() then
624624
if pickupDiggers and device:HasObjectInGroup("Tools - Diggers") then
625-
pathMultipler = 1.8; -- avoid diggers if there are other weapons
625+
pathMultiplier = 1.8; -- avoid diggers if there are other weapons
626626
else
627-
pathMultipler = -1; -- disregard non-digger tools
627+
pathMultiplier = -1; -- disregard non-digger tools
628628
end
629629
end
630630

631-
if pathMultipler ~= -1 then
631+
if pathMultiplier ~= -1 then
632632
local deviceID = device.UniqueID;
633633
SceneMan.Scene:CalculatePathAsync(
634634
function(pathRequest)
635635
local pathLength = pathRequest.PathLength;
636636
if pathRequest.Status ~= PathRequest.NoSolution and pathLength < maxPathLength then
637-
local score = pathLength * pathMultipler;
637+
local score = pathLength * pathMultiplier;
638638
table.insert(devicesToPickUp, {deviceId = deviceID, score = score});
639639
end
640640
searchesRemaining = searchesRemaining - 1;
@@ -665,11 +665,12 @@ function HumanBehaviors.WeaponSearch(AI, Owner, Abort)
665665
local prevMoveTarget, prevSceneWaypoint;
666666
if Owner.MOMoveTarget and MovableMan:ValidMO(Owner.MOMoveTarget) then
667667
prevMoveTarget = Owner.MOMoveTarget;
668+
Owner.MOMoveTarget = nil;
668669
else
669670
prevSceneWaypoint = SceneMan:MovePointToGround(Owner:GetLastAIWaypoint(), Owner.Height/5, 4); -- last wpt or current pos
670671
end
671672

672-
Owner:ClearMovePath();
673+
Owner:ClearAIWaypoints();
673674
Owner:AddAIMOWaypoint(AI.PickupHD);
674675

675676
if prevMoveTarget then
@@ -704,7 +705,7 @@ function HumanBehaviors.ToolSearch(AI, Owner, Abort)
704705
if Owner.AIMode == Actor.AIMODE_GOLDDIG then
705706
maxSearchDistance = FrameMan.PlayerScreenWidth * 0.5; -- move up to half a screen when digging
706707
elseif AI.isPlayerOwned then
707-
maxSearchDistance = 60; -- don't move player actors too far
708+
maxSearchDistance = 160; -- don't move player actors too far
708709
else
709710
maxSearchDistance = FrameMan.PlayerScreenWidth * 0.3;
710711
end
@@ -780,11 +781,12 @@ function HumanBehaviors.ToolSearch(AI, Owner, Abort)
780781
local prevMoveTarget, prevSceneWaypoint;
781782
if Owner.MOMoveTarget and MovableMan:ValidMO(Owner.MOMoveTarget) then
782783
prevMoveTarget = Owner.MOMoveTarget;
784+
Owner.MOMoveTarget = nil;
783785
else
784786
prevSceneWaypoint = SceneMan:MovePointToGround(Owner:GetLastAIWaypoint(), Owner.Height/5, 4); -- last wpt or current pos
785787
end
786788

787-
Owner:ClearMovePath();
789+
Owner:ClearAIWaypoints();
788790
Owner:AddAIMOWaypoint(AI.PickupHD);
789791

790792
if Owner.AIMode ~= Actor.AIMODE_GOLDDIG then

Data/Base.rte/AI/NativeHumanAI.lua

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -723,6 +723,12 @@ function NativeHumanAI:CreateGoldDigBehavior(Owner)
723723
end
724724

725725
function NativeHumanAI:CreateBrainSearchBehavior(Owner)
726+
if self.PickupHD then
727+
-- We're currently trying to pickup a weapon, do that instead
728+
self.Target = nil;
729+
return;
730+
end
731+
726732
self.NextBehavior = coroutine.create(SharedBehaviors.BrainSearch);
727733
self.NextCleanup = nil;
728734
self.NextBehaviorName = "BrainSearch";
@@ -760,8 +766,13 @@ function NativeHumanAI:CreateAttackBehavior(Owner)
760766
self.ReloadTimer:Reset();
761767
self.TargetLostTimer:Reset();
762768

769+
if self.PickupHD then
770+
-- We're currently trying to pickup a weapon, do that instead
771+
self.Target = nil;
772+
return;
773+
end
774+
763775
local dist = SceneMan:ShortestDistance(Owner.Pos, self.Target.Pos, false);
764-
765776
if IsADoor(self.Target) and Owner.AIMode ~= Actor.AIMODE_SQUAD then
766777
--TODO: Include other explosive weapons with varying effective ranges!
767778
if Owner:EquipDeviceInGroup("Tools - Breaching", true) then

Data/Base.rte/AI/SharedBehaviors.lua

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ function SharedBehaviors.FaceAlarm(AI, Owner, Abort)
120120
end
121121

122122
-- find the closest enemy brain
123-
function SharedBehaviors.BrainSearch(AI, Owner, Abort)
123+
function SharedBehaviors.BrainSearch(AI, Owner, Abort)
124124
if AI.PlayerPreferredHD then
125125
Owner:EquipNamedDevice(AI.PlayerPreferredHD, true);
126126
end
@@ -145,9 +145,6 @@ function SharedBehaviors.BrainSearch(AI, Owner, Abort)
145145
end
146146

147147
if #Brains > 0 then
148-
local _ai, _ownr, _abrt = coroutine.yield(); -- wait until next frame
149-
if _abrt then return true end
150-
151148
if #Brains == 1 then
152149
if MovableMan:IsActor(Brains[1]) then
153150
Owner:ClearAIWaypoints();
@@ -214,9 +211,6 @@ function SharedBehaviors.BrainSearch(AI, Owner, Abort)
214211
minDist = score;
215212
ClosestBrain = Act;
216213
end
217-
218-
local _ai, _ownr, _abrt = coroutine.yield(); -- wait until next frame
219-
if _abrt then return true end
220214
end
221215
end
222216

@@ -468,9 +462,8 @@ function SharedBehaviors.GoToWpt(AI, Owner, Abort)
468462
AI.deviceState = AHuman.DIGGING;
469463
obstacleState = Actor.DIGPAUSING;
470464
nextLatMove = Actor.LAT_STILL;
471-
sweepRange = math.min(math.pi*0.2, Owner.AimRange);
465+
sweepRange = math.min(math.pi*0.25, Owner.AimRange);
472466
StuckTimer:SetSimTimeLimitMS(6000);
473-
AI.Ctrl.AnalogAim = SceneMan:ShortestDistance(Owner.Pos, Waypoint.Pos, false).Normalized; -- aim in the direction of the next waypoint
474467
else
475468
digState = AHuman.NOTDIGGING;
476469
obstacleState = Actor.PROCEEDING;
@@ -619,6 +612,7 @@ function SharedBehaviors.GoToWpt(AI, Owner, Abort)
619612
if Owner.MOMoveTarget and MovableMan:ValidMO(Owner.MOMoveTarget) then
620613
local Trace = SceneMan:ShortestDistance(Owner.Pos, Owner.MOMoveTarget.Pos, false);
621614

615+
-- WTF is the following code for? It causes us to idle and do nothing forever??
622616
if Owner.MOMoveTarget.Team == Owner.Team then
623617
if Trace.Largest > Owner.Height * 0.3 + (Owner.MOMoveTarget.Height or 100) * 0.3 then
624618
Waypoint.Pos = Owner.MOMoveTarget.Pos;
@@ -725,9 +719,12 @@ function SharedBehaviors.GoToWpt(AI, Owner, Abort)
725719

726720
angDiff = math.asin(AimVec:Cross(DigTarget.Normalized)); -- The angle between DigTarget and AimVec
727721
if math.abs(angDiff) < 0.1 then
728-
sweepCW = not sweepCW; -- this is close enough, go in the other direction next frame
722+
AI.Ctrl.AnalogAim = DigTarget.Normalized; -- aim in the direction of the next waypoint
723+
sweepCW = not sweepCW;
729724
else
730-
AI.Ctrl.AnalogAim = (Vector(AimVec.X, AimVec.Y):RadRotate(-angDiff*0.15)).Normalized;
725+
local sweepSpeed = 2.5;
726+
local sweepDir = sweepCW and 1 or -1;
727+
AI.Ctrl.AnalogAim = (Vector(AimVec.X, AimVec.Y):RadRotate(sweepDir*TimerMan.AIDeltaTimeSecs*sweepSpeed)).Normalized;
731728
end
732729

733730
-- check if we are done when we get close enough to the waypoint
@@ -1012,7 +1009,7 @@ function SharedBehaviors.GoToWpt(AI, Owner, Abort)
10121009
end
10131010

10141011
-- movement commands
1015-
if (AI.Target and AI.BehaviorName ~= "AttackTarget") or (Owner.AIMode ~= Actor.AIMODE_SQUAD and (AI.BehaviorName == "ShootArea" or AI.BehaviorName == "FaceAlarm")) then
1012+
if (AI.Target and AI.BehaviorName ~= "AttackTarget" and not AI.PickupHD) or (Owner.AIMode ~= Actor.AIMODE_SQUAD and (AI.BehaviorName == "ShootArea" or AI.BehaviorName == "FaceAlarm")) then
10161013
if Owner.aggressive then -- the aggressive behavior setting makes the AI pursue waypoint at all times
10171014
AI.lateralMoveState = nextLatMove;
10181015
else

Data/Base.rte/Activities.ini

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ AddActivity = GAScripted
6363
6464
AddActivity = GAScripted
6565
PresetName = Wave Defense
66-
Description = Build a bunker and defend it against increasingly longer waves of AI-controlled enemies, with time to repair in between! Adjust the Difficulty to change wave difficulty.
66+
Description = Build a bunker and defend it against increasingly stronger waves of AI-controlled enemies, with time to repair in between! Adjust the Difficulty to change wave difficulty.
6767
SceneName = Ketanot Hills
6868
ScriptPath = Base.rte/Activities/WaveDefense.lua
6969
TeamOfPlayer1 = 1
@@ -294,13 +294,16 @@ AddActivity = GAScripted
294294
295295
AddActivity = GAScripted
296296
PresetName = Test Activity
297-
Description = Test your arsenal in peace and quiet witout any enemies.
297+
Description = Test your arsenal in peace and quiet without any enemies.
298298
TeamOfPlayer1 = 0
299-
TeamOfPlayer2 = 0
300-
TeamOfPlayer3 = 0
301-
TeamOfPlayer4 = 0
299+
TeamOfPlayer2 = 1
300+
TeamOfPlayer3 = 2
301+
TeamOfPlayer4 = 3
302302
MinTeamsRequired = 1
303303
Team1Funds = 100000
304+
Team2Funds = 100000
305+
Team3Funds = 100000
306+
Team4Funds = 100000
304307
ScriptPath = Base.rte/Activities/Test.lua
305308
LuaClassName = Test
306309
DefaultRequireClearPathToOrbit = 0

Data/Base.rte/Activities/BrainVsBrain.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,7 @@ function BrainvsBrain:CreateMediumDrop(xPosLZ)
625625
if craftMaxMass < 0 then
626626
craftMaxMass = math.huge;
627627
elseif craftMaxMass < 1 then
628-
if Craft.ClassName == "ACDropship" then
628+
if Craft.ClassName == "ACDropShip" then
629629
Craft = RandomACDropShip("Craft", 0); -- MaxMass not defined
630630
else
631631
Craft = RandomACRocket("Craft", 0); -- MaxMass not defined
@@ -685,7 +685,7 @@ function BrainvsBrain:CreateLightDrop(xPosLZ)
685685
if craftMaxMass < 0 then
686686
craftMaxMass = math.huge;
687687
elseif craftMaxMass < 1 then
688-
if Craft.ClassName == "ACDropship" then
688+
if Craft.ClassName == "ACDropShip" then
689689
Craft = RandomACDropShip("Craft", 0); -- MaxMass not defined
690690
else
691691
Craft = RandomACRocket("Craft", 0); -- MaxMass not defined
@@ -743,7 +743,7 @@ function BrainvsBrain:CreateScoutDrop(xPosLZ)
743743
if craftMaxMass < 0 then
744744
craftMaxMass = math.huge;
745745
elseif craftMaxMass < 1 then
746-
if Craft.ClassName == "ACDropship" then
746+
if Craft.ClassName == "ACDropShip" then
747747
Craft = RandomACDropShip("Craft", 0); -- MaxMass not defined
748748
else
749749
Craft = RandomACRocket("Craft", 0); -- MaxMass not defined

0 commit comments

Comments
 (0)