Go Back   EQEmulator Home > EQEmulator Forums > Archives > Archive::Development > Archive::Development

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

Reply
 
Thread Tools Display Modes
  #1  
Old 08-08-2004, 12:58 PM
govtcheeze
Hill Giant
 
Join Date: Mar 2004
Location: South Florida
Posts: 247
Default Items toward bottom of loot table not dropping fix

Edit: see posts below for full fix
__________________
GovtCheeze, Welfare Warrior
"Listen, here's the thing. If you can't spot the sucker in the first half hour at the table, then you ARE the sucker." -- Mike McDermott, Rounders

Developer of the original (circa 2004):
Loots v2.0, bitch!
Faction v1.0, bitch!
Magelo-like clone v0.3, bitch!
Zone geometry and spawn/path viewer, bitch!
Reply With Quote
  #2  
Old 08-08-2004, 04:00 PM
govtcheeze
Hill Giant
 
Join Date: Mar 2004
Location: South Florida
Posts: 247
Default

see diff file below
__________________
GovtCheeze, Welfare Warrior
"Listen, here's the thing. If you can't spot the sucker in the first half hour at the table, then you ARE the sucker." -- Mike McDermott, Rounders

Developer of the original (circa 2004):
Loots v2.0, bitch!
Faction v1.0, bitch!
Magelo-like clone v0.3, bitch!
Zone geometry and spawn/path viewer, bitch!
Reply With Quote
  #3  
Old 08-08-2004, 04:14 PM
killspree
Dragon
 
Join Date: Jun 2002
Posts: 776
Default

Nice work!
__________________
Xeldan
Lead Content Designer
Shards of Dalaya
Reply With Quote
  #4  
Old 08-09-2004, 02:23 AM
Doodman's Avatar
Doodman
Developer
 
Join Date: Aug 2003
Posts: 246
Default

I've not looked at nor played with the loot table code at all, so take this with that in mind.

Are common, rare and ultra rare loots in the same loot table? If so, then wouldn't the more common drops be at the begining of the table and favored like they were?

Perhaps there is a bug in there making the ultra-rare drops impossible to drop, but I just want to make sure that making this changes does not effect the drop rate of common vs rare.
Reply With Quote
  #5  
Old 08-09-2004, 02:29 AM
sotonin
Demi-God
 
Join Date: May 2004
Posts: 1,177
Default

No that's not why the system was made like this.

Each individual item has a chance value that is set. That is how you determine how rare or common an item is.

example:

the mob drops 5 items.

you want all items to drop fairly the same except for a rare item.

item1 = 24
item2 = 24
item3 = 24
item4 = 24
item5 = 4

This makes the first 4 items have a 24% chance to drop. the 5th item has a 4% chance to drop.

This is how it was clearly designed to work, but with the current system it does NOT work this way because of why govt explained. its looping through all items. Which is a terrible way to do this.

There is no common vs rare deciding factor except how you set the mob to be. if you open up a looteditor you'll see this. There are 2 values on the loottable for the mob.

Probabilty and Multiplier.

Probability is just how it sounds. if set at 25 the mob should drop an item 25% of the time. the other 75% drop nothing.

Multiplier is how many items the mob CAN drop, (when he does indeed drop something)

Then each individual item in the lootdrop entries has a chance associated with it. if there are 10 items you divide 100 by 10 and give each item 10% chance. Or modify it accordingly for rare drops.

The way it is now. Regardless of how many or few items you have. The first 2 items in the table are ALWAYS attained most of the time. (if multiplier is set at 2)

The system was designed to give the world builder flexibility in percentages to make things drop more common or more rare. but the system is throwing it out the windows by forcing all the items near the bottom of the table to be very rarely or never dropping, regardless of if you wanted all items to drop at the same ratio.
Reply With Quote
  #6  
Old 08-09-2004, 03:13 AM
govtcheeze
Hill Giant
 
Join Date: Mar 2004
Location: South Florida
Posts: 247
Default

Actually sotonin, I found out it does NOT roll a strict yes/no for "will something drop":

Code:
	for (int32 i=0; i<lts->NumEntries; i++) {
		for (int32 k = 1; k <= lts->Entries[i].multiplier; k++) {
			if ( (rand()%100) < lts->Entries[i].probability) {
				AddLootDropToNPC(npc,lts->Entries[i].lootdrop_id, itemlist);
For each item that can drop, if it passes the rand() test it will add an item to the mob (if it also passes the check for the item in addlootdropnpc). If the for and if statements were reversed, then it would be a strict yes/no for "will stuff drop".I know I said this doesn't happen when we talked about it, but I was looking at the wrong code

In the current system, using sotonin's example, item1 is ALWAYS tested to see if it drops, since it is first in the array. item4 is only tested if FOUR other tests fail...this is not truely random itemization. Now imagine this in a loot table with 80 items (which a lot of sebilis tables are)...items toward the bottom have a significant mathimatical disadvantage, since 70+ checks must fail before the item even has a chance...and then it still has to pass it's own rand() check.

This system keeps rare items rare, since the item must still pass the second, individual item chance test. The only difference is items near the beginning of the loottable are not more likely to drop.
__________________
GovtCheeze, Welfare Warrior
"Listen, here's the thing. If you can't spot the sucker in the first half hour at the table, then you ARE the sucker." -- Mike McDermott, Rounders

Developer of the original (circa 2004):
Loots v2.0, bitch!
Faction v1.0, bitch!
Magelo-like clone v0.3, bitch!
Zone geometry and spawn/path viewer, bitch!
Reply With Quote
  #7  
Old 08-09-2004, 03:25 AM
govtcheeze
Hill Giant
 
Join Date: Mar 2004
Location: South Florida
Posts: 247
Default

The only thing I worry about are loottables that are not set up correctly...where multiplier is greater than the total number of items in the table. This will cause found to never be set to 1, and cause an infinite loop.

I think this will fix it, but defintely needs some testing (currently at work, not able to test ATM):

In function
Code:
const LootTable_Struct* Database::GetLootTable(int32 loottable_id) {:
Code:
			loottable_array[loottable_id]->Entries[i].lootdrop_id = atoi(row[1]);
			loottable_array[loottable_id]->Entries[i].multiplier = atoi(row[2]);
			loottable_array[loottable_id]->Entries[i].probability = atoi(row[3]);

+			if(loottable_array[loottable_id]->Entries[i].multiplier > NumEntries);
+				loottable_array[loottable_id]->Entries[i].multiplier = NumEntries;

			i++;
		}
		mysql_free_result(result);
__________________
GovtCheeze, Welfare Warrior
"Listen, here's the thing. If you can't spot the sucker in the first half hour at the table, then you ARE the sucker." -- Mike McDermott, Rounders

Developer of the original (circa 2004):
Loots v2.0, bitch!
Faction v1.0, bitch!
Magelo-like clone v0.3, bitch!
Zone geometry and spawn/path viewer, bitch!
Reply With Quote
  #8  
Old 08-09-2004, 03:25 AM
Doodman's Avatar
Doodman
Developer
 
Join Date: Aug 2003
Posts: 246
Default

Okay, sounds good.

Like I said, never looked at the loot table stuff. Looks like a good fix.
Reply With Quote
  #9  
Old 08-22-2004, 02:16 AM
monalin crusader
Hill Giant
 
Join Date: May 2004
Posts: 238
Default

What lines are all these? I would love to impliment it but i dont know where.

*EDIT*

NM i found it its at 521 in loottable.cpp
Reply With Quote
  #10  
Old 08-22-2004, 12:10 PM
govtcheeze
Hill Giant
 
Join Date: Mar 2004
Location: South Florida
Posts: 247
Default

Has anyone had problems running this? I just got a report from PEQ that this was added (with other code updates) and it became unstable. If it was a piece of this code, would like to track down the problem and fix it
__________________
GovtCheeze, Welfare Warrior
"Listen, here's the thing. If you can't spot the sucker in the first half hour at the table, then you ARE the sucker." -- Mike McDermott, Rounders

Developer of the original (circa 2004):
Loots v2.0, bitch!
Faction v1.0, bitch!
Magelo-like clone v0.3, bitch!
Zone geometry and spawn/path viewer, bitch!
Reply With Quote
  #11  
Old 08-22-2004, 02:34 PM
cavedude's Avatar
cavedude
The PEQ Dude
 
Join Date: Apr 2003
Location: -
Posts: 1,988
Default

I know this doesn't help any, but I have been running this code for a bit with no problems and my compile isn't even close to stock CVS. Perhaps it was one of the other changes they made or possibly a clash between multiple changes.
Reply With Quote
  #12  
Old 08-23-2004, 02:58 AM
monalin crusader
Hill Giant
 
Join Date: May 2004
Posts: 238
Default

I dont know if this has anything to do with this but alot of times WHENEVER i compile something it becomes unstable i'm not sure why but if i compile source i just got it becomes unstabe but i also noticed my compiler is adding about .20mb of data withought changing the source. Part of the reason i think it does this for ME is because i'm using the Introductory Version of C++ 6.0 because it was the only thing i could afford.
Reply With Quote
  #13  
Old 08-23-2004, 11:06 AM
fathernitwit
Developer
 
Join Date: Jul 2004
Posts: 773
Default

hey,

I made a patch file out of this thread:
http://eqemu.psend.com/files/loottables_fix.diff
applies clean to 7-31-04 cvs.

it fixes a typo in the Database::GetLootTable mod as well.
Reply With Quote
  #14  
Old 08-24-2004, 03:00 AM
fathernitwit
Developer
 
Join Date: Jul 2004
Posts: 773
Default

In reply to myself...
I did some testing with the project eq folks, and foudn that the code in this thread has some major flaws. So I rewrote it a bit.

The patch linked in my previous post has been updated to a version which I believe works much better.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 03:19 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3