Skip to content

Commit c9859e9

Browse files
authored
Merge pull request #145 from cortex-command-community/better-fast-movement
Improved Navigation
2 parents 7381a0d + 00d4756 commit c9859e9

File tree

83 files changed

+1346
-988
lines changed

Some content is hidden

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

83 files changed

+1346
-988
lines changed

CHANGELOG.md

Lines changed: 47 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,16 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
1616
New `Actor` Lua property `JumpHeight` (R) to estimate the jump height of the actor (in metres), based on the actor's jetpack and weight. Actors without a jetpack return 0.
1717
The new function `GetPathFindingFlyingJumpHeight()` can be used to get a jumpHeight that allows flying (i.e infinite jump height). This is also the value that `ACRocket`s and `ACDropships` return for `JumpHeight`.
1818

19+
- Improved locomotion.
20+
Added the ability to run. When running, you cannot sharpaim whatsoever.
21+
Added the ability to manually crouch. When crouching, your sharpaim distance is slightly increased.
22+
Players on PC can enable running by holding the shift key, or crouch by holding control. Players using the arrow keys can use right ctrl/shift. Controllers can run by clicking in the left stick, or crouch by holding the left stick down. Prone on controllers is now performed by clicking in the right stick. SNES/d-pad controllers run using the right bumper.
23+
Prone input now immediately throws you to the ground instead of crouching first.
24+
Added new `MovementState` type `RUN` for scripts.
25+
Added new `Controller` state `WALKCROUCH` for crouching, and `PRONE` for prone. The existing `CROUCH` state has been deprecated, as it referred to PRONE.
26+
Added new `Actor` INI and Lua (R/W) property `CanRun` which denotes whether the Actor can run or not.
27+
Added new `Actor` INI and Lua (R/W) property `CrouchWalkSpeedMultiplier` which is a walking speed multiplier when at max crouch amount.
28+
1929
- New music system, including a dynamic horizontal sequencing system, under the new music manager `MusicMan`.
2030
`PlayDynamicSong(string songName, string songSectionName, bool playImmediately, bool playTransition, bool smoothFade)` to play a new DynamicSong.
2131
`SetNextDynamicSongSection(string songSectionName, bool playImmediately, bool playTransition, bool smoothFade)` to queue a new DynamicSongSection for the currently playing song.
@@ -31,19 +41,22 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
3141
- New `SoundContainer` features.
3242
Lua property `Paused` (R/W) to pause or unpause all sounds of a SoundContainer. Newly played sounds will not begin playback until unpaused.
3343
Lua function `GetAudibleVolume` to get the real audible volume of a SoundContainer's sounds as a float from 0 to 1. This accounts for literally everything, including game volume.
34-
44+
45+
- New `LimbPath` features.
46+
New `LimbPath` INI and Lua (R/W) property `BaseTravelSpeedMultiplier` which is a multiplier on the TravelSpeed of that LimbPath, on top of any other gameplay multipliers like from crouching.
47+
New `LimbPath` INI and Lua (R/W) property `BaseScaleMultiplier`, which is a vector. This will scale the X/Y axes of the limbpath accordingly, allowing for easily adjusting limbpaths to differently sized actors, on top of any other gameplay multipliers like from running.
48+
New `LimbPath` INI property `SegmentEndedThreshold`, which defines the distance the limb must be from the end of the segment before it's considered complete. This defaults to 2.5.
49+
Exposed `LimbPath` properties `TravelSpeed` and `PushForce` to Lua (R/W).
50+
3551
- New `AEmitter` and `PEmitter` INI and Lua (R/W) property `PlayBurstSound` which denotes whether the BurstSound should play when appropriate. This should not be confused for a trigger - it's just a enable/disable toggle to avoid having to remove and add BurstSound altogether.
3652

3753
- Allow lua scripts to use LuaJIT's BitOp module (see https://bitop.luajit.org/api.html)
38-
54+
3955
</details>
4056

4157
<details><summary><b>Changed</b></summary>
4258

43-
- Conquest activities will once again fall-back to using base dropships and rockets if a random selection of the selected tech's craft can't find one capable of carrying passengers and/or cargo.
44-
45-
- All music-related functionality from AudioMan has been removed due to the addition of the MusicMan. Generic DynamicSongs have been put in to use instead.
46-
Mod activities that used to queue up all the vanilla music should now instead call, for example, `MusicMan:PlayDynamicSong("Generic Battle Music")`
59+
- Improved navigation, making running and fast walkpaths much more consistent.
4760

4861
- Increased fog-of-war resolution in all vanilla activities, and conquest, from 20x20 to 4x4.
4962
The Ronin Scrambler, the basic scanner, and `SceneMan:CastUnseenRay` have been changed to accomodate fog-of-war resolutions as fine as 1x1 and as course as 20x20.
@@ -52,12 +65,24 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5265
- All vanilla scenario activities have had their settings polished, respecting settings which make sense and disabling settings which don't.
5366
You can now have fog of war in the test scene, and can no longer require path to orbit in Zero-G Diggers-Only One Man Army.
5467

55-
- The Signal Hunt activity no longer has a preview image, as it was not formatted correctly and spoiled the interior structure of the cave.
68+
- Conquest activities will once again fall-back to using base dropships and rockets if a random selection of the selected tech's craft can't find one capable of carrying passengers and/or cargo.
5669

5770
- `MovableMan:OpenAllDoors()`, when passed `NOTEAM`, will now open/close doors specifically for `NOTEAM` (instead of all doors).
5871

5972
- MOs now only play the BurstSound of the first Wound they receive in a frame, which not only solves audio spam during e.g. explosions but also preserves intended audio when firing guns with a high ParticleCount at them.
6073

74+
- Changed how Get and SetLimbPathSpeed/PushForce work for `AHuman` and `ACrab`. The functions are as following:
75+
`GetLimbPathSpeed` has been renamed to `GetLimbPathTravelSpeed`.
76+
`SetLimbPathSpeed` has been renamed to `SetLimbPathTravelSpeed`.
77+
`GetLimbPathTravelSpeed(Actor.MovementState)` returns the FG/left side (for crabs) limb path travel speed for that specific movement state, instead of being hardcoded to walking only.
78+
`SetLimbPathTravelSpeed(Actor.MovementState, float newValue)` sets the travel speed for all layers and sides of any particular movement state's limb paths, instead of being hardcoded to walking only.
79+
`GetLimbPathPushForce(Actor.MovementState)` returns the FG/left side (for crabs) limb path push force for that specific movement state, instead of being hardcoded to walking only.
80+
`SetLimbPathPushForce(Actor.MovementState, float newValue)` sets the push force for all layers and sides of any particular movement state's limb paths, instead of being hardcoded to walking only.
81+
82+
- The `LimbPath` property `NormalTravelSpeed` has been renamed to just `TravelSpeed`.
83+
84+
- Almost all ctrl+* special inputs functionality (i.e restarting activity, world dumps, showing performance stats) are now mapped to right alt, to not interfere with default crouching inputs. The only exception is ctrl+arrow keys for changing console size.
85+
6186
</details>
6287

6388
<details><summary><b>Fixed</b></summary>
@@ -72,6 +97,21 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
7297

7398
- Fixed a bug in Harvester and Massacre where setting deploy units would auto-assign units of the wrong tech.
7499

100+
- Fixed an issue where an `Actor`'s MovementState wasn't correctly accessible from script.
101+
102+
</details>
103+
104+
<details><summary><b>Removed</b></summary>
105+
106+
- All music-related functionality from AudioMan has been removed due to the addition of the MusicMan. Generic DynamicSongs have been put in to use instead.
107+
Mod activities that used to queue up all the vanilla music should now instead call, for example, `MusicMan:PlayDynamicSong("Generic Battle Music")`
108+
109+
- The Signal Hunt activity no longer has a preview image, as it was not formatted correctly and spoiled the interior structure of the cave.
110+
111+
- Removed `AHuman` property `MaxCrouchRotation`. `CrouchRotAngleTarget` is now used instead.
112+
113+
- Deprecated `LimbPath` properties `SlowTravelSpeed`, `NormalTravelSpeed` and `FastTravelSpeed`. For the sake of backwards compatibility they will not crash the game and `NormalTravelSpeed` is a valid synonym for the new `TravelSpeed`.
114+
75115
</details>
76116

77117
## [Release v6.2.2] - 2024/02/24

Data/Base.rte/AI/HumanBehaviors.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1223,7 +1223,7 @@ function HumanBehaviors.ShootTarget(AI, Owner, Abort)
12231223
AI.Ctrl.AnalogAim = SceneMan:ShortestDistance(Owner.Pos, AI.Target.Pos, false).Normalized;
12241224
if AI.lateralMoveState == Actor.LAT_STILL then
12251225
AI.proneState = AHuman.PRONE;
1226-
--AI.Ctrl:SetState(Controller.BODY_CROUCH, true);
1226+
--AI.Ctrl:SetState(Controller.BODY_PRONE, true);
12271227
end
12281228
elseif Owner:EquipFirearm(true) then
12291229
local _ai, _ownr, _abrt = coroutine.yield(); -- wait until next frame, just in case the magazine is replenished by another script

Data/Base.rte/AI/NativeHumanAI.lua

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ function NativeHumanAI:Create(Owner)
1717
Members.fire = false;
1818
Members.groundContact = 5;
1919
Members.flying = false;
20+
Members.running = false;
2021

2122
Members.squadShoot = false;
2223
Members.useMedikit = false;
@@ -29,6 +30,9 @@ function NativeHumanAI:Create(Owner)
2930
Members.SquadShootTimer = Timer();
3031
Members.SquadShootDelay = math.random(50,100);
3132

33+
Members.RunStateTimer = Timer();
34+
Members.RunStateTimer:SetSimTimeLimitMS(math.random(2000,5000));
35+
3236
Members.AlarmTimer = Timer();
3337
Members.AlarmTimer:SetSimTimeLimitMS(400);
3438

@@ -336,6 +340,18 @@ function NativeHumanAI:Update(Owner)
336340
end
337341
end
338342

343+
local AlarmPoint = Owner:GetAlarmPoint();
344+
345+
-- If we currently have a target or are alerted, we walk. Otherwise we run
346+
-- We also have a small random chance to walk for a lil bit
347+
local wasAlarmed = AlarmPoint.Largest > 0;
348+
if wasAlarmed or self.RunStateTimer:IsPastSimTimeLimit() then
349+
self.running = self.Target == nil and not wasAlarmed and math.random() < 0.6;
350+
self.RunStateTimer:Reset();
351+
end
352+
353+
self.Ctrl:SetState(Controller.MOVE_FAST, self.running);
354+
339355
self.squadShoot = false;
340356
if Owner.MOMoveTarget then
341357
-- make the last waypoint marker stick to the MO we are following
@@ -361,7 +377,7 @@ function NativeHumanAI:Update(Owner)
361377
local dist = SceneMan:ShortestDistance(Owner.Pos, Leader.Pos, false).Largest;
362378
local radius = (Leader.Height + Owner.Height) * 0.5;
363379
if dist < radius then
364-
local copyControls = {Controller.MOVE_LEFT, Controller.MOVE_RIGHT, Controller.BODY_JUMPSTART, Controller.BODY_JUMP, Controller.BODY_CROUCH};
380+
local copyControls = {Controller.MOVE_LEFT, Controller.MOVE_RIGHT, Controller.BODY_JUMPSTART, Controller.BODY_JUMP, Controller.BODY_PRONE};
365381
for _, control in pairs(copyControls) do
366382
local state = Leader:GetController():IsState(control);
367383
self.Ctrl:SetState(control, state);
@@ -547,7 +563,6 @@ function NativeHumanAI:Update(Owner)
547563
end
548564

549565
-- listen and react to AlarmEvents and AlarmPoints
550-
local AlarmPoint = Owner:GetAlarmPoint();
551566
if AlarmPoint.Largest > 0 then
552567
if not self.Target and not self.UnseenTarget then
553568
self.AlarmPos = Vector(AlarmPoint.X, AlarmPoint.Y);
@@ -634,7 +649,7 @@ function NativeHumanAI:Update(Owner)
634649
if self.proneState == AHuman.GOPRONE then
635650
self.proneState = AHuman.PRONE;
636651
elseif self.proneState == AHuman.PRONE then
637-
self.Ctrl:SetState(Controller.BODY_CROUCH, true);
652+
self.Ctrl:SetState(Controller.BODY_PRONE, true);
638653
end
639654

640655
if self.lateralMoveState == Actor.LAT_LEFT then

Data/Base.rte/Actors/Brains/Brainbot/Brainbot.ini

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -688,9 +688,7 @@ AddActor = AHuman
688688
X = 4
689689
Y = 16
690690
StartSegCount = 0
691-
SlowTravelSpeed = 0.1
692-
NormalTravelSpeed = 0.5
693-
FastTravelSpeed = 1.5
691+
TravelSpeed = 0.5
694692
PushForce = 4000
695693
StandLimbPathBG = LimbPath
696694
CopyOf = Brainbot Stand Path
@@ -699,6 +697,10 @@ AddActor = AHuman
699697
Y = 16
700698
WalkLimbPath = LimbPath
701699
CopyOf = Robot Walk Path
700+
WalkRotAngleTarget = -0.05
701+
RunLimbPath = LimbPath
702+
CopyOf = Robot Run Path
703+
RunRotAngleTarget = -0.07
702704
CrouchLimbPath = LimbPath
703705
CopyOf = Human Crouch Path
704706
CrouchLimbPathBG = LimbPath
@@ -722,9 +724,7 @@ AddActor = AHuman
722724
AddSegment = Vector
723725
X = 0
724726
Y = 10
725-
SlowTravelSpeed = 1.5
726-
NormalTravelSpeed = 1.8
727-
FastTravelSpeed = 4.5
727+
TravelSpeed = 1.8
728728
PushForce = 8000
729729
ArmCrawlLimbPath = LimbPath
730730
PresetName = Brainbot Arm Crawl Path
@@ -747,9 +747,7 @@ AddActor = AHuman
747747
AddSegment = Vector
748748
X = 0
749749
Y = 10
750-
SlowTravelSpeed = 1.5
751-
NormalTravelSpeed = 1.5
752-
FastTravelSpeed = 4.5
750+
TravelSpeed = 1.5
753751
PushForce = 6000
754752
ClimbLimbPath = LimbPath
755753
CopyOf = Human Climb Path
@@ -771,9 +769,7 @@ AddActor = AHuman
771769
AddSegment = Vector
772770
X = -8
773771
Y = 14
774-
SlowTravelSpeed = 3
775-
NormalTravelSpeed = 6
776-
FastTravelSpeed = 7
772+
TravelSpeed = 6
777773
PushForce = 7000
778774
DislodgeLimbPath = LimbPath
779775
PresetName = Brainbot Dislodge Path
@@ -784,9 +780,7 @@ AddActor = AHuman
784780
AddSegment = Vector
785781
X = 0
786782
Y = 6
787-
SlowTravelSpeed = 1.5
788-
NormalTravelSpeed = 2.5
789-
FastTravelSpeed = 4.5
783+
TravelSpeed = 2.5
790784
PushForce = 10000
791785
AddGib = Gib
792786
GibParticle = MOPixel

Data/Base.rte/Actors/Infantry/GreenDummy/GreenDummy.ini

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,7 @@ AddActor = AHuman
675675
ParticlesPerMinute = 8400
676676
JumpTime = 1.5
677677
JumpReplenishRate = 1.5
678-
JumpAngleRange = 0.2
678+
JumpAngleRange = 0.16
679679
FGArm = Arm
680680
CopyOf = Green Dummy Arm FG
681681
ParentOffset = Vector
@@ -710,9 +710,7 @@ AddActor = AHuman
710710
X = 0
711711
Y = 17
712712
StartSegCount = 0
713-
SlowTravelSpeed = 0.1
714-
NormalTravelSpeed = 0.5
715-
FastTravelSpeed = 1.5
713+
TravelSpeed = 0.5
716714
PushForce = 1800
717715
StandLimbPathBG = LimbPath
718716
CopyOf = Green Dummy Stand Path
@@ -726,7 +724,12 @@ AddActor = AHuman
726724
StartOffset = Vector
727725
X = 10
728726
Y = -3
729-
NormalTravelSpeed = 3.4
727+
TravelSpeed = 2.6
728+
WalkRotAngleTarget = -0.05
729+
RunLimbPath = LimbPath
730+
CopyOf = Human Run Path
731+
TravelSpeed = 4.0
732+
RunRotAngleTarget = -0.07
730733
CrouchLimbPath = LimbPath
731734
CopyOf = Human Crouch Path
732735
CrouchLimbPathBG = LimbPath

Data/Base.rte/Actors/Mecha/AADrone/Drone.ini

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -421,9 +421,7 @@ AddActor = ACrab
421421
X = -6
422422
Y = 6
423423
StartSegCount = 0
424-
SlowTravelSpeed = 0.4
425-
NormalTravelSpeed = 0.8
426-
FastTravelSpeed = 1.8
424+
TravelSpeed = 0.8
427425
PushForce = 2200
428426
LeftWalkLimbPath = LimbPath
429427
PresetName = AA Drone Walk Path Left
@@ -452,9 +450,7 @@ AddActor = ACrab
452450
AddSegment = Vector
453451
X = -13
454452
Y = 0
455-
SlowTravelSpeed = 2.5
456-
NormalTravelSpeed = 3.5
457-
FastTravelSpeed = 5.5
453+
TravelSpeed = 3.5
458454
PushForce = 6000
459455
LeftDislodgeLimbPath = LimbPath
460456
PresetName = AA Drone Dislodge Path Left
@@ -465,9 +461,7 @@ AddActor = ACrab
465461
AddSegment = Vector
466462
X = 0
467463
Y = 6
468-
SlowTravelSpeed = 2.5
469-
NormalTravelSpeed = 3.5
470-
FastTravelSpeed = 4.5
464+
TravelSpeed = 3.5
471465
PushForce = 12000
472466
RightStandLimbPath = LimbPath
473467
CopyOf = AA Drone Stand Path Left

Data/Base.rte/Actors/Mecha/AIBox/AIBox.ini

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -274,9 +274,7 @@ AddActor = ACrab
274274
X = -6
275275
Y = 6
276276
StartSegCount = 0
277-
SlowTravelSpeed = 0.4
278-
NormalTravelSpeed = 0.8
279-
FastTravelSpeed = 1.8
277+
TravelSpeed = 0.8
280278
PushForce = 2200
281279
LWalkLimbPath = LimbPath
282280
CopyOf = Crab Drone Walk Path
@@ -289,9 +287,7 @@ AddActor = ACrab
289287
AddSegment = Vector
290288
X = 0
291289
Y = 6
292-
SlowTravelSpeed = 2.5
293-
NormalTravelSpeed = 3.5
294-
FastTravelSpeed = 4.5
290+
TravelSpeed = 3.5
295291
PushForce = 12000
296292
RStandLimbPath = LimbPath
297293
CopyOf = AI Box Stand Path Left

Data/Base.rte/Actors/Mecha/Medic/MedicDrone.ini

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -273,16 +273,12 @@ AddActor = ACrab
273273
X = -6
274274
Y = 6
275275
StartSegCount = 0
276-
SlowTravelSpeed = 0.4
277-
NormalTravelSpeed = 0.8
278-
FastTravelSpeed = 1.8
276+
TravelSpeed = 0.8
279277
PushForce = 2200
280278
LWalkLimbPath = LimbPath
281279
CopyOf = Crab Drone Walk Path
282280
PresetName = Medic Drone Walk Path
283-
SlowTravelSpeed = 2.4
284-
NormalTravelSpeed = 3.4
285-
FastTravelSpeed = 4.4
281+
TravelSpeed = 3.4
286282
LDislodgeLimbPath = LimbPath
287283
PresetName = Medic Drone Dislodge Path Left
288284
StartOffset = Vector
@@ -292,9 +288,7 @@ AddActor = ACrab
292288
AddSegment = Vector
293289
X = 0
294290
Y = 6
295-
SlowTravelSpeed = 2.5
296-
NormalTravelSpeed = 3.5
297-
FastTravelSpeed = 4.5
291+
TravelSpeed = 3.5
298292
PushForce = 12000
299293
RStandLimbPath = LimbPath
300294
CopyOf = Medic Drone Stand Path Left

0 commit comments

Comments
 (0)