Skip to content

feat: Mighty / Color chain + NP type detection implementation#2087

Open
Vylantze wants to merge 132 commits intoFate-Grand-Automata:masterfrom
Vylantze:basic-mighty-chain
Open

feat: Mighty / Color chain + NP type detection implementation#2087
Vylantze wants to merge 132 commits intoFate-Grand-Automata:masterfrom
Vylantze:basic-mighty-chain

Conversation

@Vylantze
Copy link
Copy Markdown
Contributor

@Vylantze Vylantze commented Aug 23, 2025


Download Link to Prebuild APK


  • Added R.string.p_brave_chains_with_np_mighty for all languages
    • English uses the correct description
    • Japanese uses the correct katakana description
    • Korean used text description from Google AI
    • All other languages used english text
  • Current implementation uses the withNP implementation as the baseline and then modifies the final result of that to pull off a Mighty chain if possible (if not, it returns the normal result of withNP).
  • The intended implementation had been to also include NP, but it is stuck because NP card type cannot be detected.
    • Is it possible to make the user decide the NP card type by declaring it in the config...?
    • Currently using the card priority for each wave to determine the Brave chain desired, but it is not ideal.

EDIT: Intended Mighty chain implementation added with NP card detection (beta).

Screenshots

The config that was used to test is below. The map used is the current 90++ map in JP summer event 2025.

Overall Config Wave 1
FGA_Overall_Config FGA_Wave_1
Wave 2 Wave 3
FGA_Wave_2 FGA_Wave_3
Battle Config
FGA_Battle_Config
Sample run
FGO_Wave_2
FGO_Wave_3
P.S. Screenshots don't tally because they were taken from different runs, but rest assured that it is the same script running.

Event Box Farm.fga.json

Task List

Edit: Moved task list here for easier tracking

  • Add handling for CardType.Unknown (particularly for NPs).
  • Add tests for Mighty Chain to ensure correct behavior for all BraveChainEnum (None, WithNP, Always, Avoid).
  • Add tests for Color Chain to ensure correct behavior.
    • Card only handling (for all types Buster, Arts, Quick)
    • NP handling (for all types Buster, Arts, Quick)
    • Unknown card handling (for card and NP)
    • Brave Chain handling for all BraveChainEnum (None, WithNP, Always, Avoid)
  • Add tests for AvoidChain to ensure correct behavior for all BraveChainEnum (None, WithNP, Always, Avoid).
  • Create a flowchart for how the system works, since it has grown immensely complicated with the integration of Brave Chain special handling into the Mighty / Color Chain systems. This is pretty important since I think it is very hard to review/test this pull request at the moment given how the expected behavior isn't properly documented.
  • Add more integration tests for the CardChainPriorityHandler, so that the interaction and fallthroughs between each Chain type is properly tested.
  • Add more integration tests for the AttackPriorityHandler, which determines the behavior between Brave Chains and Card Chains. This is not as crucial at the moment, because Brave Chains are treated as higher priority at all times for now (with the exception of None).
  • Add automatic checks for NPs so that the bug where the system returns wrong result because of missing NPs/additional NPs from spam does not occur. (Best effort implementation. Might fail occasionally for spam NPs)
  • Update documentation with the new system's details.

I intend to do the tasks from top down. The actual implementation changes will only change slightly (depending on what unexpected behaviors I find) while I perform these tasks. Most of the general cases should have a confirmed behavior already. The one most tested at the moment (particularly with actual testing in FGO) is WithNP, because that covers majority of the use cases.

Flowchart

Show FGA flowchart

@github-actions
Copy link
Copy Markdown

github-actions bot commented Aug 23, 2025

Build 1021

Download the latest APK for testing here

Note

You need a GitHub account to download the APK.

This URL is valid as long as the artifact has not expired yet.

@ArthurKun21 ArthurKun21 requested a review from reconman August 24, 2025 03:22
…using a crash because infinite loop). Also fix using cards instead of justRearranged because it does not provide the full 5 cards.
@ArthurKun21 ArthurKun21 changed the title Mighty chain implementation feat: Mighty chain implementation Aug 25, 2025
Add handling for rearrange.

Moves mighty chain tests to MightyChainTest and add more tests.
@ArthurKun21 ArthurKun21 requested a review from Copilot August 26, 2025 04:57

This comment was marked as outdated.

@Vylantze
Copy link
Copy Markdown
Contributor Author

Vylantze commented Aug 28, 2025

As of 553985c update, I have added a beta NP type checker to the system. This will mean that the NP type is automatically detected, which means that priority for each wave won't be needed anymore.

Flaws / Potential bugs:

  • Does not work properly with spam
  • If the command line has an NP, it will assume that the NP is valid and won't do any other check on it. If your NP for some reason does not actually trigger, it results in a less optimal Mighty Chain (or even a Mighty Chain failure).
  • The card type check can probably fail with some Servants/regions. So far, I have only tested JP and with only a handful of Servants.

Other than that, it works!!

New screenshots (collapsed) image image image image image image image

@Vylantze
Copy link
Copy Markdown
Contributor Author

@vybze I ran it a few more times. I can't get BB to recheck and make her use a non-Mighty chain in that setup. If you can replicate it elsewhere, it would be great.

Also, my runs have additionally gotten destroyed by BB not charging enough with Arts card as first card, and then Douman insta-killing the middle enemy...

@vybze
Copy link
Copy Markdown
Collaborator

vybze commented Sep 29, 2025

Also, my runs have additionally gotten destroyed by BB not charging enough with Arts card as first card, and then Douman insta-killing the middle enemy...

Made a longer video
https://youtu.be/WwSwiGIAwyM

@Vylantze
Copy link
Copy Markdown
Contributor Author

Also, my runs have additionally gotten destroyed by BB not charging enough with Arts card as first card, and then Douman insta-killing the middle enemy...

Made a longer video https://youtu.be/WwSwiGIAwyM

https://streamable.com/vofasq

I can't replicate it at all...

Would you be willing to go on discord and we debug it together in Android Studio?

@vybze
Copy link
Copy Markdown
Collaborator

vybze commented Sep 29, 2025

Also, my runs have additionally gotten destroyed by BB not
Would you be willing to go on discord and we debug it together in Android Studio?

You can always find me on the fga discord server

@ArthurKun21 ArthurKun21 requested a review from Copilot October 5, 2025 06:37

This comment was marked as outdated.

@Vylantze
Copy link
Copy Markdown
Contributor Author

Vylantze commented Dec 5, 2025

Previous prebuild had expired, so I forced a new one to be built and am putting the link here if anyone wants to use it.

EDIT: Latest link will instead be in the main post.

@ArthurKun21 ArthurKun21 requested review from reconman and removed request for reconman December 23, 2025 01:36

This comment was marked as outdated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mighty chain priority (QAB chains)

4 participants