Skip to content

Commit

Permalink
Merge branch 'develop' into Yathsou_nerf_pt2
Browse files Browse the repository at this point in the history
  • Loading branch information
Basilisk3 authored Jan 4, 2025
2 parents 90cba89 + 12c3305 commit bce22f5
Show file tree
Hide file tree
Showing 68 changed files with 166 additions and 18 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
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/fix.6544.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- (#6544) Fix unit transfer enabling weapons locked by enhancements, such as the TML of the Seraphim SACU.
1 change: 1 addition & 0 deletions changelog/snippets/fix.6583.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- (#6583) Fix personal shields reflecting above the water surface.
1 change: 0 additions & 1 deletion changelog/snippets/other.6577.md

This file was deleted.

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.
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
8 changes: 8 additions & 0 deletions effects/mesh.fx
Original file line number Diff line number Diff line change
Expand Up @@ -4085,6 +4085,8 @@ float4 CybranShieldImpactPS( SHIELDIMPACT_VERTEX vertex, uniform float fadeTime,

float4 PhaseShieldPS( VERTEXNORMAL_VERTEX vertex ) : COLOR
{
if (1 == mirrored) clip(vertex.depth.x);

float2 tc1 = vertex.texcoord0.xy * 0.5;
tc1.x += 0.005 * vertex.material.x;
tc1.y += 0.02 * vertex.material.x;
Expand All @@ -4108,6 +4110,8 @@ float4 PhaseShieldPS( VERTEXNORMAL_VERTEX vertex ) : COLOR

float4 AeonPhaseShieldPS( VERTEXNORMAL_VERTEX vertex ) : COLOR
{
if (1 == mirrored) clip(vertex.depth.x);

float2 tc1 = vertex.texcoord0.xy * 2;
tc1.x += 0.005 * vertex.material.x;
tc1.y += 0.02 * vertex.material.x;
Expand All @@ -4131,6 +4135,8 @@ float4 AeonPhaseShieldPS( VERTEXNORMAL_VERTEX vertex ) : COLOR

float4 CybranPhaseShieldPS( VERTEXNORMAL_VERTEX vertex ) : COLOR
{
if (1 == mirrored) clip(vertex.depth.x);

float2 tc1 = vertex.texcoord0.xy * 2;
tc1.x += 0.1 * vertex.material.x;
tc1.y += 0.5 * vertex.material.x;
Expand All @@ -4156,6 +4162,8 @@ float4 CybranPhaseShieldPS( VERTEXNORMAL_VERTEX vertex ) : COLOR

float4 SeraphimPhaseShieldPS( VERTEXNORMAL_VERTEX vertex ) : COLOR
{
if (1 == mirrored) clip(vertex.depth.x);

float2 tc1 = vertex.texcoord0.xy * 0.5;
tc1.x += 0.005 * vertex.material.x;
tc1.y += 0.02 * vertex.material.x;
Expand Down
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
8 changes: 6 additions & 2 deletions lua/SimUtils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -302,8 +302,12 @@ function TransferUnitsOwnership(units, toArmy, captured)
-- disable all weapons, enable with a delay
for k = 1, unit.WeaponCount do
local weapon = unit:GetWeapon(k)
weapon:SetEnabled(false)
weapon:ForkThread(TransferUnitsOwnershipDelayedWeapons)
-- Weapons disabled by enhancement shouldn't be re-enabled unless the enhancement is built
local enablingEnhancement = weapon.Blueprint.EnabledByEnhancement
if not enablingEnhancement or (activeEnhancements and activeEnhancements[enablingEnhancement]) then
weapon:SetEnabled(false)
weapon:ForkThread(TransferUnitsOwnershipDelayedWeapons)
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
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
24 changes: 22 additions & 2 deletions lua/ui/lobby/autolobby/AutolobbyController.lua
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,33 @@ local AutolobbyEngineStrings = {
['LaunchRejected'] = "<LOC lob_0009>Some players are using an incompatible client version.",
}

-- associated textures are in `/textures/divisions/<division> <subdivision>.png`
-- Make note of the space, which isn't there for "grandmaster" and "unlisted" divisions

---@alias Division
---| "bronze"
---| "silver"
---| "gold"
---| "diamond"
---| "master"
---| "grandmaster"
---| "unlisted"

---@alias Subdivision
---| "I"
---| "II"
---| "III"
---| "IV"
---| "V"
---| "" # when Division is grandmaster or unlisted

---@class UIAutolobbyPlayer: UILobbyLaunchPlayerConfiguration
---@field StartSpot number
---@field DEV number # Related to rating/divisions
---@field MEAN number # Related to rating/divisions
---@field NG number # Related to rating/divisions
---@field DIV string # Related to rating/divisions
---@field SUBDIV string # Related to rating/divisions
---@field DIV Division # Related to rating/divisions
---@field SUBDIV Subdivision # Related to rating/divisions
---@field PL number # Related to rating/divisions
---@field PlayerClan string

Expand Down
2 changes: 1 addition & 1 deletion lua/ui/lobby/autolobby/components/AutolobbyArguments.lua
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ AutolobbyArgumentsComponent = ClassSimple {
["/mean"] = true,

-- related to divisions
["division"] = true,
["/division"] = true,
["/subdivision"] = true,

-- related to game settings
Expand Down
41 changes: 41 additions & 0 deletions lua/ui/lobby/changelogData.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,47 @@ last_version = 3816

---@type PatchNotes[]
gamePatches = {
{
version = 3817,
name = "Hotfix",
hasPrettyGithubRelease = true,
hasPrettyPatchnotes = false,
description = {
"# 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",
"",
},
},
{
version = 3816,
name = "Hotfix",
Expand Down
6 changes: 3 additions & 3 deletions lua/version.lua
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ local Commit = 'unknown' -- The use of `'` instead of `"` is **intentional**

--#endregion

local Version = "3816"
---@alias PATCH "3816"
---@alias VERSION "1.5.3816"
local Version = "3817"
---@alias PATCH "3817"
---@alias VERSION "1.5.3817"
---@return PATCH # Game release
function GetVersion()
LOG(string.format('Supreme Commander: Forged Alliance Lua version %s at %s (%s)', Version, GameType, Commit))
Expand Down
2 changes: 1 addition & 1 deletion mod_info.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
-- - https://github.com/FAForever/fa/blob/deploy/fafdevelop/lua/MODS.LUA

name = "Forged Alliance Forever"
version = 3816 -- needs to be an integer as it is parsed as a short (16 bit integer)
version = 3817 -- needs to be an integer as it is parsed as a short (16 bit integer)
_faf_modname='faf'
copyright = "Forged Alliance Forever Community"
description = "Forged Alliance Forever extends Forged Alliance, bringing new patches, game modes, units, ladder, and much more!"
Expand Down
22 changes: 18 additions & 4 deletions scripts/LaunchFAInstances.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,18 @@ if (Test-Path $debuggerExecutable) {
}

# Command-line arguments common for all instances
$baseArguments = '/init "init_dev.lua" /EnableDiskWatch /nomovie /RunWithTheWind /gameoptions CheatsEnabled:true GameSpeed:adjustable '
$baseArguments = '/init "init_dev.lua" /EnableDiskWatch /nomovie /RunWithTheWind /gameoptions CheatsEnabled:true GameSpeed:adjustable'

# Game-specific settings
$hostProtocol = "udp"
$hostPlayerName = "HostPlayer_1"
$gameName = "MyGame"

# Array of factions to choose from
# Array of player data to choose from
$factions = @("UEF", "Seraphim", "Cybran", "Aeon")
$clans = @("Yps", "Nom", "Cly", "Mad", "Gol", "Kur", "Row", "Jip", "Bal", "She")
$divisions = @("bronze", "silver", "gold", "diamond", "master", "grandmaster", "unlisted")
$subdivisions = @("I", "II", "III", "IV", "V")

# Get the screen resolution (for placing and resizing the windows)
Add-Type -AssemblyName System.Windows.Forms
Expand Down Expand Up @@ -84,6 +86,15 @@ function Get-TeamArgument {
return "/team $((($instanceNumber % $teams) + 1 + 1))"
}

function Get-DivisionArgText {
$division = $($divisions | Get-Random)
$argText = "/division $division"
if ($division -ne "unlisted" -and $division -ne "grandmaster") {
$argText += " /subdivision $($subdivisions | Get-Random)"
}
return $argText
}

# Prepare arguments and launch instances
if ($players -eq 1) {
$logFile = "dev.log"
Expand All @@ -92,7 +103,9 @@ if ($players -eq 1) {
$hostLogFile = "host_dev_1.log"
$hostFaction = $factions | Get-Random
$hostTeamArgument = Get-TeamArgument -instanceNumber 0
$hostArguments = "/log $hostLogFile /showlog /hostgame $hostProtocol $port $hostPlayerName $gameName $map /startspot 1 /players $players /$hostFaction $hostTeamArgument $baseArguments /division HostDivision /subdivision 1 /clan $($clans | Get-Random)"

$divisionArgText = Get-DivisionArgText
$hostArguments = "/log $hostLogFile /showlog /hostgame $hostProtocol $port $hostPlayerName $gameName $map /startspot 1 /players $players /$hostFaction $hostTeamArgument $baseArguments $divisionArgText /clan $($clans | Get-Random)"

# Launch host game instance
Launch-GameInstance -instanceNumber 1 -xPos 0 -yPos 0 -arguments $hostArguments
Expand All @@ -108,7 +121,8 @@ if ($players -eq 1) {
$clientPlayerName = "ClientPlayer_$($i + 1)"
$clientFaction = $factions | Get-Random
$clientTeamArgument = Get-TeamArgument -instanceNumber $i
$clientArguments = "/log $clientLogFile /joingame $hostProtocol localhost:$port $clientPlayerName /startspot $($i + 1) /players $players /$clientFaction $clientTeamArgument $baseArguments /division Diamond /subdivision $($i + 1) /clan $($clans | Get-Random)"
$divisionArgText = Get-DivisionArgText
$clientArguments = "/log $clientLogFile /joingame $hostProtocol localhost:$port $clientPlayerName /startspot $($i + 1) /players $players /$clientFaction $clientTeamArgument $baseArguments $divisionArgText /clan $($clans | Get-Random)"

Launch-GameInstance -instanceNumber ($i + 1) -xPos $xPos -yPos $yPos -arguments $clientArguments
}
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes

0 comments on commit bce22f5

Please sign in to comment.