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

Commit 6110879

Browse files
GacyrGacyr
authored andcommitted
Merge branch 'development' into pawnis-sound-attenuation
2 parents d54e065 + e3a1da2 commit 6110879

Some content is hidden

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

59 files changed

+132
-117
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ Scenes.rte/
4949
Metagames.rte/
5050
Microsoft.VC90.CRT.manifest
5151
DedicatedServer.bat
52+
DedicatedServerDebug.bat
5253

5354
Cortex Command Experimental Multiplayer Operations Guide.docx
5455

Base.rte/AI/HumanBehaviors.lua

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ function HumanBehaviors.GetGrenadeAngle(AimPoint, TargetVel, StartPos, muzVel)
257257
Dist = SceneMan:ShortestDistance(StartPos, AimPoint, false)
258258
end
259259

260-
Dist = Dist / FrameMan.PPM -- convert from pixels to meters
260+
Dist = Dist / GetPPM() -- convert from pixels to meters
261261
local velSqr = math.pow(muzVel, 2)
262262
local gravity = SceneMan.GlobalAcc.Y * 0.67 -- underestimate gravity
263263
local root = math.sqrt(velSqr*velSqr - gravity*(gravity*Dist.X*Dist.X+2*-Dist.Y*velSqr))
@@ -1715,8 +1715,8 @@ function HumanBehaviors.GoToWpt(AI, Owner, Abort)
17151715
-- predict jetpack movement when jumping and there is a target (check one direction)
17161716
local jetStrength = AI.jetImpulseFactor / Owner.Mass
17171717
local t = math.min(0.4, Owner.JetTimeLeft*0.001)
1718-
local PixelVel = Owner.Vel * (FrameMan.PPM * t)
1719-
local Accel = SceneMan.GlobalAcc * FrameMan.PPM
1718+
local PixelVel = Owner.Vel * (GetPPM() * t)
1719+
local Accel = SceneMan.GlobalAcc * GetPPM()
17201720

17211721
-- a burst use 10x more fuel
17221722
if Owner.Jetpack:CanTriggerBurst() then
@@ -1779,8 +1779,8 @@ function HumanBehaviors.GoToWpt(AI, Owner, Abort)
17791779
-- predict jetpack movement...
17801780
local jetStrength = AI.jetImpulseFactor / Owner.Mass
17811781
local t = math.min(0.4, Owner.JetTimeLeft*0.001)
1782-
local PixelVel = Owner.Vel * (FrameMan.PPM * t)
1783-
local Accel = SceneMan.GlobalAcc * FrameMan.PPM
1782+
local PixelVel = Owner.Vel * (GetPPM() * t)
1783+
local Accel = SceneMan.GlobalAcc * GetPPM()
17841784

17851785
-- a burst use 10x more fuel
17861786
if Owner.Jetpack:CanTriggerBurst() then
@@ -2162,16 +2162,16 @@ function HumanBehaviors.GetProjectileData(Owner)
21622162
PrjDat.rng = math.huge
21632163
elseif PrjDat.drg < 1 then -- AirResistance
21642164
PrjDat.rng = 0
2165-
local threshold = PrjDat.thr * FrameMan.PPM * TimerMan.DeltaTimeSecs -- AirThreshold in pixels/frame
2166-
local vel = PrjDat.vel * FrameMan.PPM * TimerMan.DeltaTimeSecs -- muzzle velocity in pixels/frame
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
21672167
for _ = 0, math.ceil(lifeTime/TimerMan.DeltaTimeMS) do
21682168
PrjDat.rng = PrjDat.rng + vel
21692169
if vel > threshold then
21702170
vel = vel * PrjDat.drg
21712171
end
21722172
end
21732173
else -- no AirResistance
2174-
PrjDat.rng = PrjDat.vel * FrameMan.PPM * TimerMan.DeltaTimeSecs * (lifeTime / TimerMan.DeltaTimeMS)
2174+
PrjDat.rng = PrjDat.vel * GetPPM() * TimerMan.DeltaTimeSecs * (lifeTime / TimerMan.DeltaTimeMS)
21752175
end
21762176

21772177
-- Artificially decrease reported range to make sure AI
@@ -2931,7 +2931,7 @@ function HumanBehaviors.GetAngleToHit(PrjDat, Dist)
29312931
return Dist.AbsRadAngle
29322932
else -- compensate for gravity
29332933
local rootSq, muzVelSq
2934-
local D = Dist / FrameMan.PPM -- convert from pixels to meters
2934+
local D = Dist / GetPPM() -- convert from pixels to meters
29352935
if PrjDat.drg < 1 then -- compensate for air resistance
29362936
local rng = D.Magnitude
29372937
local timeToTarget = math.floor((rng / math.max(PrjDat.vel*PrjDat.drg^math.floor(rng/(PrjDat.vel+1)+0.5), PrjDat.thr)) / TimerMan.DeltaTimeSecs) -- estimate time of flight in frames

Base.rte/AI/NativeCrabAI.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function NativeCrabAI:Create(Owner)
2323
Members.AlarmTimer:SetSimTimeLimitMS(500)
2424

2525
-- check if this team is controlled by a human
26-
if ActivityMan:GetActivity():IsPlayerTeam(Owner.Team) then
26+
if ActivityMan:GetActivity():IsHumanTeam(Owner.Team) then
2727
Members.isPlayerOwned = true
2828
Members.PlayerInterferedTimer = Timer()
2929
Members.PlayerInterferedTimer:SetSimTimeLimitMS(500)

Base.rte/AI/NativeDropShipAI.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function NativeDropShipAI:Create(Owner)
3636

3737
-- Check if this team is controlled by a human
3838
if Owner.AIMode == Actor.AIMODE_DELIVER and Owner:IsInventoryEmpty() and
39-
ActivityMan:GetActivity():IsPlayerTeam(Owner.Team)
39+
ActivityMan:GetActivity():IsHumanTeam(Owner.Team)
4040
then
4141
Owner.AIMode = Actor.AIMODE_STAY -- Stop the craft from returning to orbit immediately
4242
end

Base.rte/AI/NativeHumanAI.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ function NativeHumanAI:Create(Owner)
4444
end
4545

4646
-- check if this team is controlled by a human
47-
if ActivityMan:GetActivity():IsPlayerTeam(Owner.Team) then
47+
if ActivityMan:GetActivity():IsHumanTeam(Owner.Team) then
4848
Members.isPlayerOwned = true
4949
Members.PlayerInterferedTimer = Timer()
5050
Members.PlayerInterferedTimer:SetSimTimeLimitMS(500)
@@ -56,8 +56,8 @@ function NativeHumanAI:Create(Owner)
5656
Owner.Jetpack.Throttle = 0.15 -- increase jetpack strength slightly to compensate for AI ineptitude
5757
end
5858

59-
Members.jetImpulseFactor = Owner.Jetpack:EstimateImpulse(false) * FrameMan.PPM / TimerMan.DeltaTimeSecs
60-
Members.jetBurstFactor = (Owner.Jetpack:EstimateImpulse(true) * FrameMan.PPM / TimerMan.DeltaTimeSecs - Members.jetImpulseFactor) * math.pow(TimerMan.DeltaTimeSecs, 2) * 0.5
59+
Members.jetImpulseFactor = Owner.Jetpack:EstimateImpulse(false) * GetPPM() / TimerMan.DeltaTimeSecs
60+
Members.jetBurstFactor = (Owner.Jetpack:EstimateImpulse(true) * GetPPM() / TimerMan.DeltaTimeSecs - Members.jetImpulseFactor) * math.pow(TimerMan.DeltaTimeSecs, 2) * 0.5
6161
Members.minBurstTime = math.min(Owner.Jetpack.BurstSpacing*2, Owner.JetTimeTotal*0.99) -- in milliseconds
6262
end
6363

Base.rte/AI/NativeTurretAI.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ function NativeTurretAI:Create(Owner)
2121
Members.AlarmTimer:SetSimTimeLimitMS(500)
2222

2323
-- check if this team is controlled by a human
24-
if ActivityMan:GetActivity():IsPlayerTeam(Owner.Team) then
24+
if ActivityMan:GetActivity():IsHumanTeam(Owner.Team) then
2525
Members.isPlayerOwned = true
2626
Members.PlayerInterferedTimer = Timer()
2727
Members.PlayerInterferedTimer:SetSimTimeLimitMS(500)

Base.rte/AI/RocketAI.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ function Create(self)
5353

5454
-- Check if this team is controlled by a human
5555
if self.AIMode == Actor.AIMODE_DELIVER and self:IsInventoryEmpty() and
56-
ActivityMan:GetActivity():IsPlayerTeam(self.Team)
56+
ActivityMan:GetActivity():IsHumanTeam(self.Team)
5757
then
5858
self.AIMode = Actor.AIMODE_STAY; -- Stop the craft from returning to orbit immediately
5959
end

Base.rte/Activities.ini

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,9 @@ AddActivity = GATutorial
66
PresetName = Tutorial Mission
77
SceneName = Tutorial Bunker
88
InCampaignStage = 1
9-
PlayerCount = 1
109
TeamOfPlayer1 = 0
1110
TeamOfPlayer2 = 1
12-
FundsOfTeam1 = 1500
11+
Team1Funds = 1500
1312
CPUTeam = 1
1413
MaxPlayerSupport = 1
1514

@@ -19,12 +18,10 @@ AddActivity = GAScripted
1918
Description = Survive waves of AI-controlled enemies until they run out of gold, skirmish against human players, or both! Adjust the Difficulty to change AI funds and spawn frequency.
2019
SceneName = Ketanot Hills
2120
ScriptFile = Base.rte/Activities/SkirmishDefense.lua
22-
PlayerCount = 3
2321
TeamOfPlayer1 = 0
2422
TeamOfPlayer2 = 1
2523
TeamOfPlayer3 = 2
2624
TeamOfPlayer4 = 3
27-
TeamCount = 4
2825
MinTeamsRequired = 2
2926
LuaClassName = SkirmishDefense
3027
DeployUnitsSwitchEnabled = 1
@@ -36,12 +33,10 @@ AddActivity = GAScripted
3633
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.
3734
SceneName = Ketanot Hills
3835
ScriptFile = Base.rte/Activities/WaveDefense.lua
39-
PlayerCount = 4
4036
TeamOfPlayer1 = 0
4137
TeamOfPlayer2 = 0
4238
TeamOfPlayer3 = 0
4339
TeamOfPlayer4 = 0
44-
TeamCount = 2
4540
CPUTeam = 1
4641
MinTeamsRequired = 2
4742
LuaClassName = WaveDefense
@@ -54,9 +49,7 @@ AddActivity = GAScripted
5449
Description = Survive with only one actor and no backups!
5550
SceneName = Ketanot Hills
5651
ScriptFile = Base.rte/Activities/OneManArmy.lua
57-
PlayerCount = 1
5852
TeamOfPlayer1 = 0
59-
TeamCount = 2
6053
CPUTeam = 1
6154
MaxPlayerSupport = 1
6255
LuaClassName = OneManArmy
@@ -69,9 +62,7 @@ AddActivity = GAScripted
6962
Description = Build a base, then kill all the enemies!
7063
SceneName = Ketanot Hills
7164
ScriptFile = Base.rte/Activities/Massacre.lua
72-
PlayerCount = 1
7365
TeamOfPlayer1 = 0
74-
TeamCount = 2
7566
CPUTeam = 1
7667
LuaClassName = Massacre
7768
DeployUnitsSwitchEnabled = 1
@@ -83,9 +74,7 @@ AddActivity = GAScripted
8374
Description = Build a base, then survive until the time is up!
8475
SceneName = Ketanot Hills
8576
ScriptFile = Base.rte/Activities/Survival.lua
86-
PlayerCount = 1
8777
TeamOfPlayer1 = 0
88-
TeamCount = 2
8978
CPUTeam = 1
9079
LuaClassName = Survival
9180
DeployUnitsSwitchEnabled = 1
@@ -99,7 +88,6 @@ AddActivity = GAScripted
9988
ScriptFile = Base.rte/Activities/BrainVsBrain.lua
10089
InCampaignStage = 1
10190
LuaClassName = BrainvsBrain
102-
TeamCount = 2
10391
Team1Name = Red Team
10492
Team2Name = Green Team
10593
MinTeamsRequired = 1
@@ -110,9 +98,7 @@ AddActivity = GAScripted
11098
Description = Build a base, then dig up as much gold as you can!
11199
SceneName = Ketanot Hills
112100
ScriptFile = Base.rte/Activities/Harvester.lua
113-
PlayerCount = 1
114101
TeamOfPlayer1 = 0
115-
TeamCount = 2
116102
CPUTeam = 1
117103
LuaClassName = Harvester
118104
DeployUnitsSwitchEnabled = 1
@@ -127,7 +113,6 @@ AddActivity = GAScripted
127113
InCampaignStage = 1
128114
LuaClassName = BunkerBreach
129115
CPUTeam = 1
130-
TeamCount = 1
131116
Team1Name = Players
132117
Team2Name = AI
133118
MinTeamsRequired = 1
@@ -149,7 +134,6 @@ AddActivity = GAScripted
149134
InCampaignStage = 1
150135
LuaClassName = Siege
151136
CPUTeam = 0
152-
TeamCount = 2
153137
Team1Name = AI
154138
Team2Name = Players
155139
MinTeamsRequired = 1
@@ -169,9 +153,7 @@ AddActivity = GAScripted
169153
Description = Keep your rocket alive until time is up!
170154
SceneName = Ketanot Hills
171155
ScriptFile = Base.rte/Activities/KeepieUppie.lua
172-
PlayerCount = 1
173156
TeamOfPlayer1 = 0
174-
TeamCount = 2
175157
CPUTeam = 1
176158
MaxPlayerSupport = 1
177159
LuaClassName = KeepieUppie
@@ -184,9 +166,7 @@ AddActivity = GAScripted
184166
Description = Survive with only one actor and no backups! Enemy will only use diggers, but the harder the difficulty the less potent weaponry you start out with and the longer you have to survive.
185167
SceneName = Fredeleig Plains
186168
ScriptFile = Base.rte/Activities/OneManArmyDiggers.lua
187-
PlayerCount = 1
188169
TeamOfPlayer1 = 0
189-
TeamCount = 2
190170
CPUTeam = 1
191171
MaxPlayerSupport = 1
192172
LuaClassName = OneManArmy
@@ -205,7 +185,6 @@ AddActivity = GAScripted
205185
TeamOfPlayer2 = 0
206186
TeamOfPlayer3 = 0
207187
TeamOfPlayer4 = 0
208-
TeamCount = 1
209188
MinTeamsRequired = 1
210189
Team1Funds = 100000
211190
DeployUnitsSwitchEnabled = 1
@@ -220,7 +199,6 @@ AddActivity = GAScripted
220199
TeamOfPlayer2 = 0
221200
TeamOfPlayer3 = 0
222201
TeamOfPlayer4 = 0
223-
TeamCount = 1
224202
MinTeamsRequired = 1
225203
Team1Funds = 100000
226204
DeployUnitsSwitchEnabled = 1

Base.rte/Constants.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ rte.StartingFundsScale = 1.0;
2121
rte.PassengerMax = 3; -- Deprecated. Use 'Craft.MaxPassengers' instead
2222
rte.DiggersRate = 0.4
2323
rte.MetabaseArea = "MetabaseServiceArea"
24-
rte.PxTravelledPerFrame = FrameMan.PPM * TimerMan.DeltaTimeSecs;
24+
rte.PxTravelledPerFrame = GetPPM() * TimerMan.DeltaTimeSecs;
2525

2626
-- Materials
2727
rte.airID = 0;

Base.rte/Devices/Explosives/FragGrenade/FragGrenade.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ AddAmmo = MOSParticle
1111
SpriteFile = ContentFile
1212
FilePath = Base.rte/Devices/Explosives/FragGrenade/FragGrenadePin.bmp
1313
FrameCount = 8
14+
SpriteAnimMode = 7
1415
SpriteOffset = Vector
1516
X = -2
1617
Y = -2
@@ -19,7 +20,6 @@ AddAmmo = MOSParticle
1920
Material = Material
2021
PresetName = Scrap Metal
2122
TrailLength = 0
22-
Framerate = 10
2323

2424

2525
///////////////////////////////////////////////////////////////////////

0 commit comments

Comments
 (0)