How to determine mine and herb? menu

User Tag List

Page 2 of 2 FirstFirst 12
Results 16 to 20 of 20
  1. #16
    adaephon's Avatar Active Member
    Reputation
    76
    Join Date
    May 2009
    Posts
    167
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you're using a dictionary but doing a ContainsValue check it's a waste of time. Check existence of the key as thats ~O(1)

    How to determine mine and herb?
  2. #17
    Cypher's Avatar Kynox's Sister's Pimp
    Reputation
    1356
    Join Date
    Apr 2006
    Posts
    5,368
    Thanks G/R
    0/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Apoc View Post
    It's a non-ordered list of objects, usually updated each frame (or every-other frame). It's costly as hell. (Roughly 30-40 CPU cycles per .Contains)
    "Programs should be written for people to read, and only incidentally for machines to execute." (Structure and Interpretation of Computer Programs, by Abelson and Sussman)

    I use both ordered and unordered STL containers heavily in my code and have seen zero real performance drop in either case. Until you actually profile the code and check that it's causing a bottleneck or slowdown I'm gonna call bullshit on the 'costly' attribute.

    I don't know what the C# alternatives are and whether you're calling it 'costly' because it's premature pessimization (due to incorrect container choice or what-not), but premature optimization is just as evil, and that seems to me to be what you're doing.

    So, if you're calling it 'costly' because it's premature pessimization, what is the alternative? Hash table? What is the difference in speed between the containers (in Big O notation, not CPU cycles you dipshit, because you can 'control' the former, you can't control the latter -- nitpicker's corner: i'm obviously talking about the ALGORITHM, not the CODE)? What is the tradeoff? (For example hash containers need items hashed when added to the container, increasing the time it takes for new items to be added, etc etc)
    Last edited by Cypher; 08-02-2009 at 01:08 AM.

  3. #18
    jockel's Avatar Member
    Reputation
    4
    Join Date
    Mar 2009
    Posts
    54
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Tested on a Dictionary (Dictionary<uint, string>) with 50 000 entries:
    same with an Hashtable filled with 50000 entries


    Code:
          
           static bool HashtableTest()
            {
                return Hashtable.ContainsKey(40000);
            }
    
      static bool TryGetValueTest()
            {           
                    string val;
                    Dictionary.TryGetValue(40000, out val);
                    return val == null ? false : true;            
            }
    
            static bool ContainsTest()
            {            
               return Dictionary.ContainsKey(40000);            
            }

    100,00% HashtableTest - 3613,7 ms - 10000000 calls - PerfTest.Program.HashtableTest()
    84,49% ContainsKey - 3053,4 ms - 10000000 calls - System.Collections.Hashtable.ContainsKey(Object)

    100,00% TryGetValueTest - 1918,1 ms - 10000000 calls - PerfTest.Program.TryGetValueTest()
    81,33% TryGetValue - 1559,9 ms - 10000000 calls - System.Collections.Generic.Dictionary<TKey, TValue>.TryGetValue(TKey, TValue &)


    100,00% ContainsTest - 1942,4 ms - 10000000 calls - PerfTest.Program.ContainsTest()
    78,95% ContainsKey - 1533,5 ms - 10000000 calls - System.Collections.Generic.Dictionary<TKey, TValue>.ContainsKey(TKey)

    But filling a Hashtable seems to be slightly faster:

    100,00% Add - 24,565 ms - 50000 calls - System.Collections.Generic.Dictionary<TKey, TValue>.Add(TKey, TValue)
    100,00% Add - 22,420 ms - 50000 calls - System.Collections.Hashtable.Add(Object, Object)


    Edit:

    Wow I just tried it with an ArrayList (of course you can't compare Hastable/Dictionary to the arraylist)
    but the results are really shocking:

    static bool ArrayTest()
    {
    return ArrayList.Contains(40000);
    }
    100,00% Contains - 37463* ms - 4617 calls - System.Collections.ArrayList.Contains(Object)
    I had to stop the profiling because it took to long.
    Last edited by jockel; 08-02-2009 at 04:44 PM.

  4. #19
    starfish99's Avatar Corporal
    Reputation
    31
    Join Date
    May 2008
    Posts
    24
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I found it.

    Object descriptor field : OBJECT_FIELD_ENTRY is object's ID
    for Item or Container, it's Item ID, and for GameObject,it's Gameobject ID

    enum eObjectFields
    {
    OBJECT_FIELD_GUID = 0x0,
    OBJECT_FIELD_TYPE = 0x8,
    OBJECT_FIELD_ENTRY = 0xC, // Item ID or GameObject ID
    OBJECT_FIELD_SCALE_X = 0x10,
    OBJECT_FIELD_PADDING = 0x14,
    TOTAL_OBJECT_FIELDS = 0x5
    };

    Finding mine and herb by its id is sure better than by its name.

    Below are all mines and herbs and chests 's GameObject ID:
    (from Wowhead: The first three letters say it all.)

    Gatherer.Nodes.Names = {
    ["Small Thorium Vein"] = 324,
    ["Incendicite Mineral Vein"] = 1610,
    ["Copper Vein"] = 1731,
    ["Tin Vein"] = 1732,
    ["Silver Vein"] = 1733,
    ["Gold Vein"] = 1734,
    ["Iron Deposit"] = 1735,
    ["Mithril Deposit"] = 2040,
    ["Truesilver Deposit"] = 2047,
    ["Lesser Bloodstone Deposit"] = 2653,
    ["Indurium Mineral Vein"] = 19903,
    ["Ooze Covered Silver Vein"] = 73940,
    ["Ooze Covered Gold Vein"] = 73941,
    ["Ooze Covered Truesilver Deposit"] = 123309,
    ["Ooze Covered Mithril Deposit"] = 123310,
    ["Ooze Covered Thorium Vein"] = 123848,
    ["Dark Iron Deposit"] = 165658,
    ["Rich Thorium Vein"] = 175404,
    ["Ooze Covered Rich Thorium Vein"] = 177388,
    ["Hakkari Thorium Vein"] = 180215,
    ["Fel Iron Deposit"] = 181555,
    ["Adamantite Deposit"] = 181556,
    ["Khorium Vein"] = 181557,
    ["Rich Adamantite Deposit"] = 181569,
    ["Nethercite Deposit"] = 185877,
    ["Cobalt Deposit"] = 189978,
    ["Rich Cobalt Deposit"] = 189979,
    ["Saronite Deposit"] = 189980,
    ["Rich Saronite Deposit"] = 189981,
    ["Titanium Vein"] = 191133,
    ["Silverleaf"] = 1617,
    ["Peacebloom"] = 1618,
    ["Earthroot"] = 1619,
    ["Mageroyal"] = 1620,
    ["Briarthorn"] = 1621,
    ["Bruiseweed"] = 1622,
    ["Wild Steelbloom"] = 1623,
    ["Kingsblood"] = 1624,
    ["Grave Moss"] = 1628,
    ["Liferoot"] = 2041,
    ["Fadeleaf"] = 2042,
    ["Khadgar's Whisker"] = 2043,
    ["Wintersbite"] = 2044,
    ["Stranglekelp"] = 2045,
    ["Goldthorn"] = 2046,
    ["Firebloom"] = 2866,
    ["Purple Lotus"] = 142140,
    ["Arthas' Tears"] = 142141,
    ["Sungrass"] = 142142,
    ["Blindweed"] = 142143,
    ["Ghost Mushroom"] = 142144,
    ["Gromsblood"] = 142145,
    ["Golden Sansam"] = 176583,
    ["Dreamfoil"] = 176584,
    ["Mountain Silversage"] = 176586,
    ["Plaguebloom"] = 176587,
    ["Icecap"] = 176588,
    ["Black Lotus"] = 176589,
    ["Bloodthistle"] = 181166,
    ["Felweed"] = 181270,
    ["Dreaming Glory"] = 181271,
    ["Ragveil"] = 181275,
    ["Flame Cap"] = 181276,
    ["Terocone"] = 181277,
    ["Ancient Lichen"] = 181278,
    ["Netherbloom"] = 181279,
    ["Nightmare Vine"] = 181280,
    ["Mana Thistle"] = 181281,
    ["Netherdust Bush"] = 185881,
    ["Goldclover"] = 189973,
    ["Tiger Lily"] = 190169,
    ["Talandra's Rose"] = 190170,
    ["Lichbloom"] = 190171,
    ["Icethorn"] = 190172,
    ["Frozen Herb"] = 190175,
    ["Frost Lotus"] = 190176,
    ["Adder's Tongue"] = 191019,
    ["Firethorn"] = 191303,
    ["Hidden Strongbox"] = 2039,
    ["Giant Clam"] = 2744,
    ["Battered Chest"] = 2843,
    ["Tattered Chest"] = 2844,
    ["Solid Chest"] = 2850,
    ["Water Barrel"] = 3658,
    ["Barrel of Melon Juice"] = 3659,
    ["Armor Crate"] = 3660,
    ["Weapon Crate"] = 3661,
    ["Food Crate"] = 3662,
    ["Barrel of Milk"] = 3705,
    ["Barrel of Sweet Nectar"] = 3706,
    ["Alliance Strongbox"] = 3714,
    ["Box of Assorted Parts"] = 19019,
    ["Scattered Crate"] = 28604,
    ["Large Iron Bound Chest"] = 74447,
    ["Large Solid Chest"] = 74448,
    ["Large Battered Chest"] = 75293,
    ["Buccaneer's Strongbox"] = 123330,
    ["Large Mithril Bound Chest"] = 131978,
    ["Large Darkwood Chest"] = 131979,
    ["Horde Supply Crate"] = 142191,
    ["Un'Goro Dirt Pile"] = 157936,
    ["Blue Power Crystal"] = 164658,
    ["Green Power Crystal"] = 164659,
    ["Red Power Crystal"] = 164660,
    ["Yellow Power Crystal"] = 164661,
    ["Cleansed Night Dragon"] = 164881,
    ["Cleansed Songflower"] = 164882,
    ["Cleansed Windblossom"] = 164884,
    ["Bloodpetal Sprout"] = 164958,
    ["Cleansed Whipper Root"] = 174622,
    ["Blood of Heroes"] = 176213,
    ["Shellfish Trap"] = 176582,
    ["Practice Lockbox"] = 178244,
    ["Battered Footlocker"] = 179486,
    ["Waterlogged Footlocker"] = 179487,
    ["Dented Footlocker"] = 179492,
    ["Mossy Footlocker"] = 179493,
    ["Scarlet Footlocker"] = 179498,
    ["Burial Chest"] = 181665,
    ["Fel Iron Chest"] = 181798,
    ["Heavy Fel Iron Chest"] = 181800,
    ["Adamantite Bound Chest"] = 181802,
    ["Felsteel Chest"] = 181804,
    ["Glowcap"] = 182053,
    ["Wicker Chest"] = 184740,
    ["Primitive Chest"] = 184793,
    ["Solid Fel Iron Chest"] = 184930,
    ["Bound Fel Iron Chest"] = 184931,
    ["Bound Adamantite Chest"] = 184936,
    ["Netherwing Egg"] = 185915,
    ["Everfrost Chip"] = 193997,
    }

    btw:
    The url : http://www.wowhead.com/?object=[objectid] can tell you requied skill level.
    Last edited by starfish99; 08-18-2009 at 12:31 AM.

  5. #20
    tutrakan's Avatar Contributor
    Reputation
    134
    Join Date
    Feb 2013
    Posts
    175
    Thanks G/R
    124/52
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Cypher View Post
    Lol, delphi.

    Use the model of the object. Call the GetModelName VMT func or pull out the DisplayId of the gameobject and look up the model in the DBCs, then check using that whether it's a herb or mine. You only need to check one string because all the objects of each type start with the same thing...

    It's like __MININGNODE__\\ or something. Can't remember and too lazy to open VS and check. It's easy to do on your own.
    It's rather
    Code:
    CGGameObject_C::GetModelFileName(CGGameObject_C *this, const char **fileName)
    Thank you!

    I suppose this is the most laziest/elegant way to determine these?
    Last edited by tutrakan; 12-21-2018 at 12:39 AM.

Page 2 of 2 FirstFirst 12

Similar Threads

  1. Vash'jir - Best Mining and Herbing Profile!
    By moonk1n in forum WoW Bot Maps And Profiles
    Replies: 5
    Last Post: 08-20-2012, 11:41 PM
  2. Uldum mining and herbing profile, 137 harvests per hour
    By talihashi in forum WoW Bot Maps And Profiles
    Replies: 0
    Last Post: 03-02-2012, 07:29 PM
  3. [SGatherer+Whack Underground Profiles - Mining and Herb!] *Under Progress*
    By darkpingu in forum WoW Bot Maps And Profiles
    Replies: 26
    Last Post: 05-05-2011, 11:53 AM
  4. [Gold] [Mining And Herbing In Tanaris]
    By doodlydude in forum World of Warcraft Guides
    Replies: 3
    Last Post: 07-06-2010, 04:59 PM
  5. how to display ore and herbs at the sam time
    By sytry in forum World of Warcraft Guides
    Replies: 12
    Last Post: 08-04-2009, 12:02 AM
All times are GMT -5. The time now is 04:58 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search