EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   General::General Discussion (https://www.eqemulator.org/forums/forumdisplay.php?f=586)
-   -   New loot system (https://www.eqemulator.org/forums/showthread.php?t=35770)

sorvani 09-22-2012 12:33 AM

adding it back in as a server rule would be good then it can be enabled or not by custom content providers like many other features.

Traul 10-04-2012 06:42 PM

Came in to post exactly what ChaosSlayerz did, particularly his ADDITION post. This change has made things much more difficult for me.

Couldn't we simply re-add the probability on individual loottables and have it default to 100 when creating a new one?

Akkadius 10-05-2012 01:12 AM

I can say that I've got loot dumped for all expansions, I just need to refine it and comb through it with Cavedude before finalization.

http://i.imgur.com/3f1tL.jpg
http://i.imgur.com/tETry.jpg
http://i.imgur.com/OBW21.jpg
http://i.imgur.com/uD0NQ.jpg

werebat 10-07-2012 04:42 PM

I am using the new loot system with the defiant armor sql I created. I have chance at 2, mindrop at 0 and droplimit at 1 since I would like a rare drop rate wit no more than one item. But the items are dropping at an incredibly rate. I had 4 pieces drop off of 6 kills. Not sure if I have something set up wrong or if the code needs to be fixed. Under the old system the rates were pretty accurate.

sorvani 10-07-2012 06:31 PM

New system works fine on my test server and I is live on PEQ also. Post your SQL.

werebat 10-12-2012 02:00 PM

I think I figured it out. It has to do with the number of items in the lootdrop. I had 30 items at a chance of 2. So when a kill happens, it was rolling for all 30 items at a 2% chance. Computers do not have a true random like a dice roll, instead it uses an algorithm to simulate the random numbers. So a 2% chance on 30 rolls would mean that 60% of the time you were likely to get a drop. Off 10 kills that is 6 drops which is about what was happening. So I changed the chance to 0.5 and now it is about 1 out of every 6 drops. So it appears your chance should be (desired % drop / # items in drop) to drop properly. I am not sure how low the chance can be set, but if you have a very large number of items in your drop, then it may not be feasible depending on limits. At least thats how its working for me. The old way with probabilty worked fine since there was only one roll made against it. The new system has its merits too so its just a matter of figuring out how to make it work for your purposes. One suggestion would be to randomize the seed before each roll. I may try this when I get a chance but for now the above step seems to working.

ChaosSlayerZ 10-12-2012 05:35 PM

that's exactly the problem with new system
you still have to pre-calc all the chance like in old system and then manually convert it to the new system.

For example if in old system you had a 3% chance to drop SOMETHING out of a list of say 25 items (4% per item) - you just set the probability to 3%, and fill out the item table with even chance per item adding up to 100%.

in new system you now have multiply all 4% by 3%, and set each item to 0.12% for each item. Ton of headache for no gain, not to mention loss of functionality.

Elysius 10-12-2012 05:45 PM

Cavedude you're the man but can we please change this back to the old way? I've stopped working on my server because the amount of work having to make a separate loottable for almost every single NPC is pretty daunting. :(

revloc02c 10-27-2012 11:26 AM

Quote:

Originally Posted by cavedude (Post 212731)
I'm not going to be around much for the next 2 or so weeks, but I plan on taking a look at re-introducing probability with its usage being optional sometime after then in October.

I see pros and cons of both the new system and the old system. I am wondering if you can just implement both by using the probability column as the determining factor:
If probability = 0 use the new system
If probability != 0 use the old system

Just a thought.

(Except the old system would be even cooler if the new columns Mindrop and Droplimit, and minLVL and maxLVL were included in it.)

ChaosSlayerZ 10-27-2012 12:25 PM

IMHO the only problem with old system was uneven RND.

The problem with new system beyond the screw up of loot table design user-friendly interface, is a loss of a significant feature such as utilization of a single loot entry in potential scenarios and variations.

If probability just added on top the new system I am not sure how this will work with each item on the list rolling by itself. Since new list is designed with no probability in mind. But I suppose this can be fixed with setting drop limit.


Again, IMHO simply keeping the old system (+fixing the RND number generation) AND adding the new features like Mindrop is the best way to go.

chrsschb 10-27-2012 12:42 PM

I've been using the old system for over 5 years now and what you guys call "weird RND" is truthfully part of what made EQ, well, EQ. The numbers ARE random, and I've seen every item in a table drop fairly closely to it's proposed drop rate when looking at the whole picture, not just a single person's bad luck.

2% drop rate on super rare item:

Guy one gets item in 5 kills
Guy two gets item in 45 kills

50 / 100 = 2%

Sucks for guy two, BUT THAT IS WHAT WE KNOW AND REMEMBER!

ChaosSlayerZ 10-27-2012 01:16 PM

chrsschb, your example if perfectly normal - but thats not what meant by broken RND.

Let me give you an example:

you have loot table of 10 items, 10% each, and multiplayer of 5. (100% prob)
In theory, you should get up to 5 different items per kill.
What happens in reality, is that RND generates numbers in close series.
So when RND is asked to generate 5 numbers in a row from 1 to 100, it doesn't pick 5, 20, 77, 13, 56. It picks 88,81,84,89,91. So when it comes to loot table, you end up getting 4 copies of item that sits in 80-90 range and 1 item in 91+.

This doesn't happen every-time but VERY often.

chrsschb 10-27-2012 01:28 PM

Quote:

Originally Posted by ChaosSlayerZ (Post 213693)
chrsschb, your example if perfectly normal - but thats not what meant by broken RND.

Let me give you an example:

you have loot table of 10 items, 10% each, and multiplayer of 5. (100% prob)
In theory, you should get up to 5 different items per kill.
What happens in reality, is that RND generates numbers in close series.
So when RND is asked to generate 5 numbers in a row from 1 to 100, it doesn't pick 5, 20, 77, 13, 56. It picks 88,81,84,89,91. So when it comes to loot table, you end up getting 4 copies of item that sits in 80-90 range and 1 item in 91+.

This doesn't happen every-time but VERY often.

I haven't ran into this issue, sorry.

Traul 10-27-2012 02:12 PM

I really like ChaosSlayerz proposed modifications. Is there any update/progress on this at all?

prickle 10-28-2012 03:55 PM

The changes seem ok to me. However, the only problem i have with it is the PEQEdit interface wasn't updated to account for the changes. So, when i though i was setting a 5% chance to get one of 30 items, i was actually setting a 5% chance to get each of 30 items with no limit, because the PEQEdit interface did not have the mindrop and droplimit fields and the default for both is 0.

Fortunately, it appears that GeorgeS GUI tools have been updated to account for these changes, which helps with correcting the drop rates.

cavedude 10-28-2012 04:22 PM

PEQ PHP editor was updated way back in September, Rev 342. Make sure to grab it from SVN and not the download. I'm not going to be maintaining the downloads anymore. I just don't have the time.

I'll get back to the loot changes soon. I'm going to add probability back as an optional part of the system due to the fact that you can no longer have the same lootdrop in multiple loottables with different percentages. But, I'm 95% certain that is the only functionality the new system lost over the old, so no further changes will be needed. Of course, if we come up with something else the new system cannot do that the old could, I'll look at that as well.

For those who plain just don't like it, you can always revert locally. It's only 1 method, part of another method, and a few database calls. That code is hardly ever touched, so you could probably continue on with it in a conflicted state and never be bothered by it.

ChaosSlayerZ 10-28-2012 04:42 PM

you mean the probability, not multiplier, right? ;)

cavedude 10-28-2012 04:46 PM

Sorry, yes! I'll fix my post.

ChaosSlayerZ 10-28-2012 04:52 PM

thank you Cavedude ;)

ChaosSlayerZ 11-22-2012 02:37 PM

So Cavedude, when can we expect the new source revision out with the changes discussed? ;)

Tabasco 11-22-2012 06:39 PM

As he noted, the adjustments are pretty minor. This works for me:
http://dungeoncrawl.us.to/eq/lootstuff.diff.txt

This is an excellent change overall and it has greatly simplified how I do loot.

Edit: You'll need to add a probability field to the table, I have mine in as a float.

Caryatis 11-22-2012 07:28 PM

Whoa dude slow down, you expect us to do a slight amount of work? No thanks, Ill just wait until somebody does it for me.

sorvani 11-22-2012 11:54 PM

Quote:

Originally Posted by Caryatis (Post 214609)
Whoa dude slow down, you expect us to do a slight amount of work? No thanks, Ill just wait until somebody does it for me.

don't forget the part about bitching about it.

Drajor 11-23-2012 04:23 AM

Quote:

Originally Posted by Tabasco (Post 214607)
As he noted, the adjustments are pretty minor. This works for me:
http://dungeoncrawl.us.to/eq/lootstuff.diff.txt

This is an excellent change overall and it has greatly simplified how I do loot.

Edit: You'll need to add a probability field to the table, I have mine in as a float.

Thanks, working for me :)

cavedude 11-23-2012 12:18 PM

Thanks for that Tabasco, this was going to be my next task after I got the new PEQ forums sorted. Even though it was a minor change, it was a big help to me thanks!

This is committed in Rev 2260.

ChaosSlayerZ 11-23-2012 09:47 PM

thanks Cavedude ;)

ghanja 11-25-2012 06:57 PM

I'm sorry for not following exactly in all this. Has the change been reverted entirely, or is there now chance and probability?

Akkadius 11-25-2012 07:21 PM

Quote:

Originally Posted by ghanja (Post 214707)
I'm sorry for not following exactly in all this. Has the change been reverted entirely, or is there now chance and probability?

Yes, there is now chance AND probability

thepoetwarrior 11-28-2012 05:46 PM

Quote:

Originally Posted by werebat (Post 213266)
I think I figured it out. It has to do with the number of items in the lootdrop. I had 30 items at a chance of 2. So when a kill happens, it was rolling for all 30 items at a 2% chance. Computers do not have a true random like a dice roll, instead it uses an algorithm to simulate the random numbers. So a 2% chance on 30 rolls would mean that 60% of the time you were likely to get a drop. Off 10 kills that is 6 drops which is about what was happening. So I changed the chance to 0.5 and now it is about 1 out of every 6 drops. So it appears your chance should be (desired % drop / # items in drop) to drop properly. I am not sure how low the chance can be set, but if you have a very large number of items in your drop, then it may not be feasible depending on limits. At least thats how its working for me. The old way with probabilty worked fine since there was only one roll made against it. The new system has its merits too so its just a matter of figuring out how to make it work for your purposes. One suggestion would be to randomize the seed before each roll. I may try this when I get a chance but for now the above step seems to working.

I'm having the same problem with something like a 2% chance for 1 of 30 items in list to drop is now having 60% chance of dropping an item. How can this be fixed?

cavedude 11-28-2012 06:06 PM

Quote:

Originally Posted by thepoetwarrior (Post 214825)
I'm having the same problem with something like a 2% chance for 1 of 30 items in list to drop is now having 60% chance of dropping an item. How can this be fixed?

There is nothing to "fix." If you have 30 items with 2% chance that each will drop, then you have a 60% chance that at least 1 will drop (30*2.) That's basic mathematical probability and how our loot system should have worked from the beginning. But, I'm not going to get into that rant.

Now, to change it to behavior like you need it to you have 2 ways.

First, probability (which I almost considered changing the name to probability_modifier because that is what it really is) is back, so you can set that to control the total drop rate of the group of items.

Next, you can lower the chance of the items. (Remember, the new system now accepts floats so you can have chances below 1%.) This basically is just the drawn out way of doing the above. But from a mathematical standpoint, it is the correct way of doing so.

thepoetwarrior 11-28-2012 07:35 PM

I know the new loot system is working on intended, just need to fix coverting properly the old loot to have loot drop rates as intended.

I was thinking that probability was the issue too.

Here is a quick sample:

http://i47.tinypic.com/2w3zzpw.png

I'm guessing if I copy the probability from the old loottable_entries to the new loottable_entries then I would see the desired drop rates we had before?

The problem with manually fixing all the drop rates below 1% is 6 years worth of custom content would be a nightmare to fix manually.

cavedude 11-28-2012 09:10 PM

If you intend on using probability, then both probability and chance would need to be changed to what you had in the old system. If you didn't change chance, then yes change probability back to what it was and you'll be good to go.

If you used the script on SVN to convert your tables over, then loot will drop at the same rate it did before. The only exception would be multiple lootdrops using the same chance but different probability would not have been converted properly. If you did convert, I'd suggest restoring from a backup and forget about the conversion process. That was an oversight on my part brought to my attention in this thread. Though, I am assuming you didn't convert, since your rates are off.

thepoetwarrior 11-29-2012 08:23 AM

I've restored from backup already and rolled back.

I think some of the loots got updated, and some didn't. Should be able to run probability on 100% for everything since chance should have been updated to usually a decimal number for rare loots.

Will try to re run the script again later.

cavedude 11-29-2012 12:29 PM

If you restored your database back to the way it was before the changes, run these queries to restore your functionality as well:

Code:

update loottable_entries set mindrop = multiplier, droplimit = multiplier, multiplier = 1 where probability = 100;
update loottable_entries set droplimit = 1 where probability != 100;

This will remove multiplier for tables that have a 100% probability (since mindrop/droplimit can now handle that, although you can still use multiplier if you wish using droplimit) and it forces all other lootdrops to only drop 1 item at a time max (unless a multiplier is set, of course) which duplicates the behavior of the old system. Chance and probability no longer needs to be changed since probability is back.

The difference is in the old system, a lootdrop could only drop a single item unless a multiplier was set, but that still was determined by probability. Now in the new system, we can control exactly how many items will or could drop per lootdrop and it can be as many or as few as you need.

jasmine88 12-12-2012 06:31 AM

nice info keep it up..........

thepoetwarrior 12-15-2012 02:11 AM

After much frustration I gave up on updating the source for a bit. Now trying to give it another shot, and this time with Trevius suggested code as well. As you can see it seem to run fine and no errors:

(On a brief side note, after last source update attempt, with help from Secrets and Akkadius, figured out the zone crashing and npc eating items handed in was due to some plugins, now trying to resolve final issue - loot).

Code:

alter table loottable_entries add `droplimit` tinyint(2) unsigned NOT NULL default 0;
alter table loottable_entries add `mindrop` tinyint(2) unsigned NOT NULL default 0;
alter table lootdrop_entries change `chance` `chance` float not null default 1;
alter table lootdrop_entries add `multiplier` tinyint(2) unsigned NOT NULL default 1;

CREATE TEMPORARY TABLE temp_table (
lootdrop_id INT(11) PRIMARY KEY,
chance INT(11) DEFAULT 0
);
INSERT INTO temp_table ( temp_table.lootdrop_id, temp_table.chance ) (SELECT lootdrop_entries.lootdrop_id, SUM(lootdrop_entries.chance) FROM lootdrop_entries GROUP BY lootdrop_entries.lootdrop_id);
UPDATE lootdrop_entries, temp_table SET lootdrop_entries.chance = (lootdrop_entries.chance * 100 / temp_table.chance) WHERE lootdrop_entries.lootdrop_id = temp_table.lootdrop_id;
DROP TEMPORARY TABLE temp_table;

update lootdrop_entries lde
inner join loottable_entries lte ON lte.lootdrop_id = lde.lootdrop_id
SET lde.chance = (lte.probability/100)*(lde.chance/100)*100;

update loottable_entries set mindrop = multiplier where probability = 100;
update loottable_entries set droplimit = multiplier where probability = 100;
update loottable_entries set multiplier = 1 where probability = 100;

update loottable_entries set droplimit = 1 where probability != 100;

update lootdrop_entries set chance = 100 where chance > 100;

alter table loottable_entries drop `probability`;

ALTER TABLE  `loottable_entries` ADD  `probability` FLOAT NOT NULL DEFAULT  '100';

/* ************************************* */

[SQL] alter table loottable_entries add `droplimit` tinyint(2) unsigned NOT NULL default 0;
Affected rows: 23935
Time: 0.060ms

[SQL]
alter table loottable_entries add `mindrop` tinyint(2) unsigned NOT NULL default 0;
Affected rows: 23935
Time: 0.050ms

[SQL]
alter table lootdrop_entries change `chance` `chance` float not null default 1;
Affected rows: 87010
Time: 0.210ms

[SQL]
alter table lootdrop_entries add `multiplier` tinyint(2) unsigned NOT NULL default 1;
Affected rows: 87010
Time: 0.210ms

[SQL]

CREATE TEMPORARY TABLE temp_table (
lootdrop_id INT(11) PRIMARY KEY,
chance INT(11) DEFAULT 0
);
Affected rows: 0
Time: 0.050ms

[SQL]
INSERT INTO temp_table ( temp_table.lootdrop_id, temp_table.chance ) (SELECT lootdrop_entries.lootdrop_id, SUM(lootdrop_entries.chance) FROM lootdrop_entries GROUP BY lootdrop_entries.lootdrop_id);
Affected rows: 23170
Time: 0.220ms

[SQL]
UPDATE lootdrop_entries, temp_table SET lootdrop_entries.chance = (lootdrop_entries.chance * 100 / temp_table.chance) WHERE lootdrop_entries.lootdrop_id = temp_table.lootdrop_id;
Affected rows: 4470
Time: 0.340ms

[SQL]
DROP TEMPORARY TABLE temp_table;
Affected rows: 0
Time: 0.010ms

[SQL]

update lootdrop_entries lde
inner join loottable_entries lte ON lte.lootdrop_id = lde.lootdrop_id
SET lde.chance = (lte.probability/100)*(lde.chance/100)*100;
Affected rows: 80171
Time: 0.840ms

[SQL]

update loottable_entries set mindrop = multiplier where probability = 100;
Affected rows: 1790
Time: 0.010ms

[SQL]
update loottable_entries set droplimit = multiplier where probability = 100;
Affected rows: 1790
Time: 0.010ms

[SQL]
update loottable_entries set multiplier = 1 where probability = 100;
Affected rows: 318
Time: 0.000ms

[SQL]

update loottable_entries set droplimit = 1 where probability != 100;
Affected rows: 22145
Time: 0.070ms

[SQL]

update lootdrop_entries set chance = 100 where chance > 100;
Affected rows: 0
Time: 0.000ms

[SQL]

alter table loottable_entries drop `probability`;
Affected rows: 23935
Time: 0.040ms

[SQL] ALTER TABLE  `loottable_entries` ADD  `probability` FLOAT NOT NULL DEFAULT  '100';
Affected rows: 23935
Time: 0.050ms

Now I'm trying to compare the results of the new system to the old system, and maybe I don't understand the new system, but seems that some stuff didn't convert.

I'm not going to argue that the new loot system is broken. I'm sure it is working as intended. Its just the 5-6 years of custom content we have is not converting over properly, or at least it doesn't appear to.

The screenshot of the tables below is an example from our hohonora zone where players farm tokens to be turned in later for boss spawns. Originally each trash would have an 8 percent chance to drop 1 of 8 different tokens.

Now I understand the new loot system did away with the 'list' of items, but the new results now after conversion show the loot would drop either 0 or 1 of those 8 tokens, but when you step trying 20% chance, if fail then 15% chance, all the way down the list, that adds up to 100% chance (average) that a player would get 1 token.

So now instead of getting a token 8% of the time, its almost 100%, but more realistically players were reporting token drops about 8 of every 10 mobs (80% chance average getting tokens).

If my perception is wrong, then please correct me based on the screenshot provided below. I'm sure the new loot system is working as intended, and working better than the old system. I'm sure the conversion query is working as intended as well. Nothing seemed to break, but our loot tables don't seem to have drop rates as intended anymore.

Trying to give this update / loot system another shot, and not trying to stir up any pointless debates about 'fixing' the new loot system. Just want to be able to move forward with our custom loot drops as intended.

http://i45.tinypic.com/vg34gn.png

Secrets 12-15-2012 02:24 AM

You are dropping probability and then re-adding it. Meaning you have a 100% chance to get every single loot drop.

Simply do not run the last two queries:

Quote:

alter table loottable_entries drop `probability`;
Affected rows: 23935
Time: 0.040ms

[SQL] ALTER TABLE `loottable_entries` ADD `probability` FLOAT NOT NULL DEFAULT '100';
Affected rows: 23935
Time: 0.050ms
It's causing them to be fubared as a result.

edit: read cavedude's post. it will fix things!

cavedude 12-15-2012 02:27 AM

Restore your database from a backup (the old system) and run the following queries and ONLY the following queries on loot:

Code:

alter table loottable_entries add `droplimit` tinyint(2) unsigned NOT NULL default 0;
alter table loottable_entries add `mindrop` tinyint(2) unsigned NOT NULL default 0;
alter table lootdrop_entries change `chance` `chance` float not null default 1;
alter table lootdrop_entries add `multiplier` tinyint(2) unsigned NOT NULL default 1;
update loottable_entries set droplimit = 1 where probability != 100;
update loottable_entries set mindrop = multiplier, droplimit = multiplier, multiplier = 1 where probability = 100;

This will convert your tables to the new system, while keeping the old functionality. The problem was when I removed probability the conversion SQL was needed. Since it's added back, the only change needed is to set droplimit to 1 so that the tables will only drop 1 item at a time like in the old system. Multiplier ignores droplimit so that will still work as intended. Your chance and probability do not need to change at all (which is your issue in the example - your probability changed from 8% to 100%, but you didn't change chance to compensate.)

I'm going to go ahead and change the SQL on SVN to reflect this.

thepoetwarrior 12-15-2012 02:38 AM

Thanks you so much! Will give it a shot. Makes sense how the drop/add changed it all to 100%

As always, I back up the tables before doing any changes, so I can easily start over again to try.

thepoetwarrior 12-15-2012 01:09 PM

Quote:

Originally Posted by cavedude (Post 215260)
Restore your database from a backup (the old system) and run the following queries and ONLY the following queries on loot:

Code:

alter table loottable_entries add `droplimit` tinyint(2) unsigned NOT NULL default 0;
alter table loottable_entries add `mindrop` tinyint(2) unsigned NOT NULL default 0;
alter table lootdrop_entries change `chance` `chance` float not null default 1;
alter table lootdrop_entries add `multiplier` tinyint(2) unsigned NOT NULL default 1;
update loottable_entries set droplimit = 1;

This will convert your tables to the new system, while keeping the old functionality. The problem was when I removed probability the conversion SQL was needed. Since it's added back, the only change needed is to set droplimit to 1 so that the tables will only drop 1 item at a time like in the old system. Multiplier ignores droplimit so that will still work as intended. Your chance and probability do not need to change at all (which is your issue in the example - your probability changed from 8% to 100%, but you didn't change chance to compensate.)

I'm going to go ahead and change the SQL on SVN to reflect this.

On page 5 you posted this:

Code:

update loottable_entries set mindrop = multiplier, droplimit = multiplier, multiplier = 1 where probability = 100;
Which would probably be good to run after your new 5 lines in the loot change query?

Before in the old system it had always 5 gems drop out of a list of 11 gems, but after running the 5 line query there would only be about 1-5 gems, not always 5. This seems that it might fix it. Players will be testing it soon to verify.

On a good note, loots are not flooding the economy like before. Thanks for allowing to some what use the old system in the new systems structure.


All times are GMT -4. The time now is 12:17 AM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.