1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Hemos actualizado nuestra Política de Privacidad acorde con la nueva RGPD. +Info // We've updated our Privacy Policy to comply with the GDPR. +Info
    Dismiss Notice

New Feature: Fireteam check

Discussion in 'Infinity Army' started by Ogid, Jun 15, 2019.

  1. Ogid

    Ogid Well-Known Member

    Joined:
    Sep 10, 2018
    Messages:
    914
    Likes Received:
    752
    Recently there are a lot of people confused with the new flexible fireteams options. So I've been thinking...
    What about a feature in the army that checks if X troopers may form a legal fireteam?

    Checking that for the whole army could be nighmarish to program, but what about just selecting the 2-5 units from your list and the exact fireteam you want to create and let the army check if that's a legal fireteam or not.

    For example, I could select this 3 units:
    Operations Subsection of the S.S.S.
    ──────────────────────────────────────────────────

    [​IMG]3
    Rebot SAMEKH FTO Missile Launcher / Electric Pulse. (1.5 | 17)
    RUDRA K1 Marksman Rifle, Mine Dispenser / Electric Pulse. (0 | 42)
    ASURA (Fireteam: Haris) Spitfire, Nanopulser / Pistol, AP CCW. (2 | 71)

    3.5 SWC | 130 Points

    Open in Infinity Army
    Then I'd select from the SSS list of fireteams (that would need to be in the army) the "Special Fireteam: Haris. 2 Yadus + 1 Asura."; After that the army would do their magic and tell me if that's legal or not.
    Would this be possible?
     
    ChoTimberwolf and Smiler like this.
  2. Ogid

    Ogid Well-Known Member

    Joined:
    Sep 10, 2018
    Messages:
    914
    Likes Received:
    752
    I’ve been thinking about this one and toying a bit with how to design it. I leave my notes here in case they could be useful:

    An algorithm would only have to check for these:
    • 1.-Correct number of member
    • 2.-Profiles/Wilcard legal for the FT (include here Enomotarchos)
    • 2a.- Only for special fireteams, Check requisites special fireteams
    • 3a.-For cores only, at least 1 original trooper.
    • 3b.-For Haris/Duo only, at least 1 Fireteam:Haris/Duo skill
    • 3c.-For Triada only, all Fireteam:Triada.
    Structures:
    • 1 List (or fitting collection data structure for the language used) per type of member of the fireteam (including “count as”) + 1 List for wildcards (including “fireteam specific” wilcards like Machinist in Varuna). These lists with only the IDs or whatever you use to idenfity a profile in the army. (List1_1, List1_2…). Variables relevant for that FT.
    • A list with the the 2-5 profiles IDs selected by the user (List2), then a few lists with the abilities of each troopers (List2_1, List2_2…)

    Algorithm stub:
    • 1.- length/count/whatever of List2 is in the rank of that FT needs.
    • 2.- Is each profile of List2 in any of the List1
    For a normal Core/Haris there is no problem, just check they are in one of the both list and count the number of events in each lists (how many “normal” and how many “wildcards)

    For special fireteams a bit more coding would be needed to assure there are no illegal troops balancing:
    For a special fireteam each list1_x would have an associated variable Nx with the max number allowed for that fireteam stored. Each ID of the table 2 will be checked in each list; for each match the counter Nx for that list is reduced by 1. When the counter hits 0, that list is not iterated anymore (so any further trooper of that category will be illegal). As in the above case, count the “normal” and the “wilcards”.
    • 3a.- (cores) Check nº “normal” variable >=1
    • 3b.- (haris/duo) Check in all List2_x for at least 1 ability Fireteam:X.
      • 3b1 If the FT needs the Haris in a specific member (like Domaru/Karakuki), check the haris is in that member or in a wilcard.
    • 3c.- (triada) Check that all List 2_x have Fireteam:Triada.
    If those 3 tests are passed, then the fireteam is legal.


    The more tedious part about this would be making all the “List1” and variables for each fireteam. After this is ready, it would be easy to make a loop and check the composition for every FT of that sectorial; so you select your 2-5 units and then the army give you a list of legal FT you can do with these in that Sectorial.

    Disclaimer: This is assuming you don’t need a X for a fireteam to be considered a X fireteam; in that case those would need their own list and an extra step to check for the X models if they are included.

    Make it real! :)


    Step by Step Example: The CJC special fireteam of up to 3 alguaciles plus up to 2 core brigades.

    Set up: Prepare the lists to compare

    Set up 1: Get the IDs and abilities
    • List2 (Alg1, Alg2, Alg3, Alg4, Mob1)
    • List2_1 (All Alg1 abilities…); List2_2 (All Alg2 abilities…)…
    Set up 2: Retrieve the stored lists and variables for that fireteam
    • Length_Min = 2; Length_Max = 5
    • FT_type="core"
    • List1_1 (Alguaciles…, Valerya); N1_1 = 3
    • List1_2 (Mobile…, Tsyklon…); N1_2=2
    • List1_3 (Daktari, Lupe); N1_3=5
    • N_wild = 0 ; N_norm=0
    • Illegal=False
    Check the 3 steps

    Step 1: Check correct number of members
    • List2 >= Length_Min AND Length_Max <=5
    • Illegal=False (go step2)
    Step2: Check member (and composition) is legal
    • Alg1 match List1_1 TRUE, N1_1=2, N_norm=1
    • Alg2 match List1_1 TRUE; N1_1=1, N_nomr=2
    • Alg3 match List1_1 TRUE, N1_1=0, N_norm=3; as N1_1==0 the List1_1 is no longer iterable
    • Alg4 match List1_2 FALSE, Alg4 match List1_3 FALSE; Illegal=True
    • Mob1 match List1_2 TRUE; N1_2=1
    Illegal=True; Exit(FT_illegal) #It exits, saying the FT is illegal and giving reasons (too much Alg)


    (at this point the program would have declared the FT illegal but let’s assume it’s a legal one of 2 Alg, 1 Mobile, Daktari and Lupe that just passed the step2)
    # This would be the stored variables for this FT at this point (N_norm=3; N_wild=2)

    Step3: Check requisites core
    If (FT_type == “core”)
    • N_norm>=1 TRUE
    • Illegal=False
    • Exit (FT_legal)
     
    #2 Ogid, Jun 22, 2019
    Last edited: Jun 22, 2019
    ChoTimberwolf likes this.
  3. Ogid

    Ogid Well-Known Member

    Joined:
    Sep 10, 2018
    Messages:
    914
    Likes Received:
    752
    An extra thought about the step 2 to being able to give better “feedback” to the player in case the FT is illegal.

    Change the N1_x functionality: Instead of making the list non-iterable, now declare the FT illegal at the end of that step if its value goes below 1. The idea is that the program may check the N1_x values to see if there is too much of something. Right now it cannot differentiate between too many models of a type or a unit that cannot be included in that FT.


    In the example it would be like this:

    Step2: Check member (and composition) is legal
    • Alg1 match List1_1 TRUE, N1_1=2, N_norm=1
    • Alg2 match List1_1 TRUE; N1_1=1, N_nomr=2
    • Alg3 match List1_1 TRUE, N1_1=0, N_norm=3
    • Alg4 match List1_1 TRUE, N1_1=-1, N_norm=4
    • Mob1 match List1_1 FALSE, Mob1 match List1_2 TRUE, N1_2=1, N_norm=5
    N1_1>=0 FALSE; Illegal=TRUE #This will also add the “Too many Alguaciles” to the FT_illegal log
    N1_2>=0 TRUE; N1_3>=0 TRUE
    IF(Illegal=True) Exit(FT_illegal) #It exits, saying the FT is illegal and giving reasons (too much Alg)
     
    #3 Ogid, Jun 23, 2019
    Last edited: Jun 23, 2019
    ChoTimberwolf likes this.