Page 1 of 2 1 2 LastLast
Results 1 to 10 of 20

Thread: Pocket Familiars and fambattle.php

  1. #1
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    11,389

    Default Pocket Familiars and fambattle.php

    I've been through a number of Pokefam ascensions now and have engaged in many hundred of pokebattles in the relay browser. I'm starting to consider what would be the best way to automate them.

    My first observation is that simply automating via a CCS is not likely to be useful. You may set up your favorite team, but your opponent's team can throw a wrench into your favorite strategy.

    - tackle can send your front row familiar to the back
    - ULTIMATE: Atomic Bomb (or what ever it is) can simply take out your back row familiar

    And many others.

    So, CCS is out, consult script is in. What does a consult script need to know?

    For both teams, who is 1st, 2nd, and 3rd
    Which powers are available this round to each of your familiars? Some are only available at the front, some only at the rear, and so on.
    What is the opponent's next action? Which familiar, which action? That is available to you; it is called out in the HTML.

    If your opponent is about to automatically take out your front or rear familiar, perhaps you want to use the soon-to-be dead familiar before they die? Or perhaps you want to disable that attack by tackling the foremost opponent and making the attack no longer valid? Or something. That is completely up to the script to decide; it is not KoLmafia's job to come up with a strategy, unless we want to build in an automated fambattle automation, which I am not proposing.

    And the consult script needs a function to actually make such-and-such a familiar perform such-and-such an action.

    So:

    - Each round of a battle, parse the current fambattle page and set properties to describe the current battle position
    - Provide a function to perform a fambattle action.
    - What is an action? It's a familiar-specific skill performed by a particular familiar. You can have multiple familiars in your team who can Backstab, for example, so an action is a combination of a familiar + a familiar skill.

    Here are some URLs used in fambattle.php:

    Code:
    				// fambattle.php?pwd&famaction[ult_crazyblast-209]=ULTIMATE%3A+Spiky+Burst
    				// fambattle.php?pwd&famaction[sting-98]=Sting
    				// fambattle.php?pwd&famaction[backstab-209]=Backstab
    As you can see, it gives you the familiar doing the skill, which is specified by keyword and also with full "pretty" name.

    You need to specify familiar + skill. How do you want to represent the skill?
    By string, presumably, but both "pretty" skill name and "keyword" is needed.
    Does anyone have a list of all possible familiar skills?

    Those who have written (or would like to write) consult scripts or combat filters, please chime in now about what you would like KoLmafia and ASH to make available to you to simplify/clarify/reliablize you code.

    Thanks.
    Ph'nglui mglw'nafh Cthulhu
    R'lyeh wgah-nagl fhtagn.

  2. #2
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    11,389

    Default

    Additional interesting things:

    For all familiars, what are their primary, secondary, and ultimate power?
    Put it into familiars.txt. Somewhere.

    I notice that have_familiar() seems to work. I assume (somebody) coded up parsing the "manage team" page or something.

    Given that - and the fambattle data I mentioned - scripts could choose teams with such-and-such characteristics without having to hardcode familiar data.

  3. #3
    Developer
    Join Date
    Apr 2010
    Posts
    4,757

    Default

    Some useful here :
    https://docs.google.com/spreadsheets...NGw/edit#gid=0

    We also might want to include whether at levels 2, 3 and 4 the familiars gain 1 HP or 1 Power.

    I was considering adding a string along the lines of poke/HP/HP/Pow/Claw/Howl/ViolentShred/Armor to the familiar attributes (though I was also considering a new file so it isn't filled up with pokefam stuff).

  4. #4
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    11,389

    Default

    It looks like there is a new argument at the end which is "pokefam" if it is pocket familiars only.
    Seems like it could be "pokefam,HP,Bite,Laser Beam,ULTIMATE: Violent Shred", for example, omitting the "pokefam" if it is a regular familiar.

    A separate file seems plausible, but way back in the old days, we had both "items.txt" and "itemdescs.txt" (or something), which had to be maintained in parallel. I think not having to have parallel files is better.

    And, by the way, in order for combat filters to work, we'd need to add "CCS actions", since that is what a combat filter returns. something like:

    pokefam [familiar type], [skill name]

    You could certainly put that into a CCS, but, as I mentioned, the opponent team can invalidate it.

    Edit: Your proposal of "poke/HP/HP/Pow/Claw/Howl/ViolentShred/Armor" is basically the more complete version of what I suggested above. I like.
    Last edited by Veracity; 03-11-2018 at 10:02 PM.

  5. #5

    Default

    The "pokefam" value currently there does nothing right now, except let scripts know that the familiar isn't usable outside the path if they care to check. I don't know how much it really needs to do. KoLmafia doesn't even know if one has those familiars outside of the path, since they can only be seen on the Manage Familiar Names page (so snapshot will have to check there now). That just leaves the session when freeing the king after a pokefam run when things could be handled incorrectly.

    I remember that my main reason for merging itemdescs.txt and tradeitems.txt was that 75% of the fields were identical between the two. I don't have any real opinion about how this data should be added, since I'm unlikely to add data or use data added there.

  6. #6
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    11,389

    Default

    Can you use the item that grows the familiar if you get it outside of the path? Or do you have to obtain it AND use it while on the path?

  7. #7
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    11,389

    Default

    Can you use the item that grows the familiar if you get it outside of the path? Or do you have to obtain it AND use it while on the path?
    Originally Posted by Veracity View Post
    To answer my last question, I bought the cheapest pokefam-only familiar and "grew" it on a test multi. It gave a success message and shows up on the Manage Familiar Names page.

    Regarding familiar data, I'm going to start fambattle.txt. I'm considering this:

    Code:
    # Name of familiar, as in familiars.txt
    # L2, L3, and L4 specify what improves at those levels: HP or Pow
    # S1 is skill #1
    #    list here
    # S2 is skill #2
    #    list here
    # S3 is the ULTIMATE skill
    #    list here
    # AT is the special attribute
    #    none
    #    smart (2 XP per battle)
    #    armor
    #    spiked
    #    regen
    
    # Type	L2	L3	L4	S1	S2	S3	AT
    I notice that the spreadsheet now has "Power at L5" and "HP at L5". Obviously, if you have the L2, L3, and L4 data, that tells you the same, but
    it's not obvious which is easier to collect: if you can see a familiar at L5, you get those numbers, but if you only see lower levels, you may not have that. I'm going to start collecting data for L2, L3, and L4, as you suggested.
    Ph'nglui mglw'nafh Cthulhu
    R'lyeh wgah-nagl fhtagn.

  8. #8
    Developer
    Join Date
    Apr 2010
    Posts
    4,757

    Default

    I'm collecting it on an alt, and adding it to spreadsheet.
    You don't usually need all the data points. L1 is always 1 Pow, 2 HP. L4 = L5. So often one other data point (sometimes none) is enough to fill in the gaps.
    Main trick on my alt is finding the familiars being used (as he doesn't have many himself, and doesn't have IotM).

  9. #9
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    11,389

    Default

    I'm thinking of adding (optional) logging, So, round 0 of a fight, when we see the opponent for the first time:

    <*> Oily Woim level 3, 2/3, Bonk, Lick, Unknown, None
    ...next familiar...
    ...
    ...for all six on both teams

    <*> lets us select the lines and only the lines of the session log that have pokefam info.
    Collect those lines - over however many days - sort them, and remove duplicates, and you have all the info that KoL tells you about the abilities of such and such a familiar at such and such level.

    I have seen a ton of familiars which have little or no data in the spreadsheet.
    Automated data collection could work really well.

    Of course, after day 1, I am running with ML 85+, so am not seeing the L1 or L2 data any more.

    Which is to say, everything that KoL showed us about each familiar can be saved and entered into the database.

    FightRequest.parseFamBattleHTML skips over all the HTML until it gets past the "his team" and "your team" stuff. Rather than "skipping over" it, it could parse each node that contains a Familiar (enemy or ally) and log what it saw in that format, which will give us the data we want.

    Log only round 0 (1?) so we don't see the effects of moves that add power, and so on.

    Simple matter of coding! Too bad the weekend is essentially over, and I am done coding KoLmafia until next weekend...

  10. #10
    Developer
    Join Date
    Apr 2010
    Posts
    4,757

    Default

    That would also give us the data on which monster has which familiars, which is fixed.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •