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

Commit bc31559

Browse files
authored
Merge pull request #416 from cortex-command-community/pre4-testing
Pre4 testing
2 parents c177277 + d8f4a2e commit bc31559

Some content is hidden

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

95 files changed

+1785
-1273
lines changed

.github/workflows/build-check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
- name: Install Dependencies
2626
run: |
2727
sudo apt-get update -yq
28-
sudo apt-get install --no-install-recommends liballegro4-dev libloadpng4-dev libflac++-dev luajit-5.1-dev libminizip-dev liblz4-dev libpng++-dev libx11-dev libboost-dev
28+
sudo apt-get install --no-install-recommends liballegro4-dev libloadpng4-dev libflac++-dev luajit-5.1-dev liblua5.2-dev libminizip-dev liblz4-dev libpng++-dev libx11-dev libboost-dev
2929
3030
- name: Install Clang
3131
# You may pin to the exact commit or the version.

.github/workflows/meson.yml

Lines changed: 73 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
- name: Install Dependencies
2626
run: |
2727
sudo apt-get update -yq
28-
sudo apt-get install --no-install-recommends wget liballegro4-dev libloadpng4-dev libflac++-dev luajit-5.1-dev libminizip-dev liblz4-dev libpng++-dev libx11-dev libboost-dev
28+
sudo apt-get install --no-install-recommends wget liballegro4-dev libloadpng4-dev libflac++-dev luajit-5.1-dev liblua5.2-dev libminizip-dev liblz4-dev libpng++-dev libx11-dev libboost-dev
2929
3030
- name: Install Clang
3131
# You may pin to the exact commit or the version.
@@ -81,3 +81,75 @@ jobs:
8181
with:
8282
name: CortexCommand.AppImage
8383
path: CortexCommand.AppImage
84+
85+
86+
build-debug-linux:
87+
# The type of runner that the job will run on
88+
runs-on: ubuntu-20.04
89+
90+
91+
# Steps represent a sequence of tasks that will be executed as part of the job
92+
steps:
93+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
94+
- uses: actions/checkout@v2
95+
- uses: actions/setup-python@v2
96+
97+
- name: Install Dependencies
98+
run: |
99+
sudo apt-get update -yq
100+
sudo apt-get install --no-install-recommends wget liballegro4-dev libloadpng4-dev libflac++-dev luajit-5.1-dev libminizip-dev liblz4-dev libpng++-dev libx11-dev libboost-dev
101+
102+
- name: Install Clang
103+
# You may pin to the exact commit or the version.
104+
# uses: egor-tensin/setup-clang@d16e36d5f8a7eb00aa6627c1a536d94dfc4a913d
105+
uses: egor-tensin/setup-clang@v1
106+
with:
107+
# Set up cc/c++ executables
108+
cc: 1 # optional, default is 1
109+
110+
- name: Setup ccache
111+
uses: hendrikmuhs/ccache-action@v1
112+
with:
113+
key: build-release-${{runner.os}}
114+
max-size: 5G
115+
116+
- name: Build
117+
# You may pin to the exact commit or the version.
118+
# uses: BSFishy/meson-build@6f1930d878fd3eed3853c1c91285ec604c37f3a5
119+
uses: BSFishy/[email protected]
120+
env:
121+
CC: "clang"
122+
CXX: "clang++"
123+
CCACHE_SLOPPINESS: pch_defines,time_macros,include_file_mtime,include_file_ctime
124+
with:
125+
# The action to run
126+
setup-options: -Ddebug=true --optimization=g -Dinstall_data=false -Dinstall_runner=false -Dfmod_dir=/usr/lib/ --prefix=/usr/ -Ddebug_type=release
127+
meson-version: 0.55.3
128+
ninja-version: 1.10.0
129+
action: build
130+
131+
- name: Create AppDir
132+
run: |
133+
echo "Setting output prefix"
134+
DESTDIR=${GITHUB_WORKSPACE}/build/AppDir meson install -C $GITHUB_WORKSPACE"/build"
135+
136+
- name: Download linuxdeploy
137+
working-directory: ${{env.GITHUB_WORKSPACE}}
138+
run: |
139+
wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage -O lindeploy
140+
chmod +x lindeploy
141+
142+
- name: Create AppImage
143+
working-directory: ${{env.GITHUB_WORKSPACE}}
144+
env:
145+
LD_LIBRARY_PATH: ./external/lib/linux/x86_64/
146+
OUTPUT: CortexCommand-debug.AppImage
147+
run: |
148+
echo ${LD_LIBRARY_PATH}
149+
./lindeploy --appdir=build/AppDir --output appimage
150+
151+
- name: Upload Appimage
152+
uses: actions/upload-artifact@v2
153+
with:
154+
name: CortexCommand-debug.AppImage
155+
path: CortexCommand-debug.AppImage

Activities/GameActivity.cpp

Lines changed: 49 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -769,6 +769,7 @@ bool GameActivity::CreateDelivery(int player, int mode, Vector &waypoint, Actor
769769
newDelivery.pCraft = pDeliveryCraft;
770770
newDelivery.orderedByPlayer = player;
771771
newDelivery.landingZone = m_LandingZone[player];
772+
newDelivery.multiOrderYOffset = 0;
772773
newDelivery.delay = m_DeliveryDelay * pDeliveryCraft->GetDeliveryDelayMultiplier();
773774
newDelivery.timer.Reset();
774775

@@ -1459,7 +1460,7 @@ void GameActivity::Update()
14591460
m_PlayerController[player].RelativeCursorMovement(m_ActorCursor[player]);
14601461

14611462
// Find the actor closest to the cursor, if any within the radius
1462-
float markedDistance = -1;
1463+
Vector markedDistance;
14631464
Actor *pMarkedActor = g_MovableMan.GetClosestTeamActor(team, player, m_ActorCursor[player], g_SceneMan.GetSceneWidth(), markedDistance);
14641465
// Actor *pMarkedActor = g_MovableMan.GetClosestTeamActor(team, player, m_ActorCursor[player], g_FrameMan.GetPlayerScreenWidth() / 4);
14651466

@@ -1509,7 +1510,7 @@ void GameActivity::Update()
15091510
// Show the pie menu switching animation over the highlighted Actor
15101511
m_pPieMenu[player]->SetPos(pMarkedActor->GetPos());
15111512

1512-
if (markedDistance > g_FrameMan.GetPlayerFrameBufferWidth(player) / 4)
1513+
if (markedDistance.GetMagnitude() > g_FrameMan.GetPlayerFrameBufferWidth(player) / 4)
15131514
m_pPieMenu[player]->Wobble();
15141515
else
15151516
m_pPieMenu[player]->FreezeAtRadius(30);
@@ -1684,8 +1685,7 @@ void GameActivity::Update()
16841685

16851686
else if (m_ViewState[player] == ViewState::LandingZoneSelect)
16861687
{
1687-
// Continuously display LZ message
1688-
g_FrameMan.SetScreenText("Choose your landing zone...", ScreenOfPlayer(player));
1688+
g_FrameMan.SetScreenText("Choose your landing zone... Hold UP or DOWN to place multiple orders", ScreenOfPlayer(player));
16891689

16901690
// Save the x pos so we can see which direction the user is moving it
16911691
float prevLZX = m_LandingZone[player].m_X;
@@ -1731,24 +1731,15 @@ void GameActivity::Update()
17311731
}
17321732

17331733
// Interface for the craft AI post-delivery mode
1734-
if (m_PlayerController[player].IsState(PRESS_DOWN))// || m_PlayerController[player].IsState(PRESS_SECONDARY))
1735-
{
1736-
if (m_AIReturnCraft[player])
1737-
g_GUISound.SelectionChangeSound()->Play(player);
1738-
else
1739-
g_GUISound.UserErrorSound()->Play(player);
1734+
if (m_PlayerController[player].IsState(PRESS_DOWN)) {
1735+
if (m_AIReturnCraft[player]) { g_GUISound.SelectionChangeSound()->Play(player); }
17401736

1741-
m_AIReturnCraft[player] = false;
1742-
}
1743-
else if (m_PlayerController[player].IsState(PRESS_UP))// || m_PlayerController[player].IsState(PRESS_SECONDARY))
1744-
{
1745-
if (!m_AIReturnCraft[player])
1746-
g_GUISound.SelectionChangeSound()->Play(player);
1747-
else
1748-
g_GUISound.UserErrorSound()->Play(player);
1737+
m_AIReturnCraft[player] = false;
1738+
} else if (m_PlayerController[player].IsState(PRESS_UP)) {
1739+
if (!m_AIReturnCraft[player]) { g_GUISound.SelectionChangeSound()->Play(player); }
17491740

1750-
m_AIReturnCraft[player] = true;
1751-
}
1741+
m_AIReturnCraft[player] = true;
1742+
}
17521743

17531744
// Player canceled the order while selecting LZ - can't be done in pregame
17541745
if (m_PlayerController[player].IsState(PRESS_SECONDARY) && m_ActivityState != ActivityState::PreGame)
@@ -1761,29 +1752,36 @@ void GameActivity::Update()
17611752
g_GUISound.UserErrorSound()->Play(player);
17621753
// Flash the same actor, jsut to show the control went back to him
17631754
m_pPieMenu[player]->DoDisableAnimation();
1764-
}
1765-
// Player is done selecting LZ,
1766-
else if (m_PlayerController[player].IsState(PRESS_FACEBUTTON) || m_PlayerController[player].IsState(PRESS_PRIMARY))
1767-
{
1768-
// Set the LZ cursor to be just over terran, to avoid getting stuck at halfway interpolating there
1769-
m_LandingZone[player].m_Y = 0;
1770-
m_LandingZone[player].m_Y = g_SceneMan.FindAltitude(m_LandingZone[player], g_SceneMan.GetSceneHeight(), 10);
1771-
// Complete the purchase by getting the order from the BuyGUI, build it, and stuff it into a delivery
1772-
CreateDelivery(player);
1773-
// If there are no other Actors on this team, just view the LZ we have selected
1774-
if (!g_MovableMan.GetNextTeamActor(team))
1775-
{
1776-
m_ObservationTarget[player] = m_LandingZone[player];
1777-
m_ViewState[player] = ViewState::Observe;
1778-
}
1779-
// If there are other guys around, switch back to normal view
1780-
else
1781-
m_ViewState[player] = ViewState::Normal;
1782-
// Stop displaying the LZ message
1783-
g_FrameMan.ClearScreenText(ScreenOfPlayer(player));
1784-
// Flash the same actor, jsut to show the control went back to him
1785-
m_pPieMenu[player]->DoDisableAnimation();
1786-
}
1755+
} else if (m_PlayerController[player].IsState(PRESS_FACEBUTTON) || m_PlayerController[player].IsState(PRESS_PRIMARY)) {
1756+
m_LandingZone[player].m_Y = 0;
1757+
float lzOffsetY = 0;
1758+
// Holding up or down will allow the player to make multiple orders without exiting the delivery phase. TODO: this should probably have a cooldown?
1759+
if (!m_PlayerController[player].IsState(MOVE_UP) && !m_PlayerController[player].IsState(MOVE_DOWN)) {
1760+
m_LandingZone[player].m_Y = g_SceneMan.FindAltitude(m_LandingZone[player], g_SceneMan.GetSceneHeight(), 10);
1761+
if (!g_MovableMan.GetNextTeamActor(team)) {
1762+
m_ObservationTarget[player] = m_LandingZone[player];
1763+
m_ViewState[player] = ViewState::Observe;
1764+
} else {
1765+
m_ViewState[player] = ViewState::Normal;
1766+
}
1767+
g_FrameMan.ClearScreenText(ScreenOfPlayer(player));
1768+
m_pPieMenu[player]->DoDisableAnimation();
1769+
} else {
1770+
// Place the new marker above the cursor so that they don't intersect with each other.
1771+
lzOffsetY += m_AIReturnCraft[player] ? -32.0F : 32.0F;
1772+
m_LandingZone[player].m_Y = g_SceneMan.FindAltitude(m_LandingZone[player], g_SceneMan.GetSceneHeight(), 10) + lzOffsetY;
1773+
}
1774+
1775+
if (m_pBuyGUI[player]->GetTotalOrderCost() > GetTeamFunds(team)) {
1776+
g_GUISound.UserErrorSound()->Play(player);
1777+
m_FundsChanged[team] = true;
1778+
} else {
1779+
CreateDelivery(player);
1780+
m_Deliveries[team].rbegin()->multiOrderYOffset = lzOffsetY;
1781+
}
1782+
// Revert the Y offset so that the cursor doesn't flinch.
1783+
m_LandingZone[player].m_Y -= lzOffsetY;
1784+
}
17871785

17881786
bool wrapped = g_SceneMan.ForceBounds(m_LandingZone[player]);
17891787

@@ -2227,6 +2225,14 @@ void GameActivity::DrawGUI(BITMAP *pTargetBitmap, const Vector &targetPos, int w
22272225
{
22282226
int halfWidth = 24;
22292227
landZone = itr->landingZone - targetPos;
2228+
bool anyPlayerOnTeamIsInLandingZoneSelectViewState = false;
2229+
for (int player = Players::PlayerOne; player < Players::MaxPlayerCount; ++player) {
2230+
if (GetTeamOfPlayer(player) == team && m_ViewState[player] == ViewState::LandingZoneSelect) {
2231+
anyPlayerOnTeamIsInLandingZoneSelectViewState = true;
2232+
break;
2233+
}
2234+
}
2235+
if (!anyPlayerOnTeamIsInLandingZoneSelectViewState) { landZone.m_Y -= itr->multiOrderYOffset; }
22302236
// Cursor
22312237
draw_sprite(pTargetBitmap, m_aLZCursor[cursor][frame], landZone.m_X - halfWidth, landZone.m_Y - 48);
22322238
draw_sprite_h_flip(pTargetBitmap, m_aLZCursor[cursor][frame], landZone.m_X + halfWidth - m_aLZCursor[cursor][frame]->w, landZone.m_Y - 48);

Activities/GameActivity.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ class GameActivity : public Activity {
5656
int orderedByPlayer;
5757
// Where to land
5858
Vector landingZone;
59+
// How much this delivery was offset upwards for multi-ordering, stored to help with delivery icons. If 0, this was presumably not a multi-order.
60+
float multiOrderYOffset;
5961
// How long left until entry, in ms
6062
long delay;
6163
// Times how long we've been in transit

Activities/MultiplayerServerLobby.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ namespace RTE {
354354
UpdateActivityBox();
355355

356356
// This allow to reduce looby bandwidth by 50% while still somewhat descent looking
357-
g_NetworkServer.SetInterlacingMode(true);
357+
//g_NetworkServer.SetInterlacingMode(true);
358358

359359
return error;
360360
}

CHANGELOG.md

Lines changed: 65 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
216216
- New `ACraft` INI and Lua (R/W) property `ScuttleOnDeath` which can be used to disable the automatic self-destruct sequence when the craft's health drops down to zero.
217217

218218
- New `Settings.ini` property `UnheldItemsHUDDisplayRange = numPixels` that hides the HUD of stranded items at a set distance. Default is 500 (25 meters).
219-
Value of -1 or anything below means all HUDs will be hidden and the only indication an item can be picked up will be on the Actor's HUD when standing on top of it.
219+
Value of -1 or anything below means all HUDs will be hidden and the only indication an item can be picked up will be on the `Actor`'s HUD when standing on top of it.
220220
Value of 0 means there is no range limit and all items on Scene will display the pick-up HUD.
221221
Valid range values are 1-1000, anything above will be considered as no range limit.
222222

@@ -227,10 +227,71 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
227227

228228
- New `Settings.ini` property `SimplifiedCollisionDetection = 0/1` to enable more performant but less accurate MO collision detection (previously `PreciseCollisions = 0`). Disabled by default.
229229

230+
- New INI property `BuyableMode` to specify in which buy lists a `Buyable = 1` item should appear in.
231+
`BuyableMode = 0 // No restrictions` - item will appear in both lists as usual. Default value, does not need to be explicitly specified.
232+
`BuyableMode = 1 // BuyMenu only` - item will not appear in any group in the object picker during the editing phase, but will be available to purchase from the buy menu.
233+
`BuyableMode = 2 // ObjectPicker only` - item will not appear in any tab in the buy menu when making an order, but will be available for placement from the object picker during editing phase.
234+
235+
- New `MovableMan` Lua function `KillAllTeamActors`, which kills all `Actor`s on the given `Team`.
236+
237+
- New `ACRocket` INI property `MaxGimbalAngle`, which enables automatic stabilization via tilting of the main engine.
238+
239+
- Added Lua bindings for `scene.Areas` and `area.Boxes` that you can iterate through to get all the `Areas` in a `Scene` and all the `Boxes` in an `Area`.
240+
241+
- Added `Area` Lua function `area:RemoveBox(boxToRemove)` which removes the given `Box` from the `Area`. Note that this removal is done by comparing the `Box`'s `Corner`, `Width` and `Height`, so you're actually removing the first `Box` that matches the passed-in boxToRemove.
242+
243+
- Added Lua binding for `AudioMan:StopMusic()`, which stops all playing music. `AudioMan:StopAll()` used to do this, but now it actually stops all sounds and music.
244+
245+
- New `Actor` Lua (R) property `SharpAimProgress`, which returns the current sharp-aiming progress as a scalar from 0 to 1.
246+
247+
- New `HeldDevice` Lua (R/W) property `Supported`, which indicates whether or not the device is currently being supported by a background hand.
248+
249+
- New `HeldDevice` Lua function `IsEmpty`, which indicates whether the device is devoid of ammo. Can be used to skip an extra step to check for a `Magazine`. Will always return `false` for non-`HDFirearm` devices.
250+
251+
- New `SoundContainer` INI and Lua (R/W) property `PitchVariation`, which can be used to randomize the pitch of the sounds being played.
252+
253+
- New `AHuman` and `ACrab` INI and Lua (R/W) property `JetReplenishRate`, which determines how fast jump time (i.e. jetpack fuel) is replenished during downtime.
254+
255+
- Added `Entity` Lua function `entity:RemoveFromGroup(groupToRemoveFrom)` which removes the given group from the `Entity`. The reverse of `AddToGroup`.
256+
257+
- New `AHuman` Lua functions `GetWalkAngle(layer)` and `SetWalkAngle(layer, angle)`, which can be used to read and override walk path rotation of both Legs/Layers respectively. Note that the walk path rotation is automatically updated on each step to match the curvature of the terrain, so this value resets every update.
258+
259+
- New `AHuman` INI and Lua (R/W) property `ArmSwingRate`, which now controls the arms' walking animation, according to each arm's `IdleOffset`. `1` is the default value, `0` means that the arms stay still.
260+
261+
- New `Attachable` Lua (R) property `JointPos`, which gets the position of the object's joint in scene coordinates.
262+
263+
- New `AHuman` Lua (R) property `IsClimbing`, which indicates whether the actor is currently climbing using either of the arms.
264+
265+
- New `AHuman` Lua functions `UnequipFGArm()` and `UnequipArms()` which unequip the currently held item(s) and put them into the actor's inventory.
266+
267+
- You can now execute multiple copies of your delivery order by holding UP or DOWN while choosing the landing zone.
268+
269+
- New `MOSprite` INI property `IconFile`, which can be used to define a separate sprite to be displayed in GUI elements, such as the Buy Menu.
270+
Defined similarly to `SpriteFile`, i.e. `IconFile = ContentFile` followed up by a `FilePath` to the sprite.
271+
272+
- New `MOSprite` Lua functions `GetIconWidth()` and `GetIconHeight()` which return the dimensions of its GUI representation.
273+
274+
- New `PrimitiveMan` Lua functions `DrawIconPrimitive(player, pos, entity)` and `DrawIconPrimitive(pos, entity)` which can be used to draw the GUI representation of the passed in entity.
275+
276+
- New `AEmitter` and `PEmitter` Lua (R) property `ThrottleFactor`, which gets the throttle strength as a multiplier value that factors in either the positive or negative throttle multiplier according to throttle.
277+
278+
- New `AHuman` Lua (R) property `EquippedMass`, which returns the total mass of any `HeldDevice`s currently equipped by the actor.
279+
280+
- New Settings.ini flag `UseExperimentalMultiplayerSpeedBoosts = 1/0`. When turned on, it will use some code that **may** speed up multiplayer.
281+
230282
</details>
231283

232284
<details><summary><b>Changed</b></summary>
233285

286+
- `ACrab` actors will now default to showing their `Turret` sprite as their GUI icon. If no turret is defined, the `ACrab`'s own sprite will be used.
287+
In a similar fashion, `AHuman` will now default to its torso sprite as its GUI representation if no `Head` has somehow been defined.
288+
289+
- `ThrownDevice`s will now use `StanceOffset`, `SharpStanceOffset` and `SupportOffset` in the same way as any other `HeldDevice`. In addition, `EndThrowOffset` will be used to set the BG hand position while sharp aiming or throwing.
290+
291+
- `AHuman` throwing angle will no longer be affected by the rotation of the body.
292+
293+
- Exposed `MovableObject` property `RestThreshold` to Lua (R/W).
294+
234295
- `ACRocket`s can now function without a full set of thrusters. This also means that "Null Emitter" thrusters are no longer required for rockets.
235296

236297
- Changed `MOSprite` property `SpriteAnimMode` `Enum` `LOOPWHENMOVING` to `LOOPWHENACTIVE` as it also describes active devices.
@@ -271,7 +332,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
271332

272333
- Recoil when firing weapons now affects sharp aim.
273334

274-
- The third argument for `distance` to be filled out in `MovableMan:GetClosestActor()` is now a `Vector` rather than `float`.
335+
- The distance arguments for `MovableMan` functions `GetClosestActor` and `GetClosestTeamActor` are now of type `Vector` rather than `float`.
275336

276337
- File paths in INIs are now case sensitive.
277338

@@ -435,6 +496,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
435496

436497
- Console error spam will no longer cripple performance over time.
437498

499+
- `AudioMan:StopAll()` now actually stops all sounds, instead of just stopping music.
500+
438501
- Fixed incorrect mouse bounds during splitscreen when the mouse player was not Player 1.
439502

440503
</details>

0 commit comments

Comments
 (0)