Skip to content

Commit

Permalink
Merge branch 'develop' into feature/cinematics
Browse files Browse the repository at this point in the history
  • Loading branch information
Garanas authored Dec 25, 2024
2 parents 47763eb + 8946edc commit 0244083
Show file tree
Hide file tree
Showing 71 changed files with 465 additions and 49 deletions.
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
"Lua.runtime.exportEnvDefault": true,
"Lua.completion.autoRequire": false,
"Lua.diagnostics.globals": ["ScenarioInfo"],
"Lua.format.defaultConfig": {
"max_line_length": "unset",
},

// used for grammar checks of changelog
"grammarly.files.include": [
Expand Down
1 change: 1 addition & 0 deletions changelog/snippets/balance.6464.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- (#6464) Make engineers assisting a shield start repairing the shield in 0.1 seconds instead of 0.7 to 1.1 seconds.
3 changes: 3 additions & 0 deletions changelog/snippets/features.6576.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- (#6576) Preserve the world camera when switching to/from split view

When you switch to/from split view the primary camera (the left camera) is now preserved. This makes it less disorientating for a player (or caster) to switch to/from split view.
1 change: 1 addition & 0 deletions changelog/snippets/other.6598.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- (#6598) Add documentation for the recently added `TransportSpeedReduction` unit blueprint value.
35 changes: 35 additions & 0 deletions docs/_posts/2024-12-10-3816.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
layout: post
title: Game version 3816
permalink: changelog/3816
---

# Game version 3816 (10th of December, 2024)

This hotfix primarily fixes the bug that rating and divisions were not displayed in matchmaker games.

With kind regards,

BlackYps

## Balance

- (#6568) Vulthoo have been underperforming after their rework. Their biggest weak point was the excessive amount of build time required which made it impractical to make them in the earlier stages of tech 2 especially.
- Vulthoo:
- BuildTime: 3300 --> 2700

## Bug fixes

- (#6546) Fix an exploit that allows being notified of enemy Billy nuke launches.

- (#6569) Fix the matchmaker lobby not passing ratings, divisions and clan tags to the session, making them not visible in the scoreboard.


## Contributors

With thanks to the following people who contributed through coding and testing:

- Jip
- Nomander
- ETFreeman
- Clyf
33 changes: 33 additions & 0 deletions docs/_posts/2024-12-25-3817.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
layout: post
title: Game version 3817
permalink: changelog/3817
---

# Game version 3817 (25th of December, 2024)

A small hotfix for the autolobby. This will be the final patch for the game in 2024.

I’d like to take this opportunity to express my sincere gratitude to everyone who has contributed to FAForever this past year, as well as those who have contributed in the past. The FAForever project is possible because of your time and effort!

If you're interested in contributing then I encourage you to visit the forums and review the first pinned post in the contribution section. It provides an extensive overview of the currently documented roles in the community. Whether you're an (aspiring) artist, developer, or simply interested in writing well-structured texts — you are welcome!

I wish you all the best in the new year.

With kind regards,
Jip

## Bug fixes

- (#6581) Fix divisions not being parsed by the matchmaker lobby.

- (#6581) Fix division image filenames not matching the division data in the scenario info.

## Other changes

- (#6577) Annotate `AddBlinkyBox`. This UI-side global engine function makes a unit's selection box blink for some time.

## Contributors

- Nomander
- Jip
3 changes: 3 additions & 0 deletions engine/Core/Blueprints/UnitBlueprint.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1169,6 +1169,9 @@
---@field StandUpright boolean
--- used by XSB3202 when the vertical layer changes from top to sub
---@field SubSpeedMultiplier? number
--- How much this unit slows down transports it is loaded in.
--- Defaults to 0.15 (Tech 1), 0.3 (Tech 2), 0.6 (Tech 3), and 1 (ACU/SACU/Experimentals).
---@field TransportSpeedReduction number
--- turn facing damping for the unit, usually used for hover units only
---@field TurnFacingRate number
--- turn radius for the unit, in world units. Used when the nav waypoint is further than `TurnRadius` distance,
Expand Down
5 changes: 2 additions & 3 deletions engine/User.lua
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,8 @@
--- - `CTRL-SHIFT-ALT-ESCAPE`
---@alias Hotkey string


--- No clue what this does
---@param entityId number
--- Repeatedly the selection box of the unit to the hovered-over state to create a blinking effect
---@param entityId EntityId
---@param onTime number
---@param offTime number
---@param totalTime number
Expand Down
2 changes: 2 additions & 0 deletions engine/User/CLobby.lua
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ local CLobby = {}
---@field Timeouts any # Read by the engine to determine the behavior of time outs.
---@field CivilianAlliance any # Read by the engine to determine the alliance towards civilians.
---@field GameSpeed any # Read by the engine to determine the behavior of game speed (adjustments).
---@field Ratings table<string, number>
---@field Divisions table<string, string>

---@class UILobbyLaunchGameModsConfiguration
---@field name string # Read by the engine, TODO
Expand Down
41 changes: 37 additions & 4 deletions lua/shield.lua
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ local MathSqrt = math.sqrt
local MathMin = math.min

local TableAssimilate = table.assimilate
local TableGetn = table.getn
local TableEmpty = table.empty

-- cache globals
local Warp = Warp
Expand All @@ -59,6 +61,9 @@ local ArmyGetHandicap = ArmyGetHandicap
local CoroutineYield = coroutine.yield
local CreateEmitterAtBone = CreateEmitterAtBone
local _c_CreateShield = _c_CreateShield
local IssueClearCommands = IssueClearCommands
local IssueRepair = IssueRepair
local IssueGuard = IssueGuard

-- cache cfunctions
local EntityGetHealth = _G.moho.entity_methods.GetHealth
Expand Down Expand Up @@ -87,6 +92,8 @@ local EntitySetParentOffset = _G.moho.entity_methods.SetParentOffset
local UnitSetScriptBit = _G.moho.unit_methods.SetScriptBit
local UnitIsUnitState = _G.moho.unit_methods.IsUnitState
local UnitRevertCollisionShape = _G.moho.unit_methods.RevertCollisionShape
local UnitGetGuards = _G.moho.unit_methods.GetGuards
local UnitGetCommandQueue = _G.moho.unit_methods.GetCommandQueue

local IEffectOffsetEmitter = _G.moho.IEffect.OffsetEmitter

Expand Down Expand Up @@ -356,7 +363,7 @@ Shield = ClassShield(moho.shield_methods, Entity) {

--- Retrieves allied shields that overlap with this shield, caches the results per tick
-- @param self A shield that we're computing the overlapping shields for
-- @param tick Optional parameter, represents the game tick. Used to determine if we need to refresh the cash
-- @param tick Optional parameter, represents the game tick. Used to determine if we need to refresh the cache
GetOverlappingShields = function(self, tick)

-- allow the game tick to be send to us, saves cycles
Expand Down Expand Up @@ -509,6 +516,12 @@ Shield = ClassShield(moho.shield_methods, Entity) {
self:ApplyDamage(instigator, amount, vector, damageType, true)
end,

---@param self Shield
---@param instigator Unit
---@param amount number
---@param vector Vector
---@param dmgType DamageType
---@param doOverspill boolean
ApplyDamage = function(self, instigator, amount, vector, dmgType, doOverspill)

-- cache information used throughout the function
Expand Down Expand Up @@ -565,12 +578,32 @@ Shield = ClassShield(moho.shield_methods, Entity) {

-- do damage logic for shield

if self.Owner ~= instigator then
local owner = self.Owner
if owner ~= instigator then
local absorbed = self:OnGetDamageAbsorption(instigator, amount, dmgType)

-- take some damage
EntityAdjustHealth(self, instigator, -absorbed)

-- force guards to start repairing in 1 tick instead of waiting for them to react 7-11 ticks
if tick > owner.tickIssuedShieldRepair then
owner.tickIssuedShieldRepair = tick
local guards = UnitGetGuards(owner)
if not TableEmpty(guards) then
-- filter out guards with something queued after the shield assist order, as to not delete clear their queue
for i, guard in guards do
if TableGetn(UnitGetCommandQueue(guard)) >= 2 then
guards[i] = nil
end
end

-- For the filtered guards, clear their assist order, order repair, then re-add the assist order after
IssueClearCommands(guards)
IssueRepair(guards, owner)
IssueGuard(guards, owner)
end
end

-- check to spawn impact effect
local r = Random(1, self.Size)
if dmgType ~= "ShieldSpill"
Expand Down Expand Up @@ -684,8 +717,8 @@ Shield = ClassShield(moho.shield_methods, Entity) {
end,

--- Called when a shield collides with a projectile to check if the collision is valid
-- @param self The shield we're checking the collision for
-- @param other The projectile we're checking the collision with
---@param self Shield The shield we're checking the collision for
---@param other Projectile The projectile we're checking the collision with
OnCollisionCheck = function(self, other)

-- special logic when it is a projectile to simulate air crashes
Expand Down
9 changes: 3 additions & 6 deletions lua/sim/Unit.lua
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ local cUnitGetBuildRate = cUnit.GetBuildRate
---@field ReclaimTimeMultiplier? number
---@field CaptureTimeMultiplier? number
---@field PlatoonHandle? Platoon
---@field tickIssuedShieldRepair number? # Used by shields to keep track of when this unit's guards were ordered to start shield repair instantly
Unit = ClassUnit(moho.unit_methods, IntelComponent, VeterancyComponent, DebugUnitComponent) {

IsUnit = true,
Expand Down Expand Up @@ -2156,14 +2157,10 @@ Unit = ClassUnit(moho.unit_methods, IntelComponent, VeterancyComponent, DebugUni
return
end

local bp = self.Blueprint.Audio
local bp = self.Blueprint.Audio.NuclearLaunchDetected
if bp then
for num, aiBrain in ArmyBrains do
local factionIndex = aiBrain:GetFactionIndex()

if bp['NuclearLaunchDetected'] then
aiBrain:NuclearLaunchDetected(bp['NuclearLaunchDetected'])
end
aiBrain:NuclearLaunchDetected(bp)
end
end
end,
Expand Down
2 changes: 0 additions & 2 deletions lua/sim/units/AirTransportUnit.lua
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,6 @@ AirTransport = ClassUnit(AirUnit, BaseTransport) {
end,

---@param self AirTransport
---@param totalweight CargoWeight
---@param unit Unit
ReduceTransportSpeed = function(self)
local transportspeed = self.Blueprint.Air.MaxAirspeed
local totalweight = 0
Expand Down
24 changes: 16 additions & 8 deletions lua/sim/weapons/DefaultProjectileWeapon.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1058,18 +1058,26 @@ DefaultProjectileWeapon = ClassWeapon(Weapon) {
-- Decrement the ammo if they are a counted projectile
if proj and not proj:BeenDestroyed() and countedProjectile then
if bp.NukeWeapon then
-- Play the "Strategic launch detected" VO to all armies
unit:NukeCreatedAtUnit()
unit:RemoveNukeSiloAmmo(1)

-- Generate UI notification for automatic nuke ping
local launchData = {
army = self.Army - 1,
location = (GetFocusArmy() == -1 or IsAlly(self.Army, GetFocusArmy())) and
self:GetCurrentTargetPos() or nil
}
if not Sync.NukeLaunchData then
Sync.NukeLaunchData = {}
-- Enemies receive the notification without location data to avoid cheats, while still being notified visually instead of only by audio

local isObsOrAlly = GetFocusArmy() == -1 or IsAlly(self.Army, GetFocusArmy())

-- the global VO plays only when the audio exists, so notify enemies if it exists
if isObsOrAlly or unit.Blueprint.Audio.NuclearLaunchDetected ~= nil then
local launchData = {
army = self.Army - 1,
location = isObsOrAlly and self:GetCurrentTargetPos() or nil
}
if not Sync.NukeLaunchData then
Sync.NukeLaunchData = {}
end
table.insert(Sync.NukeLaunchData, launchData)
end
table.insert(Sync.NukeLaunchData, launchData)
else
unit:RemoveTacticalSiloAmmo(1)
end
Expand Down
23 changes: 21 additions & 2 deletions lua/ui/game/worldview.lua
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ local function CreatePositionMarker(army, worldView)
marker.frame.Depth:Set(marker:Depth() - 1)

marker.name = UIUtil.CreateText(marker, data.name, 12, UIUtil.bodyFont)
marker.name:DisableHitTest()
marker.name:DisableHitTest()
marker.name:SetColor('white')

if Factions[data.faction] then
Expand Down Expand Up @@ -120,7 +120,7 @@ function MarkStartPositions(startPositions)
local faction = armyData.faction + 1
local color = armyData.color

positionMarkers[armyId] = {army = armyId, pos = pos, name = name, faction = faction, color = color, views = 0}
positionMarkers[armyId] = { army = armyId, pos = pos, name = name, faction = faction, color = color, views = 0 }

for viewName, view in MapControls do
if viewName ~= 'MiniMap' then
Expand All @@ -132,6 +132,16 @@ function MarkStartPositions(startPositions)
end

function CreateMainWorldView(parent, mapGroup, mapGroupRight)
-- feature: preserve the world camera when changing views
---@type UserCamera
local worldCamera = GetCamera('WorldCamera')

---@type UserCameraSettings | nil
local worldCameraSettings = nil
if worldCamera then
worldCameraSettings = worldCamera:SaveSettings()
end

if viewLeft then
viewLeft:Destroy()
viewLeft = false
Expand Down Expand Up @@ -176,6 +186,15 @@ function CreateMainWorldView(parent, mapGroup, mapGroupRight)
view:DisableHitTest()
LayoutHelpers.FillParent(view, viewLeft)
end

-- feature: preserve the world camera when changing views
if worldCameraSettings then
local newWorldCamera = GetCamera('WorldCamera')
if newWorldCamera then
newWorldCamera:RestoreSettings(worldCameraSettings)
end
end

import("/lua/ui/game/multifunction.lua").RefreshMapDialog()
end

Expand Down
Loading

0 comments on commit 0244083

Please sign in to comment.