From 43a758806e250229be8c005a269cef85a619a26b Mon Sep 17 00:00:00 2001 From: handama <55939089+handama@users.noreply.github.com> Date: Mon, 9 Dec 2024 01:15:39 +0800 Subject: [PATCH 01/12] [Minor] Fix Fire Super Weapon Action bug (#1444) this should fix #1443 --------- Co-authored-by: Trsdy <914137150@qq.com> --- src/Ext/TAction/Body.cpp | 51 ++++++++++++++-------------------------- 1 file changed, 18 insertions(+), 33 deletions(-) diff --git a/src/Ext/TAction/Body.cpp b/src/Ext/TAction/Body.cpp index 647f7d2ad5..b97145de6a 100644 --- a/src/Ext/TAction/Body.cpp +++ b/src/Ext/TAction/Body.cpp @@ -277,8 +277,8 @@ bool TActionExt::RunSuperWeaponAt(TActionClass* pThis, int X, int Y) if (SuperWeaponTypeClass::Array->Count > 0) { int swIdx = pThis->Param3; - int houseIdx = -1; - std::vector housesListIdx; + HouseClass* pExecuteHouse = nullptr; // House who will fire the SW. + std::vector housesList; CellStruct targetLocation = { (short)X, (short)Y }; do @@ -291,15 +291,6 @@ bool TActionExt::RunSuperWeaponAt(TActionClass* pThis, int X, int Y) } while (!MapClass::Instance->IsWithinUsableArea(targetLocation, false)); - // Skip this check to use FindByCountryIndex - // Only valid House indexes - //if ((pThis->Param4 >= HouseClass::Array->Count - // && pThis->Param4 < HouseClass::PlayerAtA) - // || pThis->Param4 > (HouseClass::PlayerAtA + HouseClass::Array->Count - 3)) - //{ - // return true; - //} - switch (pThis->Param4) { case -1: @@ -310,12 +301,12 @@ bool TActionExt::RunSuperWeaponAt(TActionClass* pThis, int X, int Y) && !pHouse->IsObserver() && !pHouse->Type->MultiplayPassive) { - housesListIdx.push_back(pHouse->ArrayIndex); + housesList.push_back(pHouse); } } - if (housesListIdx.size() > 0) - houseIdx = housesListIdx.at(ScenarioClass::Instance->Random.RandomRanged(0, housesListIdx.size() - 1)); + if (housesList.size() > 0) + pExecuteHouse = housesList[ScenarioClass::Instance->Random.RandomRanged(0, housesList.size() - 1)]; else return true; @@ -327,14 +318,11 @@ bool TActionExt::RunSuperWeaponAt(TActionClass* pThis, int X, int Y) { if (pHouseNeutral->IsNeutral()) { - houseIdx = pHouseNeutral->ArrayIndex; + pExecuteHouse = pHouseNeutral; break; } } - if (houseIdx < 0) - return true; - break; case -3: @@ -345,12 +333,12 @@ bool TActionExt::RunSuperWeaponAt(TActionClass* pThis, int X, int Y) && !pHouse->Defeated && !pHouse->IsObserver()) { - housesListIdx.push_back(pHouse->ArrayIndex); + housesList.push_back(pHouse); } } - if (housesListIdx.size() > 0) - houseIdx = housesListIdx.at(ScenarioClass::Instance->Random.RandomRanged(0, housesListIdx.size() - 1)); + if (housesList.size() > 0) + pExecuteHouse = housesList[ScenarioClass::Instance->Random.RandomRanged(0, housesList.size() - 1)]; else return true; @@ -358,25 +346,22 @@ bool TActionExt::RunSuperWeaponAt(TActionClass* pThis, int X, int Y) default: if (pThis->Param4 >= 0) - houseIdx = pThis->Param4; + pExecuteHouse = HouseClass::Index_IsMP(pThis->Param4) ? HouseClass::FindByIndex(pThis->Param4) : HouseClass::FindByCountryIndex(pThis->Param4); else return true; break; } - if (HouseClass* pHouse = HouseClass::Index_IsMP(houseIdx) ? HouseClass::FindByIndex(houseIdx) : HouseClass::FindByCountryIndex(houseIdx)) + if (pExecuteHouse) { - if (auto const pSuper = pHouse->Supers.GetItem(swIdx)) - { - int oldstart = pSuper->RechargeTimer.StartTime; - int oldleft = pSuper->RechargeTimer.TimeLeft; - pSuper->SetReadiness(true); - pSuper->Launch(targetLocation, false); - pSuper->Reset(); - pSuper->RechargeTimer.StartTime = oldstart; - pSuper->RechargeTimer.TimeLeft = oldleft; - } + auto const pSuper = pExecuteHouse->Supers.Items[swIdx]; + + CDTimerClass old_timer = pSuper->RechargeTimer; + pSuper->SetReadiness(true); + pSuper->Launch(targetLocation, false); + pSuper->Reset(); + pSuper->RechargeTimer = old_timer; } } From fd935c3f0d6161b1f16b8c11e2c63f39447bd97e Mon Sep 17 00:00:00 2001 From: Starkku Date: Sun, 8 Dec 2024 21:45:33 +0200 Subject: [PATCH 02/12] Add missing #pragma endregion in Hooks.BugFixes.cpp --- src/Misc/Hooks.BugFixes.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Misc/Hooks.BugFixes.cpp b/src/Misc/Hooks.BugFixes.cpp index ea4ebe7535..6498de604a 100644 --- a/src/Misc/Hooks.BugFixes.cpp +++ b/src/Misc/Hooks.BugFixes.cpp @@ -1052,6 +1052,8 @@ DEFINE_HOOK(0x743664, UnitClass_ReadFromINI_Follower3, 0x6) return SkipGameCode; } +#pragma endregion + // This shouldn't be here // Author: tyuah8 DEFINE_HOOK_AGAIN(0x4AF94D, EndPiggyback_PowerOn, 0x7) // Drive From 5889d51a0e76c107bcdc9e6b21ec3341bec41ba7 Mon Sep 17 00:00:00 2001 From: Starkku Date: Sun, 8 Dec 2024 23:55:47 +0200 Subject: [PATCH 03/12] Make lunar tileset parsing fix opt-in --- docs/Fixed-or-Improved-Logics.md | 2 +- docs/Whats-New.md | 3 ++- src/Misc/Hooks.BugFixes.cpp | 14 ++++++++++++-- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/docs/Fixed-or-Improved-Logics.md b/docs/Fixed-or-Improved-Logics.md index 2ab1364d5a..e72c269b36 100644 --- a/docs/Fixed-or-Improved-Logics.md +++ b/docs/Fixed-or-Improved-Logics.md @@ -170,7 +170,7 @@ This page describes all ingame logics that are fixed or improved in Phobos witho - Fixed Nuke & Dominator Level lighting not applying to AircraftTypes. - Projectiles created from `AirburstWeapon` now remember the WeaponType and can apply radiation etc. - Fixed damaged aircraft not repairing on `UnitReload=true` docks unless they land on the dock first. -- Certain global tileset indices (`ShorePieces`, `WaterSet`, `CliffSet`, `WaterCliffs`, `WaterBridge`, `BridgeSet` and `WoodBridgeSet`) are now correctly parsed for Lunar theater. +- Certain global tileset indices (`ShorePieces`, `WaterSet`, `CliffSet`, `WaterCliffs`, `WaterBridge`, `BridgeSet` and `WoodBridgeSet`) can now be toggled to be parsed for lunar theater by setting `[General]` -> `ApplyLunarFixes` to true in `lunarmd.ini`. Do note that enabling this without fixing f.ex `WoodBridgeTileSet` pointing to a tileset with `TilesInSet=0` will cause issues in-game. - Fixed infantry `SecondaryFire` / `SecondaryProne` sequences being displayed in water instead of `WetAttack`. - Fixed objects with ally target and `AttackFriendlies=true` having their target reset every frame, particularly AI-owned buildings. - `` can now be used as owner for pre-placed objects on skirmish and multiplayer maps. diff --git a/docs/Whats-New.md b/docs/Whats-New.md index 4d770168e5..0b6f8c19c6 100644 --- a/docs/Whats-New.md +++ b/docs/Whats-New.md @@ -21,6 +21,7 @@ You can use the migration utility (can be found on [Phobos supplementaries repo] #### From post-0.3 devbuilds +- Lunar theater tileset parsing unhardcoding is now only applied if `lunarmd.ini` has `[General]` -> `ApplyLunarFixes` set to true. - `Units.DisableRepairCost` was changed to `Units.UseRepairCost` (note inverted expected value) as it no longer has discrete default value and affects `Hospital=true` buildings, infantry do not have repair cost by default. - Critical hit animations created by `Crit.AnimOnAffectedTargets=true` Warheads no longer default to `AnimList.PickRandom` if `Crit.AnimList.PickRandom` is not set. - `SelfHealGainType` value `none` has been changed to `noheal` due to `none` being treated as a blank string and not parsed by the game. @@ -546,7 +547,7 @@ Vanilla fixes: - Removed the 0 damage effect from `InfDeath=9` warheads to in-air infantries (by Trsdy) - Projectiles created from `AirburstWeapon` now remember their WeaponType and can apply radiation etc. (by Starkku) - Fixed damaged aircraft not repairing on `UnitReload=true` docks unless they land on the dock first (by Starkku) -- Certain global tileset indices (`ShorePieces`, `WaterSet`, `CliffSet`, `WaterCliffs`, `WaterBridge`, `BridgeSet` and `WoodBridgeSet`) are now correctly parsed for Lunar theater (by Starkku) +- Certain global tileset indices (`ShorePieces`, `WaterSet`, `CliffSet`, `WaterCliffs`, `WaterBridge`, `BridgeSet` and `WoodBridgeSet`) can now be toggled to be parsed for lunar theater (by Starkku) - Fixed infantry `SecondaryFire` / `SecondaryProne` sequences being displayed in water instead of `WetAttack` (by Starkku) - Fixed objects with ally target and `AttackFriendlies=true` having their target reset every frame, particularly AI-owned buildings (by Starkku) - Follower vehicle index for preplaced vehicles in maps is now explicitly constrained to `[Units]` list in map files and is no longer thrown off by vehicles that could not be created or created vehicles having other vehicles as initial passengers (by Starkku) diff --git a/src/Misc/Hooks.BugFixes.cpp b/src/Misc/Hooks.BugFixes.cpp index 6498de604a..984c546dc4 100644 --- a/src/Misc/Hooks.BugFixes.cpp +++ b/src/Misc/Hooks.BugFixes.cpp @@ -963,8 +963,18 @@ DEFINE_HOOK(0x44985B, BuildingClass_Mission_Guard_UnitReload, 0x6) return 0; } -// Patch tileset parsing to not reset certain tileset indices for Lunar theater. -DEFINE_JUMP(LJMP, 0x546C8B, 0x546CBF); +// Fix tileset parsing to not reset certain tileset indices for Lunar theater if the fix is enabled. +DEFINE_HOOK(0x546C95, IsometricTileTypeClass_ReadINI_LunarFixes, 0x6) +{ + enum { SkipGameCode = 0x546CBF }; + + LEA_STACK(CCINIClass*, pINI, STACK_OFFSET(0xA10, -0x9D8)); + + if (pINI->ReadBool(GameStrings::General, "ApplyLunarFixes", false)) + return SkipGameCode; + + return 0; +} // Fixes an edge case that affects AI-owned technos where they lose ally targets instantly even if they have AttackFriendlies=yes - Starkku DEFINE_HOOK(0x6FA467, TechnoClass_AI_AttackFriendlies, 0x5) From d0aca00ee3cc6f50bce1cf545ec5370b8f79b89b Mon Sep 17 00:00:00 2001 From: Trsdy <914137150@qq.com> Date: Mon, 9 Dec 2024 20:41:44 +0800 Subject: [PATCH 04/12] Initialize Enumerable array when loading game from client --- src/Utilities/Enumerable.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Utilities/Enumerable.h b/src/Utilities/Enumerable.h index 50ef81f34b..95b8c33273 100644 --- a/src/Utilities/Enumerable.h +++ b/src/Utilities/Enumerable.h @@ -71,7 +71,7 @@ template class Enumerable if (!Stm.Load(Count)) return false; - + Array.reserve(Count); for (size_t i = 0; i < Count; ++i) { void* oldPtr = nullptr; From 1fc263b2531fa2bef737e6e19684b06c4fb53930 Mon Sep 17 00:00:00 2001 From: Starkku Date: Tue, 10 Dec 2024 13:36:25 +0200 Subject: [PATCH 05/12] Fix missing check on WH anim CreateAll for crit anims --- src/Ext/Bullet/Hooks.DetonateLogics.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Ext/Bullet/Hooks.DetonateLogics.cpp b/src/Ext/Bullet/Hooks.DetonateLogics.cpp index eebd7c6cc2..2d727dd1a2 100644 --- a/src/Ext/Bullet/Hooks.DetonateLogics.cpp +++ b/src/Ext/Bullet/Hooks.DetonateLogics.cpp @@ -241,7 +241,7 @@ DEFINE_HOOK(0x469C46, BulletClass_Logics_DamageAnimSelected, 0x8) { bool createAll = pWHExt->AnimList_CreateAll; - if (pWHExt->Crit_Active && !pWHExt->Crit_AnimOnAffectedTargets) + if (pWHExt->Crit_Active && pWHExt->Crit_AnimList.size() > 0 && !pWHExt->Crit_AnimOnAffectedTargets) { createAll = pWHExt->Crit_AnimList_CreateAll.Get(createAll); From 796b2b4d12bfb9a452eb9532c8fd117b79f2ce88 Mon Sep 17 00:00:00 2001 From: Trsdy <914137150@qq.com> Date: Wed, 11 Dec 2024 15:45:36 +0800 Subject: [PATCH 06/12] Partially revert 6c856f03 for multiple file parsing --- src/Ext/Bullet/Body.cpp | 2 +- src/Ext/TechnoType/Body.h | 2 +- src/Ext/VoxelAnim/Body.cpp | 2 +- src/Utilities/Enumerable.h | 30 ++++++++++++++++-------------- 4 files changed, 19 insertions(+), 17 deletions(-) diff --git a/src/Ext/Bullet/Body.cpp b/src/Ext/Bullet/Body.cpp index b6c3460b8b..f89cee974b 100644 --- a/src/Ext/Bullet/Body.cpp +++ b/src/Ext/Bullet/Body.cpp @@ -150,7 +150,7 @@ void BulletExt::ExtData::InitializeLaserTrails() for (auto const& idxTrail : pTypeExt->LaserTrail_Types) { - this->LaserTrails.push_back(LaserTrailClass { &LaserTrailTypeClass::Array[idxTrail], pOwner }); + this->LaserTrails.emplace_back(LaserTrailTypeClass::Array[idxTrail].get(), pOwner); } } } diff --git a/src/Ext/TechnoType/Body.h b/src/Ext/TechnoType/Body.h index f6caad6729..3335acac05 100644 --- a/src/Ext/TechnoType/Body.h +++ b/src/Ext/TechnoType/Body.h @@ -235,7 +235,7 @@ class TechnoTypeExt ValueableIdx idxType; Valueable FLH; Valueable IsOnTurret; - LaserTrailTypeClass* GetType() const { return &LaserTrailTypeClass::Array[idxType]; } + LaserTrailTypeClass* GetType() const { return LaserTrailTypeClass::Array[idxType].get(); } }; std::vector LaserTrailData; diff --git a/src/Ext/VoxelAnim/Body.cpp b/src/Ext/VoxelAnim/Body.cpp index 996d4c2d78..1aebc189f1 100644 --- a/src/Ext/VoxelAnim/Body.cpp +++ b/src/Ext/VoxelAnim/Body.cpp @@ -15,7 +15,7 @@ void VoxelAnimExt::InitializeLaserTrails(VoxelAnimClass* pThis) for (auto const& idxTrail : pTypeExt->LaserTrail_Types) { - pThisExt->LaserTrails.push_back(LaserTrailClass { &LaserTrailTypeClass::Array[idxTrail], pThis->OwnerHouse }); + pThisExt->LaserTrails.emplace_back(LaserTrailTypeClass::Array[idxTrail].get(), pThis->OwnerHouse); } } diff --git a/src/Utilities/Enumerable.h b/src/Utilities/Enumerable.h index 95b8c33273..781dbc59f8 100644 --- a/src/Utilities/Enumerable.h +++ b/src/Utilities/Enumerable.h @@ -12,13 +12,17 @@ template class Enumerable { public: - inline static std::vector Array; + // The array gets eventually expanded due to multiple ini parsing + // non-index references in other classes become dangling pointers + // therefore we need to prevent reallocation of the instances + // + contigous storage of type classes has virtually no performance improvement + inline static std::vector> Array; static int FindIndex(const char* Title) { - auto result = std::find_if(Array.begin(), Array.end(), [Title](const T& Item) + auto result = std::find_if(Array.begin(), Array.end(), [Title](const std::unique_ptr& Item) { - return !_strcmpi(Item.Name, Title); + return !_strcmpi(Item->Name, Title); }); if (result == Array.end()) @@ -30,17 +34,15 @@ template class Enumerable static T* Find(const char* Title) { auto result = FindIndex(Title); - return (result < 0) ? nullptr : &Array[static_cast(result)]; + return (result < 0) ? nullptr : Array[static_cast(result)].get(); } static T* FindOrAllocate(const char* Title) { if (T* found = Find(Title)) return found; - static_assert(std::constructible_from); - Array.emplace_back(Title); - - return &Array.back(); + Array.emplace_back(std::make_unique(Title)); + return Array.back().get(); } static void Clear() @@ -59,8 +61,8 @@ template class Enumerable FindOrAllocate(Phobos::readBuffer); } - for (auto& item : Array) - item.LoadFromINI(pINI); + for (auto const& item : Array) + item->LoadFromINI(pINI); } static bool LoadGlobals(PhobosStreamReader& Stm) @@ -93,12 +95,12 @@ template class Enumerable { Stm.Save(Array.size()); - for (auto& item : Array) + for (auto const& item : Array) { // write old pointer and name, then delegate - Stm.Save(&item); - Stm.Save(item.Name); - item.SaveToStream(Stm); + Stm.Save(item.get()); + Stm.Save(item->Name); + item->SaveToStream(Stm); } return true; From a650e6b8335c25b3af82a407cabc301ff487f842 Mon Sep 17 00:00:00 2001 From: Noble Fish <89088785+DeathFishAtEase@users.noreply.github.com> Date: Tue, 17 Dec 2024 02:44:11 +0800 Subject: [PATCH 07/12] [Minor] Fix an error in a Markdown formatted character in the document. (#1454) `Flamer? -> `Flamer` A very minor error that affects users' reading and comprehension. It made me wait for two months without seeing anyone fix it. So, I decided to take care of it myself. That's all. --- docs/Fixed-or-Improved-Logics.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Fixed-or-Improved-Logics.md b/docs/Fixed-or-Improved-Logics.md index e72c269b36..3cf0271d9b 100644 --- a/docs/Fixed-or-Improved-Logics.md +++ b/docs/Fixed-or-Improved-Logics.md @@ -311,7 +311,7 @@ LargeFireDistances=0.4375 ; list of floating point values, distance in ``` ```{note} -Save for the change that `Flamer? does not spawn animations if the parent animation is in air, the default settings should provide identical results to similar feature from Ares. +Save for the change that `Flamer` does not spawn animations if the parent animation is in air, the default settings should provide identical results to similar feature from Ares. ``` ### Layer on animations attached to objects From f0791edb8b936b382d7e516a0636e016b3c26d00 Mon Sep 17 00:00:00 2001 From: Noble Fish <89088785+DeathFishAtEase@users.noreply.github.com> Date: Sat, 21 Dec 2024 04:19:42 +0800 Subject: [PATCH 08/12] [Minor] Fix an incorrect flag in the document (#1457) Warhead is fully detonated needs ReflectDamage.Warhead.Detonate --- docs/New-or-Enhanced-Logics.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/New-or-Enhanced-Logics.md b/docs/New-or-Enhanced-Logics.md index b789131486..e553a34732 100644 --- a/docs/New-or-Enhanced-Logics.md +++ b/docs/New-or-Enhanced-Logics.md @@ -45,7 +45,7 @@ This page describes all the engine features that are either new and introduced b - `Crit.AllowWarheads` can be used to list only Warheads that can benefit from this critical hit chance multiplier and `Crit.DisallowWarheads` weapons that are not allowed to, respectively. - `RevengeWeapon` can be used to temporarily grant the specified weapon as a [revenge weapon](#revenge-weapon) for the attached object. - `RevengeWeapon.AffectsHouses` customizes which houses can trigger the revenge weapon. - - `ReflectDamage` can be set to true to have any positive damage dealt to the object the effect is attached to be reflected back to the attacker. `ReflectDamage.Warhead` determines which Warhead is used to deal the damage, defaults to `[CombatDamage]`->`C4Warhead`. If `ReflectDamage.Warhead` is set to true, the Warhead is fully detonated instead of used to simply deal damage. `ReflectDamage.Multiplier` is a multiplier to the damage received and then reflected back. Already reflected damage cannot be further reflected back. + - `ReflectDamage` can be set to true to have any positive damage dealt to the object the effect is attached to be reflected back to the attacker. `ReflectDamage.Warhead` determines which Warhead is used to deal the damage, defaults to `[CombatDamage]`->`C4Warhead`. If `ReflectDamage.Warhead.Detonate` is set to true, the Warhead is fully detonated instead of used to simply deal damage. `ReflectDamage.Multiplier` is a multiplier to the damage received and then reflected back. Already reflected damage cannot be further reflected back. - Warheads can prevent reflect damage from occuring by setting `SuppressReflectDamage` to true. `SuppressReflectDamage.Types` can control which AttachEffectTypes' reflect damage is suppressed, if none are listed then all of them are suppressed. - `DisableWeapons` can be used to disable ability to fire any and all weapons. - On TechnoTypes with `OpenTopped=true`, `OpenTopped.CheckTransportDisableWeapons` can be set to true to make passengers not be able to fire out if transport's weapons are disabled by `DisableWeapons`. From 3b63de7a0fe10eb9a4fd1271387e7674544d1199 Mon Sep 17 00:00:00 2001 From: Trsdy <914137150@qq.com> Date: Sat, 21 Dec 2024 14:52:20 +0800 Subject: [PATCH 09/12] Fix Ares' Academy on InitialPayload --- src/Misc/Hooks.Ares.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/Misc/Hooks.Ares.cpp b/src/Misc/Hooks.Ares.cpp index a8f9853597..e4e0016b77 100644 --- a/src/Misc/Hooks.Ares.cpp +++ b/src/Misc/Hooks.Ares.cpp @@ -27,6 +27,15 @@ DEFINE_HOOK(0x44E9FA, BuildingClass_Detach_RestoreAnims, 0x6) // Patches presented here are exceptions rather that the rule. They must be short, concise and correct. // DO NOT POLLUTE ISSUEs and PRs. +ObjectClass* __fastcall CreateInitialPayload(TechnoTypeClass* type, void*, HouseClass* owner) +{ + // temporarily reset the mutex since it's not part of the design + int mutex_old = std::exchange(Unsorted::IKnowWhatImDoing(), 0); + auto instance = type->CreateObject(owner); + Unsorted::IKnowWhatImDoing = mutex_old; + return instance; +} + void Apply_Ares3_0_Patches() { // Abductor fix: @@ -36,6 +45,9 @@ void Apply_Ares3_0_Patches() Patch::Apply_CALL(AresHelper::AresBaseAddress + 0x62267, &Helpers::Alex::getCellSpreadItems); Patch::Apply_CALL(AresHelper::AresBaseAddress + 0x528C8, &Helpers::Alex::getCellSpreadItems); Patch::Apply_CALL(AresHelper::AresBaseAddress + 0x5273A, &Helpers::Alex::getCellSpreadItems); + + // InitialPayload creation: + Patch::Apply_CALL6(AresHelper::AresBaseAddress + 0x43D5D, &CreateInitialPayload); } void Apply_Ares3_0p1_Patches() @@ -49,4 +61,7 @@ void Apply_Ares3_0p1_Patches() Patch::Apply_CALL(AresHelper::AresBaseAddress + 0x62FB7, &Helpers::Alex::getCellSpreadItems); Patch::Apply_CALL(AresHelper::AresBaseAddress + 0x53578, &Helpers::Alex::getCellSpreadItems); Patch::Apply_CALL(AresHelper::AresBaseAddress + 0x533EA, &Helpers::Alex::getCellSpreadItems); + + // InitialPayload creation: + Patch::Apply_CALL6(AresHelper::AresBaseAddress + 0x4483D, &CreateInitialPayload); } From fa48f6128791023cb64dff6d75d29bd86cb1e86c Mon Sep 17 00:00:00 2001 From: Kerbiter Date: Sat, 21 Dec 2024 14:52:19 +0200 Subject: [PATCH 10/12] Add docs for academy on factory-built InitialPayload Co-authored-by: Aephiex<34618932+Aephiex@users.noreply.github.com> --- CREDITS.md | 2 ++ docs/Fixed-or-Improved-Logics.md | 1 + docs/Whats-New.md | 1 + 3 files changed, 4 insertions(+) diff --git a/CREDITS.md b/CREDITS.md index f977b2a3ed..35afecea83 100644 --- a/CREDITS.md +++ b/CREDITS.md @@ -334,6 +334,7 @@ This page lists all the individual contributions to the project by their author. - Ares' `SW.Shots` hint on extended tooltips - Ares' Abductor weapon fix - Suppress Ares' swizzle warning when parsing tags and taskforces + - Better fix for Ares academy not working on the initial payloads of vehicles built from a war factory - Misc code refactor & maintenance, CN doc fixes, bugfixes - **FlyStar** - Campaign load screen PCX support @@ -380,6 +381,7 @@ This page lists all the individual contributions to the project by their author. - Skirmish AI "gather when MCV deploy" behavior dehardcode - Global value of `RepairBaseNodes` - **tyuah8** - Drive/Jumpjet/Ship/Teleport locomotor did not power on when it is un-piggybacked bugfix +- **Aephiex** - initial fix for Ares academy not working on the initial payloads of vehicles built from a war factory - **Ares developers** - YRpp and Syringe which are used, save/load, project foundation and generally useful code from Ares - unfinished RadTypes code diff --git a/docs/Fixed-or-Improved-Logics.md b/docs/Fixed-or-Improved-Logics.md index 3cf0271d9b..6d56a1369f 100644 --- a/docs/Fixed-or-Improved-Logics.md +++ b/docs/Fixed-or-Improved-Logics.md @@ -191,6 +191,7 @@ This page describes all ingame logics that are fixed or improved in Phobos witho - Fixed an issue introduced by Ares that caused `Grinding=true` building `ActiveAnim` to be incorrectly restored while `SpecialAnim` was playing and the building was sold, erased or destroyed. - Fixed Ares' Abductor weapon leaves permanent placement stats when abducting moving vehicles. - Suppressed Ares' swizzle warning when parsing `Tags` and `TaskForces` (typically begin with `[Developer fatal]Pointer 00000000 declared change to both`). +- Fixed Academy *(Ares feature)* not working on the initial payloads *(Ares feature)* of vehicles built from a war factory. ## Aircraft diff --git a/docs/Whats-New.md b/docs/Whats-New.md index 0b6f8c19c6..37c9f39e2f 100644 --- a/docs/Whats-New.md +++ b/docs/Whats-New.md @@ -610,6 +610,7 @@ Fixes / interactions with other extensions: - Appended Ares' `SW.Shots` usage to extended tooltips (by Trsdy) - Fixed Ares' Abductor weapon leaves permanent placement stats when abducting moving vehicles (by Trsdy) - Suppressed Ares' swizzle warning when parsing `Tags` and `TaskForces` (by Trsdy) +- Fixed Academy *(Ares feature)* not working on the initial payloads *(Ares feature)* of vehicles built from a war factory (by Trsdy, supersedes Aephiex impl.) ### 0.3.0.1 From 31afb4907ec651e3660099f17d33e99418443ca2 Mon Sep 17 00:00:00 2001 From: Coronia <2217891145@qq.com> Date: Tue, 24 Dec 2024 19:58:40 +0800 Subject: [PATCH 11/12] [Minor] Phobos Tester Credits (#1462) If you don't know it yet: Phobos has an active Chinese tester group which helps with new function testing and crash/desync hunting. Now that 0.4 is on the pipeline, I'd like to credit these players for assisting Phobos development --- CREDITS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CREDITS.md b/CREDITS.md index 35afecea83..4c788fe55f 100644 --- a/CREDITS.md +++ b/CREDITS.md @@ -407,6 +407,7 @@ This page lists all the individual contributions to the project by their author. - **thomassneddon** - general assistance, knowledge about voxel lighting model - **Xkein** - general assistance, YRpp edits - **mevitar** - honorary shield tester *triple* award +- **Phobos CN Tester Group (Reedom, Mantis, Swim Wing, Takitoru, Examon, AKB, Pusheen, ZQ, Claptrap, BunkerGeneral, Big J, Skywalker, ChickEmperor, Shifty, Mikain, Tobiichi Origami, Feiron, W_S502, Ailink, AbrahamMikhail, Tide, Fnfalsc, Yumeri_Rei, Nacho, Zhuzi, Ika_Aru)** - extensive and thorough testing - **Damfoos** - extensive and thorough testing - **Dmitry Volkov** - extensive and thorough testing - **Rise of the East community** - extensive playtesting of in-dev features From 3a54e85d2195c5915bcee29cceecdb2451e9a748 Mon Sep 17 00:00:00 2001 From: Kerbiter Date: Thu, 26 Dec 2024 14:52:46 +0200 Subject: [PATCH 12/12] Add info on how to submit changes to YRpp --- docs/Contributing.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/docs/Contributing.md b/docs/Contributing.md index a994803569..5dc1be4588 100644 --- a/docs/Contributing.md +++ b/docs/Contributing.md @@ -186,6 +186,21 @@ git config --global branch.autoSetupRebase always git config --global diff.colorMoved zebra ``` +### Working with YRpp via submodules + +Often when working on Phobos and/or researching the YR engine you'll need to implement corrections for YRpp. Generally the corrections need to be submitted to [YRpp repository](https://github.com/Phobos-developers/YRpp) and can be done separately from the actual features in Phobos, but frequently the improvements are to be submitted as a part of Phobos contribution process. To submit improvements to YRpp you have to create a branch in YRpp, then you can push it and submit a pull request to YRpp repository. + +When you clone Phobos recursively - you also clone YRpp as a submodule. Basically submodules are just nested repositories. You can open it like any other repository, so the changes can be synchronized to Phobos and you don't need to rename stuff by hand. + +The suggested workflow is as follows: +1. In your IDE of choice rename fields and functions using symbol renaming feature (`Rename...` feature in Visual Studio (regular or Code), `[F2]` by default), then you will have two "levels" of changes displayed in your Git client: + - for Phobos repository - changes in the Phobos code (as regular changes) and changes to YRpp (as one submodule change) + - for YRpp repository - changes to the field names and function names in YRpp as regular changes. +2. Create a branch in YRpp repository (create a fork of it if you didn't yet), commit and push the changes and submit it as a pull request. After pushing it you have two options in Phobos repository: + - wait until it's accepted, then checkout YRpp at the newest commit, then commit and push - this will save you having to commit and push multiple times, but you won't be able to get a nightly build for people to test; + - don't wait for YRpp changes to be merged, commit and push right after you pushed the YRpp changes to your YRpp branch - you will have an up-to-date build on Phobos pull request this way. Note that you must do this only after you committed to and pushed your YRpp branch, otherwise the build system won't know what are the changes as they are not exposed to the world, only available to you locally. +3. After the YRpp pull request gets accepted you will need to switch to the latest commit that was merged (you do that in the submodule), verify that it compiles like normal, and then commit and push it to your Phobos branch that you made for your pull request. + ## Ways to help Engine modding is a complicated process which is pretty hard to pull off, but there are also easier parts which don't require mastering the art of reverse-engineering or becoming a dank magician in C++.