Skip to content

Commit edac7ca

Browse files
committed
Merge branch 'development' into browncoat-mission
2 parents 1a179a9 + 5a49ddc commit edac7ca

File tree

3 files changed

+42
-25
lines changed

3 files changed

+42
-25
lines changed

CHANGELOG.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
99
<details><summary><b>Added</b></summary>
1010

1111
- Pathfinding and navigation overhaul, including jetpack/jump-aware pathfinding.
12-
Actors will now intelligently choose their path depending on how high they can jump, instead of always taking the shortest path. This will reduce instances of the AI getting stuck while trying to take impossible paths.
12+
Actors will now intelligently choose their path depending on how high they can jump, instead of always taking the shortest flying path. This will reduce instances of the AI getting stuck while trying to take paths that are impossible for them.
13+
Improvements to both `ACrab` and `AHuman` navigation. `ACrab`s are now aware of how to pathfind and navigate using their jetpack, and will use it where applicable. Actors are better at using their jetpack, and will use automovers if their jetpack is not sufficient to reach a destination.
14+
Actors are now more capable and responsive when digging. They will dig to their target if they cannot reach it with their jetpack (for example if there is a long vertical shaft in the route they cannot get up), and they preferentially avoid rocks, metal and other hard substances by digging around them. Actors also dig faster and spend less time idle.
1315
In the `CalculatePath` and `CalculatePathAsync` functions, the parameter `movePathToGround` has been replaced with `jumpHeight`, which is the height in metres the pathfind can jump vertically.
14-
The new function `GetPathFindingFlyingJumpHeight()` can be used to get a jumpHeight that allows flying (i.e infinite jump height).
15-
New `Actor` Lua property `JumpHeight` (R) to estimate the jump height of the actor (in metres), based on the actor's jetpack and weight.
16+
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.
17+
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`.
1618

1719
- New music system, including a dynamic horizontal sequencing system, under the new music manager `MusicMan`.
1820
`PlayDynamicSong(string songName, string songSectionName, bool playImmediately, bool playTransition, bool smoothFade)` to play a new DynamicSong.

README.md

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,18 @@ If you just want to play the latest version of the game you can get it from our
1414
# Getting Mods
1515
You can get mods from our [mod portal](https://cccp.mod.io).
1616

17+
# How To Make Your Voice Heard #
18+
So you want to take part in the project? A good start would be going to the discord where the project is discussed. You can find a link [here](https://discord.gg/TSU6StNQUG). All our releases are available under the releases area and all of our bugs, changes, and ideas are tracked in GitHub issues. Feel free to play and suggest changes or point out any problems.
19+
20+
# How To Make Issues #
21+
Please feel free to add issues and bugs. It's as simple as going to the issues tab and clicking a button. Once you do that, you'll see an easy to follow template to fill in. Try to put in the appropriate category for the issue and it'll be handled from there.
22+
23+
# How to Contribute #
24+
If you've got any C++ experience, experience with the game's ini data through modding it, are good at spriting, or know Lua, you can contribute some of your time directly to the project. We'll gladly consider all pull requests that come in and are always happy to have more hands on deck.
25+
26+
# More Information
27+
See the [Information and Recommendations](https://github.com/cortex-command-community/Cortex-Command-Community-Project-Source/wiki/Information,-Recommended-Plugins-and-Useful-Links) page for more details and useful development tools.
28+
1729
***
1830

1931
# Windows Build Instructions
@@ -156,24 +168,3 @@ This repository includes launch configurations to automatically build and debug
156168
These launch configurations are accessible via the [Run and Debug](https://code.visualstudio.com/docs/editor/debugging#_run-and-debug-view) view, and provide profiles to build and run the game in Release mode or any of the [3 Debug modes](https://github.com/cortex-command-community/Cortex-Command-Community-Project-Source/wiki/Meson-build-options).
157169

158170
All configurations will run pre-launch tasks to build the game using the supported backend before launching.
159-
160-
161-
# More Information
162-
163-
See the [Information and Recommendations](https://github.com/cortex-command-community/Cortex-Command-Community-Project-Source/wiki/Information,-Recommended-Plugins-and-Useful-Links) page for more details and useful development tools.
164-
165-
# How To Make Your Voice Heard #
166-
167-
So you want to take part in the project? A good start would be going to the discord where the project is discussed. You can find a link [here](https://discord.gg/TSU6StNQUG). After that, all our releases will be available under the releases area and all of our bugs and changes and ideas are tracked in github issues. Feel free to play and suggest changes or point out any problems.
168-
169-
***
170-
171-
# How To Make Issues #
172-
173-
If you're familiar with github you should be familiar with making issues. It's as simple as going to the issues tab and clicking a button. Once you do that, you'll see an easy to follow template to fill in. After you've done that, try to put in the appropriate category for the issue and it'll be handled from there.
174-
175-
***
176-
177-
# How to Contribute #
178-
179-
If you've got any C++ experience, experience with the game's ini data through modding it, are good at spriting or know Lua, you can contribute some of your time directly to the project. We'll look at any pull requests that come in and are always happy to have more hands on deck.

Source/Entities/ACrab.cpp

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -759,7 +759,31 @@ MovableObject* ACrab::LookForMOs(float FOVSpread, unsigned char ignoreMaterial,
759759
}
760760

761761
float ACrab::EstimateJumpHeight() const {
762-
return 0.0f; // todo, add support to detect crabs with jetpacks
762+
if (!m_pJetpack) {
763+
return 0.0F;
764+
}
765+
766+
float totalMass = GetMass();
767+
float fuelTime = m_pJetpack->GetJetTimeTotal();
768+
float fuelUseMultiplier = m_pJetpack->GetThrottleFactor();
769+
float impulseBurst = m_pJetpack->EstimateImpulse(true) / totalMass;
770+
float impulseThrust = m_pJetpack->EstimateImpulse(false) / totalMass;
771+
772+
Vector globalAcc = g_SceneMan.GetGlobalAcc() * g_TimerMan.GetDeltaTimeSecs();
773+
Vector currentVelocity = Vector(0.0F, -impulseBurst);
774+
float totalHeight = currentVelocity.GetY() * g_TimerMan.GetDeltaTimeSecs() * c_PPM;
775+
do {
776+
currentVelocity += globalAcc;
777+
totalHeight += currentVelocity.GetY() * g_TimerMan.GetDeltaTimeSecs() * c_PPM;
778+
if (fuelTime > 0.0F) {
779+
currentVelocity.m_Y -= impulseThrust;
780+
fuelTime -= g_TimerMan.GetDeltaTimeMS() * fuelUseMultiplier;
781+
}
782+
} while (currentVelocity.GetY() < 0.0F);
783+
784+
float finalCalculatedHeight = totalHeight * -1.0F * c_MPP;
785+
float finalHeightMultipler = 0.8f; // Make us think we can do a little less because AI path following is shit
786+
return finalCalculatedHeight * finalHeightMultipler;
763787
}
764788

765789
void ACrab::OnNewMovePath() {

0 commit comments

Comments
 (0)