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 1/5] [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 2/5] 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 3/5] 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 4/5] [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 5/5] 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++.