Skip to content

Commit 6aa8309

Browse files
authored
Merge branch 'development' into improve-grappling-gun
2 parents a6dd3dd + 66d5f19 commit 6aa8309

File tree

132 files changed

+14379
-8353
lines changed

Some content is hidden

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

132 files changed

+14379
-8353
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
compile_commands.json
1414
**/.ccls-cache
1515
**/.cache
16+
**/.clangd
17+
1618

1719
**/build*
1820

CHANGELOG.md

Lines changed: 44 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ 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 flying path. This will reduce instances of the AI getting stuck while trying to take paths that are impossible for them.
12+
Actors will now 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.
1313
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.
1414
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.
1515
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.
@@ -26,6 +26,23 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
2626
Added new `Actor` INI and Lua (R/W) property `CanRun` which denotes whether the Actor can run or not.
2727
Added new `Actor` INI and Lua (R/W) property `CrouchWalkSpeedMultiplier` which is a walking speed multiplier when at max crouch amount.
2828

29+
- New hotkey system for `Actor` and `HeldDevice`.
30+
Pressing a certain new hotkey will mark it as activated on `Actor` and `HeldDevice`, letting scripts make use of the new bindings easily.
31+
`Enum` binding for `HeldDevice.HeldDeviceHotkeyType`: `PRIMARYHOTKEY = 0, AUXILIARYHOTKEY = 1, HELDDEVICEHOTKEYTYPECOUNT = 2`.
32+
`Enum` binding for `Actor.ActorHotkeyType`: `PRIMARYHOTKEY = 0, AUXILIARYHOTKEY = 1, ACTORHOTKEYTYPECOUNT = 2`.
33+
Both `Actor` and `HeldDevice` have the following functions:
34+
`HotkeyActionIsActivated(hotkeyType)` returns whether a certain hotkey action is being activated or not.
35+
`ActivateHotkeyAction(hotkeyType)` activates a certain hotkey action.
36+
`DeactivateHotkeyAction(hotkeyType)` deactivates a certain hotkey action.
37+
38+
- New hotkey bindings.
39+
On Mouse+KB PC the defaults are: Weapon Primary Hotkey on V, Weapon Auxiliary Hotkey on H, Actor Primary Hotkey on X, Actor Auxiliary Hotkey on O.
40+
Added new `Controller` states `WEAPON_PRIMARY_HOTKEYSTART`, `WEAPON_AUXILIARY_HOTKEYSTART`, `ACTOR_PRIMARY_HOTKEYSTART`, `ACTOR_AUXILIARY_HOTKEYSTART`, `WEAPON_PRIMARY_HOTKEY`, `WEAPON_AUXILIARY_HOTKEY`, `ACTOR_PRIMARY_HOTKEY`, `ACTOR_AUXILIARY_HOTKEY`
41+
42+
- Added multiseat support for multiple mice and keyboards on one computer.
43+
44+
- Added optional player argument to all `UInputMan:Key*` Lua Methods. (e.g. `KeyHeld(keycode, player)`) This allows checking individual player's keyboards, when multiple keyboards are available.
45+
2946
- New music system, including a dynamic horizontal sequencing system, under the new music manager `MusicMan`.
3047
`PlayDynamicSong(string songName, string songSectionName, bool playImmediately, bool playTransition, bool smoothFade)` to play a new DynamicSong.
3148
`SetNextDynamicSongSection(string songSectionName, bool playImmediately, bool playTransition, bool smoothFade)` to queue a new DynamicSongSection for the currently playing song.
@@ -51,19 +68,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5168
- 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.
5269

5370
- New `MOSprite` INI and Lua (R/W) integer property `ForcedHFlip` which forces a certain flippedness and disallows anything else from ever changing it without clearing the forced value first. 0 is forced not flipped, 1 forced flipped, and -1 is no force.
54-
55-
- New hotkey bindings.
56-
On Mouse+KB PC the defaults are: Weapon Primary Hotkey on V, Weapon Auxiliary Hotkey on H, Actor Primary Hotkey on X, Actor Auxiliary Hotkey on O.
57-
Added new `Controller` states `WEAPON_PRIMARY_HOTKEYSTART`, `WEAPON_AUXILIARY_HOTKEYSTART`, `ACTOR_PRIMARY_HOTKEYSTART`, `ACTOR_AUXILIARY_HOTKEYSTART`, `WEAPON_PRIMARY_HOTKEY`, `WEAPON_AUXILIARY_HOTKEY`, `ACTOR_PRIMARY_HOTKEY`, `ACTOR_AUXILIARY_HOTKEY`
58-
59-
- New hotkey system for `Actor` and `HeldDevice`.
60-
Pressing a certain new hotkey will mark it as activated on `Actor` and `HeldDevice`, letting scripts make use of the new bindings easily.
61-
`Enum` binding for `HeldDevice.HeldDeviceHotkeyType`: `PRIMARYHOTKEY = 0, AUXILIARYHOTKEY = 1, HELDDEVICEHOTKEYTYPECOUNT = 2`.
62-
`Enum` binding for `Actor.ActorHotkeyType`: `PRIMARYHOTKEY = 0, AUXILIARYHOTKEY = 1, ACTORHOTKEYTYPECOUNT = 2`.
63-
Both `Actor` and `HeldDevice` have the following functions:
64-
`HotkeyActionIsActivated(hotkeyType)` returns whether a certain hotkey action is being activated or not.
65-
`ActivateHotkeyAction(hotkeyType)` activates a certain hotkey action.
66-
`DeactivateHotkeyAction(hotkeyType)` deactivates a certain hotkey action.
6771

6872
- New `Controller` state `WEAPON_RELOADHELD`, which is true every frame reload input is held (as opposed to `WEAPON_RELOAD` which is only true once when pressed).
6973

@@ -81,6 +85,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
8185

8286
- New `Attachable` INI and Lua (R/W) properties `InheritsVelWhenDetached` and `InheritsAngularVelWhenDetached`, which determine how much of these velocities an attachable inherits from its parent when detached. Defaults to 1.
8387

88+
- New Z Order for scene layers and primitives: Background layer sits at z=100, Terrain Background at z=50, Terrain color and MO color at z=0, GUIs sit at z=-100, allowed z range is [-200, +200], in the future this'll be expanded to MO draw as well.
8489
- Added Lua-accessible bitmap manipulation functions to `MOSprite`s:
8590
```
8691
GetSpritePixelIndex(int x, int y, int whichFrame) - Returns the color index of the pixel at the given coordinate on the given frame of the sprite ((0, 0) is the upper left corner!)
@@ -103,6 +108,15 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
103108

104109
- New `SceneMan` function `CastAllMOsRay(startVector, rayVector, table ignoreMOIDs, ignoreTeam, ignoreMaterial, bool ignoreAllTerrain, int skip)` which returns an iterator with pointers to all the non-ignored MOs met along the ray.
105110

111+
- New parameter `depth` for all primitives sets draw depth of the drawn primitive. The default depth is -75.0 (lower numbers draw on top, higher numbers in the back).
112+
113+
- New `DrawDepth` enum for default draw depths:
114+
- `Default` = 0.0f (Main draw depth for MOs)
115+
- `GUI` = -100.0f (Draw Depth of GUI elements)
116+
- `Primitive` = -75.0f (Default Primitive draw depth)
117+
- `TerrainBackground` = 50.0f (Draw Depth of Terrain Background layer)
118+
- `Background` = 100.0f (Draw Depth of Background layer)
119+
106120
- Added scaling capability to Bitmap primitives.
107121
New draw bindings with argument for scale are:
108122
```
@@ -122,9 +136,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
122136
```
123137
Original bindings with no scale argument are untouched and can be called as they were.
124138

125-
- Added multiseat support for multiple mice and keyboards on one computer.
126-
127-
- Added optional player argument to all `UInputMan:Key*` Lua Methods. (e.g. `KeyHeld(keycode, player)`) This allows checking individual player's keyboards, when multiple keyboards are available.
139+
- New option to mute audio when the game window loses focus.
128140

129141
</details>
130142

@@ -136,9 +148,19 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
136148
The Ronin Scrambler, the basic scanner, and `SceneMan:CastUnseenRay` have been changed to accomodate fog-of-war resolutions as fine as 1x1 and as coarse as 20x20.
137149
The fog-of-war revealing code is now multithreaded to increase performance.
138150

151+
- Save files are now compressed and stored in a single file, instead of a directory.
152+
Savefiles have the extension `.ccsave`, but their underlying format is really just a `.zip` file. This can be opened and modified as before with any zip file viewer.
153+
These savefiles can be safely renamed and moved without breaking the savegame, unlike before.
154+
155+
- New GPU Renderer using now OpenGL + Raylib, dramatically improving draw performance. Draw now takes a negligible amount of time.
156+
139157
- All vanilla scenario activities have had their settings polished, respecting settings which make sense and disabling settings which don't.
140158
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.
141159

160+
- The "Clear" Preset button in the Buy Menu now clears the currently selected loadout, instead of the last one in the list.
161+
162+
- Loadouts are now additive, and append their items into the cart instead of replacing the current cart item list.
163+
142164
- 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.
143165

144166
- `MovableMan:OpenAllDoors()`, when passed `NOTEAM`, will now open/close doors specifically for `NOTEAM` (instead of all doors).
@@ -168,6 +190,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
168190

169191
- `InheritsVel` and its ilk have been uncapped, allowing users to set them outside of 0-1.
170192

193+
- Lua renamed `SceneLayer`->`StaticSceneLayer` due to changed SLBackground base class.
194+
171195
- `Scene` Lua functions `AddNavigatableArea(areaName)` and `ClearNavigatableAreas()` have been renamed/corrected to `AddNavigableArea(areaName)` and `ClearNavigableAreas()`, respectively.
172196

173197
- `MOSRotating` Lua function `AddWound` now additionally accepts the format `MOSRotating:AddWound(AEmitter* woundToAdd, const Vector& parentOffsetToSet, bool checkGibWoundLimit, bool isEntryWound, bool isExitWound)`, allowing modders to specify added wounds as entry- or exit wounds, for the purpose of not playing multiple burst sounds on the same frame. These new arguments are optional.
@@ -204,6 +228,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
204228

205229
- Fixed an issue where internal Lua functions OriginalDoFile, OriginalLoadFile, and OriginalRequire were polluting the global namespace. They have now been made inaccessible.
206230

231+
- Fixed the palette being mangled to 6bit/color on load.
232+
233+
- Fixed allegro not loading alpha of image with alpha by using SDL_image instead.
207234
- Fixed `MOSprite:UnRotateOffset()` giving the wrong results on HFLipped sprites.
208235

209236
- Various fixes and improvements to inventory management when dual-wielding or carrying a shield, to stop situations where the actor unexpectedly puts their items away.

Data/Base.rte/GUIs/BuyMenuGUI.ini

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ Anchor = Left, Top
211211
Text = Shields
212212
Checked = False
213213

214-
[SetsTab]
214+
[LoadoutsTab]
215215
ControlType = TAB
216216
Parent = BuyGUIBox
217217
X = 2
@@ -220,9 +220,9 @@ Width = 57
220220
Height = 17
221221
Visible = True
222222
Enabled = True
223-
Name = SetsTab
223+
Name = LoadoutsTab
224224
Anchor = Left, Top
225-
Text = Presets
225+
Text = Loadouts
226226
Checked = False
227227

228228
[CargoLabel]
@@ -439,7 +439,7 @@ Name = SaveButton
439439
Anchor = Left, Top
440440
Text = Save
441441

442-
[ClearButton]
442+
[DeleteButton]
443443
ControlType = BUTTON
444444
Parent = BuyGUIBox
445445
X = 4
@@ -448,6 +448,6 @@ Width = 48
448448
Height = 18
449449
Visible = True
450450
Enabled = True
451-
Name = ClearButton
451+
Name = DeleteButton
452452
Anchor = Left, Top
453-
Text = Clear
453+
Text = Delete

Data/Base.rte/GUIs/MetagameGUI.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ Visible = True
118118
Enabled = True
119119
Name = DifficultyLabel
120120
Anchor = Left, Top, Right
121-
ToolTip = Diificulty
121+
ToolTip = Difficulty
122122
Text = Difficulty: Medium
123123
HAlignment = centre
124124
VAlignment = middle

Data/Base.rte/GUIs/SaveLoadMenuGUI.ini

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ Anchor = Left, Top
171171
ToolTip = None
172172
Text = Delete Save
173173

174-
[ActivityCannotBeSavedWarning]
174+
[DescriptionLabel]
175175
ControlType = LABEL
176176
Parent = CollectionBoxSaveGameMenu
177177
X = 7
@@ -180,9 +180,8 @@ Width = 287
180180
Height = 20
181181
Visible = True
182182
Enabled = True
183-
Name = ActivityCannotBeSavedWarning
183+
Name = DescriptionLabel
184184
Anchor = Left, Top
185-
Text = The currently played activity does not allow saving.
186185
HAlignment = Centre
187186
VAlignment = Centre
188187

Data/Base.rte/GUIs/SettingsGUI.ini

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -713,6 +713,20 @@ Anchor = Left, Top
713713
Checked = Unchecked
714714
Text = Mute
715715

716+
[CheckboxMuteAudioOnFocusLoss]
717+
ControlType = CHECKBOX
718+
Parent = CollectionBoxAudioSettings
719+
X = 145
720+
Y = 189
721+
Width = 120
722+
Height = 20
723+
Visible = True
724+
Enabled = True
725+
Name = CheckboxMuteAudioOnFocusLoss
726+
Anchor = Middle, Top
727+
Checked = Unchecked
728+
Text = Mute On Focus Loss?
729+
716730
///////////////////////////////////////////////////////////////////////
717731
// Input Settings Menu
718732

Data/Base.rte/GUIs/SettingsPauseGUI.ini

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -714,6 +714,20 @@ Anchor = Left, Top
714714
Checked = Unchecked
715715
Text = Mute
716716

717+
[CheckboxMuteAudioOnFocusLoss]
718+
ControlType = CHECKBOX
719+
Parent = CollectionBoxAudioSettings
720+
X = 145
721+
Y = 189
722+
Width = 120
723+
Height = 20
724+
Visible = True
725+
Enabled = True
726+
Name = CheckboxMuteAudioOnFocusLoss
727+
Anchor = Middle, Top
728+
Checked = Unchecked
729+
Text = Mute On Focus Loss?
730+
717731
///////////////////////////////////////////////////////////////////////
718732
// Input Settings Menu
719733

Data/Base.rte/Shaders/Background.frag

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
1-
#version 130
1+
#version 330
2+
#extension GL_KHR_blend_equation_advanced: enable
3+
#extension GL_ARB_sample_shading: enable
24

35
in vec2 textureUV;
46
in vec4 vertexColor;
57

8+
#ifdef GL_KHR_blend_equation_advanced
9+
layout(blend_support_all_equations) out;
10+
#endif
611
out vec4 FragColor;
7-
812
uniform sampler2D rteTexture;
913
uniform sampler2D rtePalette;
10-
uniform vec4 rteColor;
11-
uniform bool drawMasked;
14+
uniform vec4 rteColor = vec4(1.0);
15+
uniform bool rteBlendInvert = false;
16+
uniform bool drawMasked = false;
1217

1318

1419
vec4 texture2DAA(sampler2D tex, vec2 uv) {
@@ -25,5 +30,9 @@ void main() {
2530
if (red==0 && drawMasked) {
2631
discard;
2732
}
28-
FragColor = texture2DAA(rtePalette, vec2(red * rteColor.r * vertexColor.r, 0.0)) * vec4(vec3(1.0), rteColor.a * vertexColor.a);
33+
if (!rteBlendInvert) {
34+
FragColor = texture2DAA(rtePalette, vec2(red * vertexColor.r, 0.0)) * vec4(rteColor.rgb, rteColor.a * vertexColor.a);
35+
} else {
36+
FragColor = vec4(vec3(1.0), 0.0) - (texture2DAA(rtePalette, vec2(red * vertexColor.r, 0.0)) * vec4(rteColor.rgb, -rteColor.a * vertexColor.a));
37+
}
2938
}

Data/Base.rte/Shaders/Blit8.vert

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ in vec4 rteVertexColor;
66

77
out vec2 textureUV;
88
out vec4 vertexColor;
9-
//uniform mat4 rteModelViewProjection;
9+
uniform mat4 rteView;
1010
uniform mat4 rteProjection;
1111

1212
void main() {
13-
gl_Position = rteProjection * vec4(rteVertexPosition, 1.0);
13+
gl_Position = rteProjection * rteView * vec4(rteVertexPosition, 1.0);
1414
textureUV = rteVertexTexUV;
1515
vertexColor = rteVertexColor;
1616
}

Data/Base.rte/Shaders/Dissolve.frag

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
#version 130
2+
3+
in vec2 textureUV;
4+
in vec4 vertexColor;
5+
6+
out vec4 FragColor;
7+
8+
uniform sampler2D rteTexture;
9+
uniform sampler2D rtePalette;
10+
uniform vec4 rteColor;
11+
12+
// Pseudo random number generator.
13+
float hash( vec2 a )
14+
{
15+
return fract( sin( a.x * 3433.8 + a.y * 3843.98 ) * 45933.8 );
16+
}
17+
18+
// Value noise courtesy of BigWingz
19+
// check his youtube channel he has
20+
// a video of this one.
21+
// Succint version by FabriceNeyret
22+
float noise( vec2 U )
23+
{
24+
vec2 id = floor( U );
25+
U = fract( U );
26+
U *= U * ( 3. - 2. * U );
27+
28+
vec2 A = vec2( hash(id), hash(id + vec2(0,1)) );
29+
vec2 B = vec2( hash(id + vec2(1,0)), hash(id + vec2(1,1)) );
30+
vec2 C = mix( A, B, U.x);
31+
32+
return mix( C.x, C.y, U.y );
33+
}
34+
35+
vec4 texture2DAA(sampler2D tex, vec2 uv) {
36+
vec2 texsize = vec2(textureSize(tex, 0));
37+
vec2 uv_texspace = uv * texsize;
38+
vec2 seam = floor(uv_texspace + .5);
39+
uv_texspace = (uv_texspace - seam) / fwidth(uv_texspace) + seam;
40+
uv_texspace = clamp(uv_texspace, seam - .5, seam + .5);
41+
return texture(tex, uv_texspace / texsize);
42+
}
43+
44+
void main() {
45+
if (noise(gl_FragCoord.xy + textureUV) < 0.5) {
46+
discard;
47+
}
48+
float red = texture2D(rteTexture, textureUV).r;
49+
vec4 color = texture2DAA(rtePalette, vec2(red * vertexColor.r, 0.0)) * vec4(rteColor.rgb, rteColor.a * vertexColor.a);
50+
51+
FragColor = color;
52+
}

0 commit comments

Comments
 (0)