|
|
 |
 |
 |
 |
|
 |
 |
|
 |
 |
|
 |
|
Archive::Development Archive area for Development's posts that were moved here after an inactivity period of 90 days. |

11-14-2002, 03:31 PM
|
Demi-God
|
|
Join Date: Jan 2002
Location: Charlotte, NC
Posts: 2,614
|
|
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;
__________________
Quitters never win, and winners never quit, but those who never win and never quit are idiots.
|

11-14-2002, 03:51 PM
|
Demi-God
|
|
Join Date: Jan 2002
Location: Charlotte, NC
Posts: 2,614
|
|
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...
__________________
Quitters never win, and winners never quit, but those who never win and never quit are idiots.
|

11-14-2002, 05:04 PM
|
Hill Giant
|
|
Join Date: Oct 2002
Posts: 179
|
|
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! 
|

11-14-2002, 05:19 PM
|
Demi-God
|
|
Join Date: Jan 2002
Location: Charlotte, NC
Posts: 2,614
|
|
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.
__________________
Quitters never win, and winners never quit, but those who never win and never quit are idiots.
|
 |
|
 |

11-14-2002, 05:37 PM
|
Hill Giant
|
|
Join Date: Oct 2002
Posts: 179
|
|
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 
|
 |
|
 |
 |
|
 |

11-14-2002, 06:10 PM
|
Demi-God
|
|
Join Date: Jan 2002
Location: Charlotte, NC
Posts: 2,614
|
|
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.
__________________
Quitters never win, and winners never quit, but those who never win and never quit are idiots.
|
 |
|
 |
 |
|
 |

11-14-2002, 07:36 PM
|
Demi-God
|
|
Join Date: Jan 2002
Location: Charlotte, NC
Posts: 2,614
|
|
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.
__________________
Quitters never win, and winners never quit, but those who never win and never quit are idiots.
|
 |
|
 |

11-15-2002, 04:10 AM
|
Hill Giant
|
|
Join Date: Oct 2002
Posts: 108
|
|
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
ID=1
Item=Small Cloth Shirt
Loot Table
ID=1
ITem=Small Cloth Oants
...etc...
NPC Drop Table
LootID=1
Basiclly, a loot table defines all the items in a loot table, then the NPC itself has an entry pointing to which loot tables to roll on. In the above case, the npc would drop only 1 item, but that 1 item could be any of the cloth armor specified. If I wanted to drop 2 items, i'd add another lootid entry.
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.
|

11-15-2002, 04:35 AM
|
Hill Giant
|
|
Join Date: Oct 2002
Posts: 179
|
|
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 
|

11-15-2002, 05:44 AM
|
Dragon
|
|
Join Date: Jun 2002
Posts: 776
|
|
Any way those of us that aren't knowledgable in compiling source could get ahold of the executables for your modified emu trumpcard? 
|
 |
|
 |

11-15-2002, 06:57 AM
|
Demi-God
|
|
Join Date: Jan 2002
Location: Charlotte, NC
Posts: 2,614
|
|
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.
__________________
Quitters never win, and winners never quit, but those who never win and never quit are idiots.
|
 |
|
 |

11-15-2002, 07:07 AM
|
Hill Giant
|
|
Join Date: Oct 2002
Posts: 108
|
|
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.
|
 |
|
 |

11-15-2002, 07:24 AM
|
Hill Giant
|
|
Join Date: Oct 2002
Posts: 179
|
|
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
|
 |
|
 |

11-15-2002, 07:49 AM
|
Hill Giant
|
|
Join Date: Oct 2002
Posts: 108
|
|
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.
|

11-15-2002, 08:03 AM
|
Hill Giant
|
|
Join Date: Oct 2002
Posts: 179
|
|
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.

|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -4. The time now is 12:53 PM.
|
|
 |
|
 |
|
|
|
 |
|
 |
|
 |