Jump to content


Photo

Mob family


    7 replies to this topic

    #1 mattm89

    mattm89

      Newbie

    • Members
    • Pip
    • 5 posts

      Posted 08 July 2014 - 03:31 PM

      Hi,

       

      I'm making an add-on intended to assist with blue mage and I would really like to have a function to return the family of a given (targeted) mob.. There is this property of get_mob that I have seen:

       

      windower.ffxi.get_mob_by_target('t').mob_type
       

      I've tested it using the InfoReplacer addon (%mob_type command), and it always returns None as a result of it failing somehow? I'm assuming anyway after a quick look at the InfoReplacer code. I tested it on several different mobs.

       

      I have achieved getting the mob family in a reasonably decent way by parsing wiki source using luasocket and an http.request, but it would obviously be much nicer if there was an windower api based way of doing this.

       

      Questions:

      A: Does mob_type == family ?

      B: If so, how do I get a string value of the family from this function

      C: If it isn't possible, is using luasocket to read the wiki an acceptable method for a windower addon?

       

      Cheers



      #2 Arcon

      Arcon

        Advanced Member

      • Windower Staff
      • 1189 posts
      • LocationMunich, Germany

      Posted 08 July 2014 - 06:52 PM

      The InfoReplacer method doesn't work, but I can tell you right now that mob_type doesn't exist anymore, it has been removed and changed to spawn_type (although technically spawn_type should be called mob_type... it's a bit of a mess right now).

       

      And second, it's not related to mob family at all. There is no such thing in the Windower API because there's no such thing anywhere in the game client. The mob family is only known server side, the client has no way of knowing it.

       

      There are two things you could do:

      1. Use the LuaSocket method you did before to query a wiki for the info. It's slower and a bit of a pain to implement, but should otherwise work fine.

      2. Use one of the mob's characteristics. You could either go by name, by model or by ID (of the things I can think of right now). The model does indicate family, but different models can still belong to the same family. The same goes for the name and ID. The problem is that no such mapping exists anywhere (that I know of). You would have to either create it manually, or use some automated method (like parse all of a wiki's data and create a mapping from there). Then you could use that to look it up dynamically based on one of those characteristics.

       

      If you decide to do it the second way, you should be aware that the ID is problematic because mob IDs frequently change. So it would be your responsibility to update it every FFXI update. Name and model should be fine, but you'd need to frequently update it when they add new mobs.

       

      Also, if you do create such a mapping, please share it with me, I'd be very interested in it for FFXIDB.



      #3 mattm89

      mattm89

        Newbie

      • Members
      • Pip
      • 5 posts

        Posted 08 July 2014 - 09:39 PM

        Thanks a lot for the info.

         

        I'll definitely be looking into creating a mapping like you said, most likely by writing a program to parse all the info from the wiki. Is there a list of all mob names somewhere? If not I can handle that somehow, possibly by looping through the ffxidb site pages, I'll have a think.

         

        Seems you would be interested in the mapping too; what format is best for you to store it all? Something like the lua resources in resources/lua? 

         

        I'll probably have this done in a couple of weeks as I only really have a couple of hours in the evenings to work on this.



        #4 Arcon

        Arcon

          Advanced Member

        • Windower Staff
        • 1189 posts
        • LocationMunich, Germany

        Posted 09 July 2014 - 07:14 AM

        The format doesn't matter at all, I can work with anything.

         

        This file contains all mob names, indexed by ID, in a Lua-friendly syntax. You can just load it with dofile('mobs.txt').

         

        This file contains the same, although a bit cleaned up (removed some obvious junk name entries, although there are still more). It's not in Lua format but just one map name per line.

         

        Whichever works for you.



        #5 mattm89

        mattm89

          Newbie

        • Members
        • Pip
        • 5 posts

          Posted 10 July 2014 - 10:18 PM

          Hey,

           

          I noticed that the list of mob names there includes a lot of things that aren't mobs - just target-able things that can't be attacked, which was kind of making messy data due things that don't have a family. Additionally, I wanted to include the zone of each mob, i.e allow duplicate mobs as long as they reside in different zones so I could load data in on a per-zone basis later.

           

          I decided to get a list of all mob name by parsing ffxidb which as far as I understand should be every attackable mob in the game, please correct me if that was a poor assumption. A few things on there aren't valid mobs.. such as the occasional Sturdy Pyxis or Treasure Chest. The parse came out with about 9100 mob names. I also recorded a zone ID and zone name for each mob from here.

           

          I then parsed ffxiclopedia and bgwiki looking for mention of a sub-family of each mob. I thought sub-family would be useful to record as it defines the mob weakness which is kind of what I wanted for my add-on.

           

          Then I also recorded the family based on the sub-family. All recorded families or sub families follow these definitions (weaknesses on that table are not completed yet):

          Anyway, the resulting data included quite a few anomalies that are not yet on the wikis, these were mostly Adoulin content mobs that I recorded manually from some googling. A few of them I couldn't find.. Looks like there are 9 mobs out of 9100 that I've set to "Unknown" as a result. I'm sure somebody who has actually played the Adoulin content could help me with them. There were also a few that I set to "None" which could probably be removed.

           

          Here it is:
          FFXI Mobs & Families

           

          I can envision some code now that loads all mobs from current zone to provide the family/sub-family/weaknesses, which is just what I wanted.

           

          Feel free to use any of that data, or let me know if there's any changes/additions you would like.



          #6 Arcon

          Arcon

            Advanced Member

          • Windower Staff
          • 1189 posts
          • LocationMunich, Germany

          Posted 10 July 2014 - 10:34 PM

          Thanks, I'm sure I can use that!

           

          But just fyi, the list of mobs with IDs that I posted contain the zone as well. The ID consists of 4 bytes in total, 32 bits. In hex format, this would be a mob ID:

          0xXXYYYZZZ

           

          Here XX (the highest 8 bits) represents the type of mob:
          0 = player

          1 = regular NPC

          2 = special NPC (only a select few mobs are in there, for example Meeble Burrows mobs)

           

          YYY (the next 12 bits) represents the zone ID and ZZZ represents the index of that mob within the zone.

           

          So for example, AV has the following entry:

           

             [16912876] = "Absolute Virtue",

           

          16912876 in 32 bit hex representation is:

          0x010211EC

           

          So split up into the above parts, that means:

          XX: 0x01, i.e. regular mob

          YYY: 0x021 == 33, i.e. Al'Taieu

          ZZZ: 0x1EC == 492, i.e. the 492nd mob in that zone

           

          Just for future reference, but I can use your data well, thanks again for that :)



          #7 mattm89

          mattm89

            Newbie

          • Members
          • Pip
          • 5 posts

            Posted 11 July 2014 - 11:38 AM

            Ah I see, thanks for the explanation :)

             

            You're welcome!

             

            I'll end up with another data set for all 171 current blu spells soon with all info I can think of, such as modifiers, skillchain propperties, etc.

             

            I'll post it here in case you ever need it



            #8 mattm89

            mattm89

              Newbie

            • Members
            • Pip
            • 5 posts

              Posted 11 July 2014 - 12:42 PM

              I've just updated the FFXI Mobs & Families data.

               

              I ran it through a few quick bits of code to check for spelling errors, family/subfamily mismatches or anything that doesn't comply with my family definitions.

               

              There were a few mistake on the wiki it turned out.

               

              Should be a near perfect data set now, bar the few "Unknown" entries that remain.






              1 user(s) are reading this topic

              0 members, 1 guests, 0 anonymous users