FIX: Only 1 lootdrop per mob
Comment these lines out in loottables.cpp and it will go through the whole loot list for the mob, rather than just hitting the 1st one then falling out. Theres a problem with the rand() being used, so you will always end up with the item though.
How is it intended to work? I would think it would be if (rand%100 < (probability*10) probabilty appears to be 1 for most items on the list, so setting it to probability*10, would give at least a 10% chance for each item in the list... Any thoughts? 144,145c144,145 < mysql_free_result(result); < return; --- > //mysql_free_result(result); > //return; |
Actually, that works pretty good... Try this out..
diff -b loottables.cpp loottables.cpp.mod 127c127,129 < if(rand() * 100 < atoi(row[4]) < 10 ? 10 : atoi(row[4])) > if( (rand()%100) < (atoi(row[4]) * 10) ) 144,145c146,147 < mysql_free_result(result); < return; --- > //mysql_free_result(result); > //return; The only bug i am seeing here is every once in awhile you get an ungoldly amount of plat... |
Implemented your change here Trumpcard, will play around on it a bit and tell ya later how much nicer it seems to be. Good going! :)
|
Well, I think the data for 'chance' is kinda goofy, i checked it out, about 11000of the entries in lootdrop have probabilities less than 5, and 1299 have probabilities greater than 5, 23 of which are greater than 100. I suppose that makes the chance*10 calculation decent.
Whats the point of the 696 records with chance = 0? Probably bad data, so not sure... I'll have to load up Drawde's database and see how his data is set up. |
Its real progress...
.. whee, loot!
Boy is there a lot of it though. I did my testing in blackburrow, played around for a while here, and had a friend play some too and keep track of what dropped. Gnoll pups dropped nothing but coin. Scrawnies dropped from 12-15 items + coin at a time. Gnolls dropped from 14-18 items at a time + coin. Do you think it'd be possible to set it up to give it a certain percentage or probability of dropping each item in the list, then limiting the number of items it will drop without affecting the random? .. or is this done by either changing the chance number under the loot drop entries tab on the admin tool, or by changing the multipler or probability under loot table entries tab, or by doing something with the code itself? So what I'd be looking for is this - A good chance that a plain "A gnoll" will drop a rusty weapon, a good chance it will drop a bow and 1 or more arrows, and then a random chance that it'd drop any of the other crap it carries such as gnoll fur, or gnoll teeth or whatever, and of course it'd drop its cash. Or even something as simple as giving some items a higher chance of dropping than others in the "A_gnoll" loot table, and then limiting how many it can drop at any given time, say no more than 4-5? Either way would be rather acceptible, imo. Anyone else who wants to see Trump's code in action as it stands tonight is welcome to check it out on my server :) |
Heres the loot table for a scrawny gnoll
I think the data is just really off for this zones, most other zones seem to be fairly decent.. mysql> select * from lootdrop_entries where lootdrop_id = 12417; +-------------+---------+--------------+------------+--------+ | lootdrop_id | item_id | item_charges | equip_item | chance | +-------------+---------+--------------+------------+--------+ | 12417 | 1028 | 1 | 0 | 1 | | 12417 | 5015 | 1 | 0 | 2 | | 12417 | 5019 | 1 | 0 | 3 | | 12417 | 5020 | 1 | 0 | 3 | | 12417 | 5023 | 1 | 0 | 1 | | 12417 | 6011 | 1 | 0 | 5 | | 12417 | 6014 | 1 | 0 | 3 | | 12417 | 7008 | 1 | 0 | 2 | | 12417 | 7009 | 1 | 0 | 1 | | 12417 | 7010 | 1 | 0 | 1 | | 12417 | 13025 | 1 | 0 | 51 | | 12417 | 13915 | 1 | 0 | 18 | | 12417 | 19630 | 1 | 0 | 36 | | 12417 | 20178 | 1 | 0 | 4 | | 12417 | 20179 | 1 | 0 | 2 | | 12417 | 20181 | 1 | 0 | 1 | | 12417 | 27392 | 1 | 0 | 33 | | 12417 | 27405 | 1 | 0 | 20 | | 12417 | 27409 | 1 | 0 | 17 | | 12417 | 27417 | 1 | 0 | 6 | | 12417 | 27421 | 1 | 0 | 9 | | 12417 | 27423 | 1 | 0 | 10 | | 12417 | 27424 | 1 | 0 | 6 | | 12417 | 27427 | 1 | 0 | 7 | +-------------+---------+--------------+------------+--------+ Any item with a probility over 5 is most likely going to be there, and a prob. of 10 will DEF. be there, so the solution is to either accept really low probabilty drops, (Cloth shirt by this table has a prob. of 1 or 10 based on how you calculate it, patch of gnoll fur will be either 51 or 510%) , fix the data to be correct, or code in a 'cludge' factor to account for skewed chances of a drop. Say, do a precheck on chance, and normalize it if it's over 10. (Divide by 10). That will fix the drops for most everybody. Personally, i'd rather see the probabilities correct in the database with it being just a standard probability, ie. 1-100, the you just need a rand()%100 to compare against. Lurker/Drawde/Khoung , since you guys are the primary data team, how do you think it should be handled? Edit: Actually , on playing around with it, the low numbers arent that bad for creatures with 10+ drops, but maybe instead of using *10, have it * (LOOTDROPMOD) which could be a variable. Up it to 2 if you want to slighty increase the frequency of drops on your server, or 3, etc. I'll see about that.. If *10 is too high, set it down to 1 - 5 and see where it seems balanced at for you. |
Ok, change of thought train here...
(In case you guys are wondering, I have insomnia so this has been something fun to occupy my time.) I opted to make it a variable. 10 is too high. When I set it originally, I was in Fearplane, so it seemed like the drops were coming out good, but they are way to high on lower end mobs, especially ones with larger possible inventories. My solution is to default the value at 1, add a new database entry in called LootDropMod, and make it configurable. If you dont like the rate at which your database is dropping, just tweak this number. Heres the complete diff first. 120a121,133 > > int LootDropMod; > char temp[64]; > if (database.GetVariable("LootDropMod", temp, sizeof(temp)-1)) > { > LootDropMod = atoi(temp); > } > else > { > cerr << "Variable not found ! Setting to default of 1" << endl; > LootDropMod=1; > } 127c140,143 < if(rand() * 100 < atoi(row[4]) < 10 ? 10 : atoi(row[4])) --- > if ( (rand()%100) < (atoi(row[4]) * LootDropMod) ) 144,145c160,161 < mysql_free_result(result); < return; --- > //mysql_free_result(result); > //return; So, load this code in, then go into mysql and do a mysql>use eq; mysql>insert into variables values ('LootDropMod','2'); I set mine to 2, adjust to taste. It will give you a linear scaling factor to up your drop rate on your server. I still think the planes drops are way off from the low end drops, but thats just me. I really like this change though, I'd like to roll it into the money calc too , or a seperate variable to determine it. Anyways, hope you guys like this addition, and it helps spice up your servers. |
Is there only one single loot table, as indicated above? That is odd.
The way "real eq" does it is it uses 2 loot table. One loot table defines what items are in a loot table (For example, all the coth armor), then another loot table, which is actually attached to the mob, specifies how many items to drop. Thats not realy clear, so let me show you. Code:
Loot Table Is this not the way eqemu works? You're above post implies it does not. Forgive me if this sounds incoherant. I just woke up. |
I like the change Trumpcard, thanks for working on it. :)
I'll be completely satisfied once I tweak the items in the db a bit. Thanks again, its great :) |
Any way those of us that aren't knowledgable in compiling source could get ahold of the executables for your modified emu trumpcard? :)
|
Questor,
The table above just assigns the list of items to drop for a specific spawntype. | 12417 | 1028 | 1 | 0 | 1 | | 12417 | 5015 | 1 | 0 | 2 | the items are stored in the item database, and there is a lootdrop_entries table that assigns a list of items for each mob spawntype (not npc_type, you can have 20 of the same npc_types that are in different spawn groups, so each instance of them will have a seperate loot table. The change I made is a couple of small fix, the code was freeing the mysql object after the first loop, so you never ended up with a chance for anything except the first item, and a miscalculation of the rand() value. The rand values as it was originally were coming out obscenely small for me (-xxxxxxxxx), so you always ended up with the 1st item on the loot table. The other change is to increase/decrease loot drop frequencies. I originally hardcoded a scaling factor, but thought about it and decided that making it scablable by a database variable was a better option. This way you could tweak it. I see a server that on Christmas day sets it's scaling factor to 10 so everyone gets flooded with most of the drops on the mobs loot table, nice time for a plane raid! killspree: I don't have VC++ installed on my windows machine right now, but I'll see about throwing it on this weekend and compiling a zone.exe for you. |
Not really waht I mean....
If I wanted to mAKe a gnoll have a chance to drop any piece of medium cloth armor, it loks like, from what I read above, I have to specify each piece in the loot table for that mob.. which means it has a chance of dropping every single piece. The way real eq does it, the better way, is to specify a loot table that contains every cloth piece, but on the mob itself, basicly assign one entry that says "Roll one on this loot table which contains every cloth piece". See what I mean? Is that the way the emu is setup? It doesn't sound like it. Maybe i'm just misunderstanding though. My mind is kinda on a different track workign on these npc profiles. |
You're right there on the first option - it has a chance to drop 1 of everything in the loot table if you set the chance column in the db to that. I've been messing around with this, along with Trumpcard's code on my server, have tweaked several kinds of gnolls in blackburrow right now. Hop in if you wanna see what I've done with it, but basically I just put a higher number in chance for those things I wanted them to drop more regularly - such as gnoll fur and fangs, and lower chances on things like weapons and hq pelts, etc. I completely nixed the "build your own gnoll" parts - ulna, jawbone, fingers, etc... just coz I dont like those parts personally. Is gonna be a big project to tweak, but I'm having fun slaying lots of gnolls to check my changes. :P
Every now and again I'll luck out and get 3 weapons and a fang or something, but I write it off to luck of the n00bie - seeing as how its hard to play EQ on a server without an existing economy. Makes it that much harder to build your character up since you cant summon or buy all your l33t armor on my server :P |
Well, personally, I think it should be re-written then to work the way EQ does it.. Its also the same way most every RPG does it. You get "X" rolls on "Y" table.
If I want a gnoll to have a chance to drop 1 rusty weapon, and 1 piece of medium cloth armr, then I make 2 tables. One will all the rusty weapons, and one with all the medium cloth armor. I tehn tell it to roll once on each table. |
As it stands, I'm satisfied, at least loots are dropping for the players now and you do have some sort of control over it. Perfect? No.. there's several ways to do anything, but this is functional.
:) |
I'd like to keep working on it, and I agree, thats a better way to implement it..
A new table, for example.. LOOTCLASS : Cloth Armor Cloth Shirt (Chance of Drop) Cloth Hat (Chance of Drop) Cloth Tunic (Chance of Drop) So you could make tables for all the classes. Then, you could just make the lootdrop_entries lootdrop id a specifier to the lootclass and you could randomly select 1 item out of the list on a successful roll, or randomly pick one and roll on it. I'd even throw in a extra random factor so on a 1/10 ~ 1/100 chance you get multiple drops out of the same LOOTCLASS table. I like it ! I'll work on implementing if anyone is interested.. |
I'll gladly test it out for ya Trumpcard when ya get it implemented. I'm really interested in this, and I learn a little more each time I'm exposed to the code. Anything I can do to help ya?
|
That's a really good idea.. many monster types drop identical types/ranges of equipment,
e.g rusty/bronze/FS weapons, various armour types, gems and jewellery of various values, runes/words, spell scrolls etc, as well as their "unique" loot like bone chips, so using shared tables for this would save a lot of time as well as a fair bit of memory. Maybe each NPC could be assigned a list of loot tables, instead of simply a loot table, so e.g for skeletons you'd assign the Rusty Weapons and Skeleton tables, and for orc legionnaires the Rusty Weapons, Bronze Weapons, Cloth Armour and Orc tables. |
Yep, thats exactly why we did it that way in "real eq". There are about a hundred (Well now, i'll bet there are several hundred) "standard" loot tables that NPCs roll on in "real eq". Tables like the various armor tables, weapon tables, gem tables, animal parts tables, etc.
Also some zones have the "zone tables".. those are those zones where any mob in the zone has a chance to drop any item from that zone. |
Lots of good ideas and info in this thread. Just wanted to mention where the numbers form the DBAddon came from, so some ideas oh what to do with the data can be pondered. All the loot info is from the Ethernalquest DB, they list the items droped, and times each item was collected. Therefore if the chance is 5 then the % is 5/total chance values for the lootdrop
For a scrawny gnoll to drop | 12417 | 6011 | 1 | 0 | 5 | is 5/242 (2%) acording to the collected data At the time I didn't wory too much about the numbers being right... loot was messed up then worse than now :/ Regarding coin, I just added coin to all mobs that didn't have some loot already. I just did some rough numbers based on level |
Actually, the loot numbers are probably pretty good.. obviously indivudual gm's can tweak them to taste, but they probably will work pretty well for the time being. Loot actually seems to be working good on my server with my updates so I'm not going to worry about the numbers. I really do like the idea of creating a loot category table, then making those the id referenced in lootdrops rather than specific item numbers, they can reference different classes of items as opposed to indidual ones. Just have to do an additional couple of rands and another mysql pull to get the data out.
So, how do you want to do it? All items in each lootclass table have an identical probability, then we can just roll a probablity of an item from the table, count the records in the lootclass table, then do a rand%<numrows> to determine what item you get. After that before bombing out, do an initial check for a zonelootdrop (which can be empty if you have no zone specific items) , and then take a chance on an item from that table. We can keep the original loot probablities for inidudual items tied to the table probability. IE, if we have a 5 for a rusty sword, we can just use 5 as the probability of a drop from the entire table which is then chosen randomly. |
Heh why are you making it so complicated? Giving me a headache :p
You have two factors involved. Item Tables, and Loot Tables. An Item Table contains a list of item IDs, as well as a low and high roll for decieding what drops. When choosing an item from the item table, a randomw value between 1 and 100 is chosen, and the item from the table which has a min/max value range covering that value is chosen. EG: Code:
table: item_table Assume you had a second item table with rusty weapons. Now the second part of this scheme, is the Loot Table, which is defined in the NPC itself. The loot table is 1 entry per item you want dropped. Each entry identifies the item table to roll against, as well as the % chance that you will roll. In otherwords, you can have an 80% chance of rolling against the cloth armor table. 20% chance you won't roll on that table (And thus not have a cloth drop, but you could still have a rusty dropm as it is seperate). This is how it is done in "real eq". |
Quote:
|
All times are GMT -4. The time now is 02:56 AM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.