Skip to content
This repository was archived by the owner on Jan 5, 2024. It is now read-only.

Commit 86798f9

Browse files
committed
Merge branch 'development' into Bunker-Pieces
# Conflicts: # Base.rte/Scenes/Objects/Bunkers/BunkerBackgrounds/BunkerBackgrounds.ini # Base.rte/Scenes/Objects/Bunkers/BunkerModules/BunkerModules.ini # Base.rte/Scenes/Objects/Bunkers/BunkerSystems/Teleporters/TeleporterGlow.bmp Resolved manually
2 parents 76696ba + b7fb478 commit 86798f9

File tree

9,286 files changed

+58533
-55445
lines changed

Some content is hidden

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

9,286 files changed

+58533
-55445
lines changed

.github/CODEOWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@
1313

1414
#Sprite Owners
1515
*.bmp @spriters
16+
*.png @spriters
1617

1718
#Audio Owners
1819
*.wav @audio-makers
1920
*.ogg @audio-makers
21+
*.flac @audio-makers
2022
*.mp3 @audio-makers

.gitignore

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,24 +42,27 @@ luac.out
4242
*.x86_64
4343
*.hex
4444

45+
# Manifest files
46+
*.manifest
47+
4548
.vs/
49+
_Screenshots/
4650
Base.rte/Settings.ini
4751
Benchmark.rte/
4852
Scenes.rte/
4953
Metagames.rte/
50-
Microsoft.VC90.CRT.manifest
5154
DedicatedServer.bat
55+
DedicatedServerDebug.bat
5256

5357
Cortex Command Experimental Multiplayer Operations Guide.docx
5458

5559
allegro.log
56-
Cortex Command.exe.manifest
57-
Cortex Command.debug.ilk
5860
abortscreen.bmp
59-
MemCleanupInfo.txt
6061

62+
MemCleanupInfo.txt
6163
LogPublish.txt
6264
LogLoading.txt
65+
LogLoadingWarning.txt
6366
LogConsole.txt
6467
Console.dump.log
6568
Console.input.log

Base.rte/AI.ini

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ AddActor = AHuman
1111
GlobalAccScalar = 0
1212
ScriptPath = Base.rte/AI/PathFinder.lua
1313
SpriteFile = ContentFile
14-
FilePath = Base.rte/Null.bmp
14+
FilePath = Base.rte/Null.png
1515
AtomGroup = AtomGroup
1616
CopyOf = Null AtomGroup
1717
Health = 100
@@ -25,7 +25,7 @@ AddActor = AHuman
2525
HitsMOs = 0
2626
GetsHitByMOs = 0
2727
SpriteFile = ContentFile
28-
FilePath = Base.rte/Null.bmp
28+
FilePath = Base.rte/Null.png
2929
AtomGroup = AtomGroup
3030
CopyOf = Null AtomGroup
3131
FGArm = Arm
@@ -34,31 +34,31 @@ AddActor = AHuman
3434
HitsMOs = 0
3535
GetsHitByMOs = 0
3636
SpriteFile = ContentFile
37-
FilePath = Base.rte/Null.bmp
37+
FilePath = Base.rte/Null.png
3838
AtomGroup = AtomGroup
3939
CopyOf = Null AtomGroup
4040
Hand = ContentFile
41-
FilePath = Base.rte/Null.bmp
41+
FilePath = Base.rte/Null.png
4242
MaxLength = 0
4343
BGArm = Arm
4444
PresetName = Null Arm BG
4545
Mass = 0
4646
HitsMOs = 0
4747
GetsHitByMOs = 0
4848
SpriteFile = ContentFile
49-
FilePath = Base.rte/Null.bmp
49+
FilePath = Base.rte/Null.png
5050
AtomGroup = AtomGroup
5151
CopyOf = Null AtomGroup
5252
Hand = ContentFile
53-
FilePath = Base.rte/Null.bmp
53+
FilePath = Base.rte/Null.png
5454
MaxLength = 0
5555
FGLeg = Leg
5656
PresetName = Null Leg FG
5757
Mass = 0
5858
HitsMOs = 0
5959
GetsHitByMOs = 0
6060
SpriteFile = ContentFile
61-
FilePath = Base.rte/Null.bmp
61+
FilePath = Base.rte/Null.png
6262
AtomGroup = AtomGroup
6363
CopyOf = Null AtomGroup
6464
BGLeg = Leg
@@ -67,7 +67,7 @@ AddActor = AHuman
6767
HitsMOs = 0
6868
GetsHitByMOs = 0
6969
SpriteFile = ContentFile
70-
FilePath = Base.rte/Null.bmp
70+
FilePath = Base.rte/Null.png
7171
AtomGroup = AtomGroup
7272
CopyOf = Null AtomGroup
7373
HandGroup = AtomGroup
@@ -88,7 +88,7 @@ AddDevice = TDExplosive
8888
HitsMOs = 0
8989
GetsHitByMOs = 0
9090
SpriteFile = ContentFile
91-
FilePath = Base.rte/Null.bmp
91+
FilePath = Base.rte/Null.png
9292
Buyable = 0
9393
AtomGroup = AtomGroup
9494
CopyOf = Null AtomGroup
@@ -105,7 +105,7 @@ AddDevice = TDExplosive
105105
HitsMOs = 0
106106
GetsHitByMOs = 0
107107
SpriteFile = ContentFile
108-
FilePath = Base.rte/Null.bmp
108+
FilePath = Base.rte/Null.png
109109
Buyable = 0
110110
AtomGroup = AtomGroup
111111
CopyOf = Null AtomGroup
@@ -122,7 +122,7 @@ AddDevice = TDExplosive
122122
HitsMOs = 0
123123
GetsHitByMOs = 0
124124
SpriteFile = ContentFile
125-
FilePath = Base.rte/Null.bmp
125+
FilePath = Base.rte/Null.png
126126
Buyable = 0
127127
AtomGroup = AtomGroup
128128
CopyOf = Null AtomGroup

Base.rte/AI/CrabBehaviors.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ function CrabBehaviors.LookForTargets(AI, Owner)
4444
FoundMO = ToACRocket(FoundMO)
4545
elseif FoundMO.ClassName == "ACDropShip" then
4646
FoundMO = ToACDropShip(FoundMO)
47-
elseif FoundMO.ClassName == "ADoor" then
47+
elseif FoundMO.ClassName == "ADoor" and HumanBehaviors.GetProjectileData(Owner).pen * 0.9 > ToADoor(FoundMO).Door.Material.StructuralIntegrity then
4848
FoundMO = ToADoor(FoundMO)
4949
elseif FoundMO.ClassName == "Actor" then
5050
FoundMO = ToActor(FoundMO)

Base.rte/AI/DropShipAI.lua

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,13 @@ end
1010
function UpdateAI(self)
1111
self.AI:Update(self)
1212
end
13+
14+
function Update(self)
15+
--Re-orient the craft at 180 degrees to help rotational AI
16+
if self.RotAngle > math.pi then
17+
self.RotAngle = self.RotAngle - (math.pi * 2);
18+
end
19+
if self.RotAngle < -math.pi then
20+
self.RotAngle = self.RotAngle + (math.pi * 2);
21+
end
22+
end

Base.rte/AI/HumanAI.lua

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ function Create(self)
1111
self.visibleInventory = true;
1212
end
1313
function Update(self)
14-
1514
self.controller = self:GetController();
1615

1716
if self.alternativeGib then
@@ -21,7 +20,7 @@ function Update(self)
2120
HumanFunctions.DoAutomaticEquip(self);
2221
end
2322
if self.armSway then
24-
HumanFunctions.DoArmSway(self, (self.Health / self.MaxHealth)); --Argument: shove strength
23+
HumanFunctions.DoArmSway(self, (self.Health/self.MaxHealth)); --Argument: shove strength
2524
end
2625
if self.visibleInventory then
2726
HumanFunctions.DoVisibleInventory(self, false); --Argument: whether to show all items

Base.rte/AI/HumanBehaviors.lua

Lines changed: 40 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,14 @@ function HumanBehaviors.GetTeamShootingSkill(team)
99
end
1010

1111
local aimSpeed, aimSkill
12-
if skill < Activity.AVERAGESKILL then -- the AI shoot later and tracks the target slower
13-
aimSpeed = -0.025 * skill + 3.3 -- affects the delay before the shooting starts [3.30 .. 1.55]
14-
aimSkill = -0.011 * skill + 2.2 -- affects the precision of the shots [2.20 .. 1.43]
15-
elseif skill >= Activity.UNFAIRSKILL then
16-
aimSpeed = 0.05
17-
aimSkill = 0.05
12+
if skill >= Activity.UNFAIRSKILL then
13+
aimSpeed = 0.04
14+
aimSkill = 0.04
1815
else
1916
-- the AI shoot sooner and with slightly better precision
20-
aimSpeed = 1/(0.55/(2.9-math.exp(skill*0.01))) -- [1.42 .. 0.38]
21-
aimSkill = 1/(0.65/(3.0-math.exp(skill*0.01))) -- [1.36 .. 0.48]
17+
aimSpeed = 1/(0.65/(2.9-math.exp(skill*0.01)))
18+
aimSkill = 1/(0.75/(3.0-math.exp(skill*0.01)))
2219
end
23-
2420
return aimSpeed, aimSkill, skill
2521
end
2622

@@ -36,10 +32,10 @@ end
3632

3733
-- spot targets by casting a ray in a random direction
3834
function HumanBehaviors.LookForTargets(AI, Owner, Skill)
39-
local viewAngDeg = RangeRand(50, 120) * Owner.Perceptiveness * (0.5 + Skill / 200)
35+
local viewAngDeg = RangeRand(50, 120) * Owner.Perceptiveness * (0.5 + Skill/200)
4036
if AI.deviceState == AHuman.AIMING then
4137
AI.Ctrl:SetState(Controller.AIM_SHARP, true) -- reinforce sharp aim controller state to enable SharpLength in LookForMOs
42-
viewAngDeg = 15 * Owner.Perceptiveness + (Skill / 10)
38+
viewAngDeg = 15 * Owner.Perceptiveness + (Skill/10)
4339
end
4440

4541
local FoundMO = Owner:LookForMOs(viewAngDeg, rte.grassID, false)
@@ -84,6 +80,8 @@ function HumanBehaviors.CheckEnemyLOS(AI, Owner, Skill)
8480

8581
local LookTarget
8682
if Enemy.ClassName == "ADoor" then
83+
-- TO-DO: use explosive weapons on doors?
84+
8785
local Door = ToADoor(Enemy).Door
8886
if Door and Door:IsAttached() then
8987
LookTarget = Door.Pos
@@ -489,7 +487,6 @@ function HumanBehaviors.Sentry(AI, Owner, Abort)
489487
aimTime = RangeRand(6000, 12000) * angDiff
490488
AI.deviceState = AHuman.AIMING
491489
end
492-
493490
if Owner.AIMode ~= Actor.AIMODE_SQUAD then
494491
if SceneMan:ShortestDistance(Owner.Pos, AI.SentryPos, false).Magnitude > Owner.Height*0.7 then
495492
AI.SentryPos = SceneMan:MovePointToGround(AI.SentryPos, Owner.Height*0.25, 3)
@@ -500,8 +497,7 @@ function HumanBehaviors.Sentry(AI, Owner, Abort)
500497
elseif AI.SentryFacing and Owner.HFlipped ~= AI.SentryFacing then
501498
Owner.HFlipped = AI.SentryFacing -- turn to the direction we have been order to guard
502499
break -- restart this behavior
503-
elseif math.random() < Owner.Perceptiveness then
504-
500+
elseif AI.TargetLostTimer:IsPastSimTimeLimit() and math.random() < Owner.Perceptiveness then
505501
-- turn around occasionally if there is open space behind our back
506502
local backAreaRay = Vector(-math.random(FrameMan.PlayerScreenWidth/4, FrameMan.PlayerScreenWidth/2) * Owner.FlipFactor, 0):DegRotate(math.random(-25, 25) * Owner.Perceptiveness)
507503
if not SceneMan:CastStrengthRay(Owner.EyePos, backAreaRay, 10, Vector(), 10, rte.grassID, SceneMan.SceneWrapsX) then
@@ -1682,13 +1678,12 @@ function HumanBehaviors.GoToWpt(AI, Owner, Abort)
16821678
else
16831679
nextLatMove = Actor.LAT_STILL
16841680
end
1685-
if not (Owner.FGLeg and Owner.BGLeg) and not AI.jump then
1686-
Owner:GetController():SetState(Controller.BODY_CROUCH,true) -- crawl if no legs
1687-
end
16881681
end
16891682
elseif ((CurrDist.X < -5 and Owner.HFlipped) or (CurrDist.X > 5 and not Owner.HFlipped)) and math.abs(Owner.Vel.X) < 1 then
16901683
-- no legs, jump forward
16911684
AI.jump = true
1685+
elseif not AI.jump then
1686+
AI.proneState = AHuman.GOPRONE
16921687
end
16931688

16941689
if Waypoint.Type == "right" then
@@ -1821,7 +1816,7 @@ function HumanBehaviors.GoToWpt(AI, Owner, Abort)
18211816
local delta = SceneMan:ShortestDistance(Waypoint.Pos, FallPos, false).Magnitude - Facings[1].range
18221817
if delta < 1 then
18231818
AI.jump = false
1824-
elseif AI.flying or delta > 15 then
1819+
elseif AI.flying or delta > 25 then
18251820
AI.jump = true
18261821
nextAimAngle = Owner:GetAimAngle(false) * 0.5 + Facings[1].aim * 0.5 -- adjust jetpack nozzle direction
18271822
nextLatMove = Actor.LAT_STILL
@@ -2146,32 +2141,32 @@ function HumanBehaviors.GetProjectileData(Owner)
21462141

21472142
-- find muzzle velocity
21482143
PrjDat.vel = Weapon:GetAIFireVel()
2149-
21502144
-- half of the theoretical upper limit for the total amount of material strength this weapon can destroy in 250ms
2151-
PrjDat.pen = Weapon:GetAIPenetration() * math.max((Weapon.RateOfFire / 240), 1)
21522145

21532146
PrjDat.g = SceneMan.GlobalAcc.Y * 0.67 * Weapon:GetBulletAccScalar() -- underestimate gravity
21542147
PrjDat.vsq = PrjDat.vel^2 -- muzzle velocity squared
21552148
PrjDat.vqu = PrjDat.vsq^2 -- muzzle velocity quad
21562149
PrjDat.drg = 1 - Projectile.AirResistance * TimerMan.DeltaTimeSecs -- AirResistance is stored as the ini-value times 60
21572150
PrjDat.thr = math.min(Projectile.AirThreshold, PrjDat.vel)
2151+
PrjDat.pen = (Projectile.Mass * Projectile.Sharpness * PrjDat.vel) * PrjDat.drg
21582152

21592153
-- estimate theoretical max range with ...
21602154
local lifeTime = Weapon:GetAIBulletLifeTime()
21612155
if lifeTime < 1 then -- infinite life time
21622156
PrjDat.rng = math.huge
21632157
elseif PrjDat.drg < 1 then -- AirResistance
21642158
PrjDat.rng = 0
2165-
local threshold = PrjDat.thr * GetPPM() * TimerMan.DeltaTimeSecs -- AirThreshold in pixels/frame
2166-
local vel = PrjDat.vel * GetPPM() * TimerMan.DeltaTimeSecs -- muzzle velocity in pixels/frame
2159+
local threshold = PrjDat.thr * rte.PxTravelledPerFrame -- AirThreshold in pixels/frame
2160+
local vel = PrjDat.vel * rte.PxTravelledPerFrame -- muzzle velocity in pixels/frame
2161+
21672162
for _ = 0, math.ceil(lifeTime/TimerMan.DeltaTimeMS) do
21682163
PrjDat.rng = PrjDat.rng + vel
21692164
if vel > threshold then
21702165
vel = vel * PrjDat.drg
21712166
end
21722167
end
21732168
else -- no AirResistance
2174-
PrjDat.rng = PrjDat.vel * GetPPM() * TimerMan.DeltaTimeSecs * (lifeTime / TimerMan.DeltaTimeMS)
2169+
PrjDat.rng = PrjDat.vel * rte.PxTravelledPerFrame * (lifeTime / TimerMan.DeltaTimeMS)
21752170
end
21762171

21772172
-- Artificially decrease reported range to make sure AI
@@ -2629,13 +2624,13 @@ end
26292624
-- throw a grenade at the selected target
26302625
function HumanBehaviors.ThrowTarget(AI, Owner, Abort)
26312626
local ThrowTimer = Timer()
2632-
local aimTime = 1000
2627+
local aimTime = Owner.ThrowPrepTime
26332628
local scan = 0
26342629
local miss = 0 -- stop scanning after a few missed attempts
26352630
local AimPoint, Dist, MO, ID, rootID, LOS, aim
2636-
2631+
26372632
AI.TargetLostTimer:SetSimTimeLimitMS(1500)
2638-
2633+
26392634
while true do
26402635
if not MovableMan:ValidMO(AI.Target) then
26412636
break
@@ -2649,8 +2644,11 @@ function HumanBehaviors.ThrowTarget(AI, Owner, Abort)
26492644
else
26502645
AI.fire = false
26512646
end
2652-
else
2653-
break -- no grenades left
2647+
else -- no grenades left, continue attack
2648+
if not (Owner.AIMode == Actor.AIMODE_SENTRY or Owner.AIMode == Actor.AIMODE_SQUAD) then
2649+
AI:CreateAttackBehavior(Owner)
2650+
end
2651+
break
26542652
end
26552653
else
26562654
if scan < 1 then
@@ -2715,7 +2713,7 @@ function HumanBehaviors.ThrowTarget(AI, Owner, Abort)
27152713
end
27162714
elseif MO.ClassName == "ACrab" then
27172715
AI.Target = ToACrab(MO)
2718-
local Legs = AI.Target.LFGLeg or AI.Target.LFGLeg or AI.Target.LBGLeg or AI.Target.RFGLeg -- the legs
2716+
local Legs = AI.Target.LeftFGLeg or AI.Target.RightFGLeg or AI.Target.LeftBGLeg or AI.Target.RightFGLeg -- the legs
27192717
if Legs then
27202718
AimPoint = Legs.Pos
27212719
end
@@ -2747,13 +2745,13 @@ function HumanBehaviors.ThrowTarget(AI, Owner, Abort)
27472745
aim = HumanBehaviors.GetGrenadeAngle(AimPoint, Vector(), Grenade.MuzzlePos, Grenade.MaxThrowVel)
27482746
if aim then
27492747
ThrowTimer:Reset()
2750-
aimTime = RangeRand(1000, 1200)
2748+
aimTime = Owner.ThrowPrepTime * RangeRand(0.9, 1.1)
27512749
local maxAim = aim
27522750

27532751
-- try again with an average throw vel
27542752
aim = HumanBehaviors.GetGrenadeAngle(AimPoint, Vector(), Grenade.MuzzlePos, (Grenade.MaxThrowVel+Grenade.MinThrowVel)/2)
27552753
if aim then
2756-
aimTime = RangeRand(450, 550)
2754+
aimTime = Owner.ThrowPrepTime * RangeRand(0.45, 0.55)
27572755
else
27582756
aim = maxAim
27592757
end
@@ -2829,24 +2827,22 @@ function HumanBehaviors.AttackTarget(AI, Owner, Abort)
28292827
local meleeDist = 0
28302828
local startPos = Vector(Owner.EyePos.X, Owner.EyePos.Y)
28312829

2832-
if Owner.EquippedItem then
2833-
if Owner.EquippedItem:HasObjectInGroup("Tools - Diggers") or Owner.EquippedItem:HasObjectInGroup("Weapons - Melee") then
2834-
meleeDist = Owner.Radius + 25
2835-
startPos = Vector(Owner.EquippedItem.Pos.X, Owner.EquippedItem.Pos.Y)
2836-
end
2830+
if Owner:EquipDeviceInGroup("Tools - Diggers", true) or Owner:EquipDeviceInGroup("Weapons - Melee", true) then
2831+
meleeDist = Owner.Radius + 25
2832+
startPos = Vector(Owner.EquippedItem.Pos.X, Owner.EquippedItem.Pos.Y)
28372833
elseif Owner.armSway then
2838-
if Owner.FGArm then
2839-
meleeDist = Owner.Radius + Owner.FGArm.Radius
2840-
startPos = Owner.FGArm.Pos
2841-
elseif Owner.BGArm then
2842-
meleeDist = Owner.Radius + Owner.BGArm.Radius
2843-
startPos = Owner.BGArm.Pos
2834+
local arm = Owner.FGArm or Owner.BGArm
2835+
if arm then
2836+
meleeDist = arm.Radius + arm.Radius
2837+
startPos = arm.Pos
28442838
end
28452839
end
28462840
if meleeDist > 0 then
2847-
local dist = SceneMan:ShortestDistance(startPos, AI.Target.Pos, false)
2841+
local attackPos = (AI.Target.ClassName == "ADoor" and ToADoor(AI.Target).Door and ToADoor(AI.Target).Door:IsAttached()) and ToADoor(AI.Target).Door.Pos or AI.Target.Pos
2842+
local dist = SceneMan:ShortestDistance(startPos, attackPos, false)
28482843
if dist.Magnitude < meleeDist then
2849-
AI.Ctrl.AnalogAim = SceneMan:ShortestDistance(Owner.EyePos, AI.Target.Pos, false).Normalized
2844+
AI.lateralMoveState = Actor.LAT_STILL
2845+
AI.Ctrl.AnalogAim = SceneMan:ShortestDistance(Owner.EyePos, attackPos, false).Normalized
28502846
AI.fire = true
28512847
else
28522848
AI.fire = false

0 commit comments

Comments
 (0)