View Issue Details

IDProjectCategoryLast Update
0025675AI War 2Bug - GameplayOct 27, 2021 6:41 am
Reportertom.prince Assigned Totom.prince  
Status resolvedResolutionfixed 
Product VersionBeta 3.712 Loading Hotfix 
Fixed in VersionBeta 3.740 Code Panopticon 
Summary0025675: Spire Cities and Fleets don't upgrade properly.
DescriptionThere are a couple of issues I've noticed with upgrading Spire Cities:
- Upgrading the hub doesn't upgrade any of the buildings in the city, since they don't have `this_centerpiece_grants_its_direct_science_upgrades_to_rest_of_fleet` set. (Attached patch spire-city-fleet-upgrade.patch
)
- ''MaxMarkLevelOfAnyInFleet'' isn't set for ''FleetCategory.PlayerCustomCity'' in ''PerFrame_CalculateEffectiveFleetData_P1'', but it is used in ''RecalculateSpireCityMobileFleetContents_MainThreadSimOnly''. (Attached a workaound in spire-city-MaxMarkLevelOfAnyInFleet-workaround.patch, but it should probably be fixed in core)
- I *think* that Spire Fleets want to be upgraded as with science (instead of via `SetCurrentMarkLevel` like the current version does. (Attached patch spire-fleet-science-upgrade.patch). I'm not sure this is the intended behavior, but there doesn't appear to be a way to set the mark level for an individual ship line or centerpiece. If there was, it might make sense to have the ship lines from each bolstering city have the mark level of that city; but that would require some more extensive changes in core.
- There are two copies of the code to upgrade the Spire Fleet centerpiece. This causes them to be duplicated when upgraded, with the second one getting a random fleet name. (Attached patch spire-fleet-duplicate-centerpiece.patch; I chose to remove the copy with the journal entries, since they refer to the planet of the fleet, which is no longer a thing)
TagsNo tags attached.

Activities

tom.prince

Oct 18, 2021 3:58 am

developer  

spire-fleet-duplicate-centerpiece.patch (4,015 bytes)   
# HG changeset patch
# User Tom Prince <[email protected]>
# Date 1634542255 21600
#      Mon Oct 18 01:30:55 2021 -0600
# Node ID 1f9b396bcd8bc10f85c66eff0dbc1703a4742ee7
# Parent  363f91b379dac8fa2d3d700b636257640e4b9351
Remove duplicate centerpiece upgrading for Spire Fleets.

diff --git CodeExternal/AIWarExternalDeepProcessingCode/src/DeepInfo/DLC1/FallenSpireFactionDeepInfo.cs CodeExternal/AIWarExternalDeepProcessingCode/src/DeepInfo/DLC1/FallenSpireFactionDeepInfo.cs
--- CodeExternal/AIWarExternalDeepProcessingCode/src/DeepInfo/DLC1/FallenSpireFactionDeepInfo.cs
+++ CodeExternal/AIWarExternalDeepProcessingCode/src/DeepInfo/DLC1/FallenSpireFactionDeepInfo.cs
@@ -2193,23 +2193,6 @@ namespace Arcen.AIW2.External
                 } );
                 #endregion
 
-                //if our flagship is not the correct type based on the mark level of the city, then transform the flagship.
-                if ( maxMarkLevelOfAnyCity >= 6 ) //any city mark 6 or higher
-                {
-                    if ( mobileFlagship != null && mobileFlagship.TypeData != desiredFlagshipData )
-                    {
-                        mobileFlagship.TransformInto( Context, desiredFlagshipData, 1, mobileFlagship.TypeData.KeepDamageAndDebuffsOnTransformation );
-                        World_AIW2.Instance.QueueLogJournalEntryToSidebar( "TSR_Spire_DreadnaughtFlagship", string.Empty, faction, null, mobileFlagship.Planet, OnClient.DoThisOnHostOnly_WillBeSentToClients );
-                    }
-                }
-                else if ( maxMarkLevelOfAnyCity >= 3 ) //any city mark 3 or higher
-                {
-                    if ( mobileFlagship != null && mobileFlagship.TypeData != desiredFlagshipData )
-                    {
-                        mobileFlagship.TransformInto( Context, desiredFlagshipData, 1, mobileFlagship.TypeData.KeepDamageAndDebuffsOnTransformation );
-                        World_AIW2.Instance.QueueLogJournalEntryToSidebar( "TSR_Spire_BattleshipFlagship", string.Empty, faction, null, mobileFlagship.Planet, OnClient.DoThisOnHostOnly_WillBeSentToClients );
-                    }
-                }
 
                 if ( mobileFlagship != null )
                 {
diff --git Expansions/1_The_Spire_Rises/GameData/Configuration/JournalEntries/TSR_Journal_SpireCampaign.xml Expansions/1_The_Spire_Rises/GameData/Configuration/JournalEntries/TSR_Journal_SpireCampaign.xml
--- Expansions/1_The_Spire_Rises/GameData/Configuration/JournalEntries/TSR_Journal_SpireCampaign.xml
+++ Expansions/1_The_Spire_Rises/GameData/Configuration/JournalEntries/TSR_Journal_SpireCampaign.xml
@@ -257,18 +257,4 @@ While the Spire call these 'toy' ships, 
 
 These ships pack devastating armaments against large single targets, but require significantly more resources to build." />
 
-  <journal name="TSR_Spire_BattleshipFlagship" sidebar_text="{FactionColor}Spire&lt;/color&gt; Battleship Flagship" can_record_another_copy_if_already_recorded_in_this_campaign="false"
-           chat_text="One of our Flagships has upgraded!"           
-           text_replacement_related_faction_color="true"
-           text_replacement_related_planet="true"
-    full_text="Commander, the Spire Flagship attached to {PlanetName}'s city has been upgraded! We now have our first Spire Battleship. This ship is vastly more powerful than the Cruiser class." />
-
-  <journal name="TSR_Spire_DreadnaughtFlagship" sidebar_text="{FactionColor}Spire&lt;/color&gt; Dreadnaught Flagship" can_record_another_copy_if_already_recorded_in_this_campaign="false"
-           chat_text="One of our Flagships has upgraded!"           
-           text_replacement_related_faction_color="true"
-           text_replacement_related_planet="true"
-    full_text="Commander, the Spire Flagship on {PlanetName}'s has been upgraded! We now have our first Spire Dreadnaught. The AI is *not* going to like fighting this ship. I'm glad the Spire are on our side." />
-
-/>
-  
 </root>
spire-fleet-science-upgrade.patch (1,379 bytes)   
# HG changeset patch
# User Tom Prince <[email protected]>
# Date 1634542193 21600
#      Mon Oct 18 01:29:53 2021 -0600
# Node ID 363f91b379dac8fa2d3d700b636257640e4b9351
# Parent  8bf9b90b9aa56d8b0ef76b8ca342961fe14a54cc
Use "science" to upgrade Spire Fleets.

diff --git CodeExternal/AIWarExternalDeepProcessingCode/src/DeepInfo/DLC1/FallenSpireFactionDeepInfo.cs CodeExternal/AIWarExternalDeepProcessingCode/src/DeepInfo/DLC1/FallenSpireFactionDeepInfo.cs
--- CodeExternal/AIWarExternalDeepProcessingCode/src/DeepInfo/DLC1/FallenSpireFactionDeepInfo.cs
+++ CodeExternal/AIWarExternalDeepProcessingCode/src/DeepInfo/DLC1/FallenSpireFactionDeepInfo.cs
@@ -2174,8 +2174,8 @@ namespace Arcen.AIW2.External
 
                 int markLevelForFlagshipsInThisFleet = minMarkLevelOfAllFlagships;
 
-                if ( mobileFlagship.CurrentMarkLevel < markLevelForFlagshipsInThisFleet )
-                    mobileFlagship.SetCurrentMarkLevel( (byte)markLevelForFlagshipsInThisFleet );
+                if ( mobileFleet.AddedMarkLevelsForFleet_FromScience < markLevelForFlagshipsInThisFleet - 1 )
+                    mobileFleet.AddedMarkLevelsForFleet_FromScience = (byte) (markLevelForFlagshipsInThisFleet - 1);
 
                 #region Find Flagship Types In This Fleet
                 mobileFleet.DoForMemberGroupsUnsorted_Sim( delegate ( FleetMembership mem )
spire-city-MaxMarkLevelOfAnyInFleet-workaround.patch (1,290 bytes)   
# HG changeset patch
# User Tom Prince <[email protected]>
# Date 1634542125 21600
#      Mon Oct 18 01:28:45 2021 -0600
# Node ID 8bf9b90b9aa56d8b0ef76b8ca342961fe14a54cc
# Parent  eca21bee536e0a65fc821e3c0cae08d9119ea04f
Workaround for MaxMarkLevelOfAnyInFleet not being set for FleetCategory.PlayerCustomCity.

diff --git CodeExternal/AIWarExternalDeepProcessingCode/src/DeepInfo/DLC1/FallenSpireFactionDeepInfo.cs CodeExternal/AIWarExternalDeepProcessingCode/src/DeepInfo/DLC1/FallenSpireFactionDeepInfo.cs
--- CodeExternal/AIWarExternalDeepProcessingCode/src/DeepInfo/DLC1/FallenSpireFactionDeepInfo.cs
+++ CodeExternal/AIWarExternalDeepProcessingCode/src/DeepInfo/DLC1/FallenSpireFactionDeepInfo.cs
@@ -1937,6 +1937,7 @@ namespace Arcen.AIW2.External
                 Fleet fleetForCity = city.GetFleetOrNull_Safe();
                 if ( fleetForCity == null )
                     return DelReturn.Continue;
+                fleetForCity.MaxMarkLevelOfAnyInFleet = fleetForCity.Centerpiece.GetSquad().CurrentMarkLevel;
                 if ( fleetForCity.MaxMarkLevelOfAnyInFleet > maxMarkLevelOfAnyCity )
                     maxMarkLevelOfAnyCity = fleetForCity.MaxMarkLevelOfAnyInFleet;
                 Fleet fleetForMobile = fleetForCity.GetFleetBolsteredByThisCity();
spire-city-fleet-upgrade.patch (1,943 bytes)   
# HG changeset patch
# User Tom Prince <[email protected]>
# Date 1634542021 21600
#      Mon Oct 18 01:27:01 2021 -0600
# Node ID eca21bee536e0a65fc821e3c0cae08d9119ea04f
# Parent  c125d0f53b3ddb9862852e8e419a66828235bc3a
Spire Hubs can upgrade their fleet by science.

diff --git Expansions/1_The_Spire_Rises/GameData/Configuration/GameEntity/TSR_Ships_Spire.xml Expansions/1_The_Spire_Rises/GameData/Configuration/GameEntity/TSR_Ships_Spire.xml
--- Expansions/1_The_Spire_Rises/GameData/Configuration/GameEntity/TSR_Ships_Spire.xml
+++ Expansions/1_The_Spire_Rises/GameData/Configuration/GameEntity/TSR_Ships_Spire.xml
@@ -569,6 +569,7 @@
 			ship_or_structure_explosion_sfx_happens_if_not_mine_and_on_other_planet="true"
              is_crippled_instead_of_dying="true" is_nonfunctional_when_on_planet_not_owned_by_player="true"
             city_sockets="2" added_city_sockets_per_mark="2"
+			this_centerpiece_grants_its_direct_science_upgrades_to_rest_of_fleet="true"
              causes_parent_fleet_to_not_allow_ship_line_swaps="true"
             priority_as_ai_target="BigThreateningWeapon" priority_as_frd_target="BigThreateningWeapon" priority_to_protect="BigFavoriteToy"
 			description_appender_dll="AIWarExternalCode"
@@ -606,6 +607,7 @@
              is_crippled_instead_of_dying="true" is_nonfunctional_when_on_planet_not_owned_by_player="true"
             priority_as_ai_target="BigThreateningWeapon" priority_as_frd_target="BigThreateningWeapon" priority_to_protect="BigFavoriteToy"
             city_sockets="4" added_city_sockets_per_mark="2" causes_parent_fleet_to_not_allow_ship_line_swaps="true"
+            this_centerpiece_grants_its_direct_science_upgrades_to_rest_of_fleet="true"
 			description_appender_dll="AIWarExternalCode"
 			description_appender_type="Arcen.AIW2.External.SpireHubDescriptionAppender"
 			shows_on_galaxy_map_for_explored_planets="true" always_visible_to_players="true"
spire-city-fleet-upgrade.patch (1,943 bytes)   

Issue History

Date Modified Username Field Change
Oct 18, 2021 3:58 am tom.prince New Issue
Oct 18, 2021 3:58 am tom.prince File Added: spire-fleet-duplicate-centerpiece.patch
Oct 18, 2021 3:58 am tom.prince File Added: spire-fleet-science-upgrade.patch
Oct 18, 2021 3:58 am tom.prince File Added: spire-city-MaxMarkLevelOfAnyInFleet-workaround.patch
Oct 18, 2021 3:58 am tom.prince File Added: spire-city-fleet-upgrade.patch
Oct 27, 2021 6:41 am tom.prince Assigned To => tom.prince
Oct 27, 2021 6:41 am tom.prince Status new => resolved
Oct 27, 2021 6:41 am tom.prince Resolution open => fixed
Oct 27, 2021 6:41 am tom.prince Fixed in Version => Beta 3.740 Code Panopticon