Go Back   EQEmulator Home > EQEmulator Forums > Support > Support::Windows Servers

Support::Windows Servers Support forum for Windows EQEMu users.

Reply
 
Thread Tools Display Modes
  #1  
Old 07-07-2010, 09:11 PM
Irreverent
The Solo Server
 
Join Date: May 2007
Posts: 416
Default Forage Issues

Example: In Firiona Vie, you only get the basic forages. (water/roots/berries/etc)

No one is getting the special forage like the Rose of Firiona.

I checked my table to make sure it isn't corrupted and has the rows. It does.

Not sure what is going on...any tips in researching this?
__________________
OP of Irreverent Server (The Solo Server)
Our Forums
Reply With Quote
  #2  
Old 07-07-2010, 09:16 PM
Irreverent
The Solo Server
 
Join Date: May 2007
Posts: 416
Default

ok researched a couple other issues with parchment/spell turn ins...the LAST one on the list of the random generator isn't getting rewarded on a list.

Was there a change to the way random numbers are generated? (in code or perl?)
__________________
OP of Irreverent Server (The Solo Server)
Our Forums
Reply With Quote
  #3  
Old 07-07-2010, 09:44 PM
Irreverent
The Solo Server
 
Join Date: May 2007
Posts: 416
Default

Found it! It was a change in the code!!

Just so many things started going wrong. Dyanmic/random mobs weren't working anymore...turnins that have an array, the last one wasn't being selected....

could this be it?

Code:
==06/22/2010==
gaeorn: replaced calls to rand() with calls to MakeRandomInt()
__________________
OP of Irreverent Server (The Solo Server)
Our Forums
Reply With Quote
  #4  
Old 07-08-2010, 12:47 PM
gaeorn
Developer
 
Join Date: Apr 2009
Location: USA
Posts: 478
Default

Quote:
Originally Posted by Irreverent View Post
Found it! It was a change in the code!!

Just so many things started going wrong. Dyanmic/random mobs weren't working anymore...turnins that have an array, the last one wasn't being selected....
Do you have evidence of the random mobs not working? From my experience, they do work as intended, but I'm happy to investigate a problem you are seeing if you have more specific information.

In regards to turnins, considering I can get ALL items from repeatedly doing a turnin that has an array of possible items, I'm quite certain that is not misbehaving as you say.

Foraging had some very strange logic in place that may have had a problem. I replaced that logic with more tried and true logic found elsewhere in the code to select an item from a list based on its chance to be selected.
Reply With Quote
  #5  
Old 07-08-2010, 01:01 PM
Irreverent
The Solo Server
 
Join Date: May 2007
Posts: 416
Default

Sure, no problem!

I used this code:

Code:
sub EVENT_SAY {  
	if($text=~/Hail/i) {quest::say("Hi");  }  

	if($text=~/Test/i) 
	{
	    	quest::say(quest::ChooseRandom(1,2,3,4,5));
	    	quest::say(quest::ChooseRandom(1,2,3,4,5));
	    	quest::say(quest::ChooseRandom(1,2,3,4,5));
	    	quest::say(quest::ChooseRandom(1,2,3,4,5));
	    	quest::say(quest::ChooseRandom(1,2,3,4,5));
	    	quest::say(quest::ChooseRandom(1,2,3,4,5));
	    	quest::say(quest::ChooseRandom(1,2,3,4,5));
	    	quest::say(quest::ChooseRandom(1,2,3,4,5));
	    	quest::say(quest::ChooseRandom(1,2,3,4,5));
	    	quest::say(quest::ChooseRandom(1,2,3,4,5));
	    	quest::say(quest::ChooseRandom(1,2,3,4,5));
	    	quest::say(quest::ChooseRandom(1,2,3,4,5));
	    	quest::say(quest::ChooseRandom(1,2,3,4,5));
	    	quest::say(quest::ChooseRandom(1,2,3,4,5));

	}  
}
And got these results:
__________________
OP of Irreverent Server (The Solo Server)
Our Forums
Reply With Quote
  #6  
Old 07-08-2010, 01:06 PM
joligario's Avatar
joligario
Developer
 
Join Date: Mar 2003
Posts: 1,490
Default

Are you sure you are using the latest? We had this issue resolved I believe.
Reply With Quote
  #7  
Old 07-08-2010, 01:08 PM
Irreverent
The Solo Server
 
Join Date: May 2007
Posts: 416
Default

Yup, using the one that is a binary off the compiled link. 1535.
__________________
OP of Irreverent Server (The Solo Server)
Our Forums
Reply With Quote
  #8  
Old 07-08-2010, 01:08 PM
gaeorn
Developer
 
Join Date: Apr 2009
Location: USA
Posts: 478
Default

Yes, what revision are you running that on? Because all evidence is that it works properly in my testing on PEQ.
Reply With Quote
  #9  
Old 07-08-2010, 01:09 PM
Irreverent
The Solo Server
 
Join Date: May 2007
Posts: 416
Default

I'm using the 1535 binaries posted. I'm sure PEQ compiles their own...perhaps they were compiled differently?
__________________
OP of Irreverent Server (The Solo Server)
Our Forums
Reply With Quote
  #10  
Old 07-08-2010, 01:10 PM
gaeorn
Developer
 
Join Date: Apr 2009
Location: USA
Posts: 478
Default

Quote:
Originally Posted by Irreverent View Post
Yup, using the one that is a binary off the compiled link. 1535.
That is the latest precompiled version. That is not the latest. The latest is revision 1586.

The problem you are experiencing was resolved in revision 1547.
Reply With Quote
  #11  
Old 07-08-2010, 01:12 PM
Irreverent
The Solo Server
 
Join Date: May 2007
Posts: 416
Default

Makes sense...can someone repost the windows binaries then...Please!
__________________
OP of Irreverent Server (The Solo Server)
Our Forums
Reply With Quote
  #12  
Old 07-08-2010, 04:17 PM
Caryatis
Dragon
 
Join Date: May 2009
Location: Milky Way
Posts: 541
Default

No time like the present
Reply With Quote
  #13  
Old 07-15-2010, 11:06 AM
Irreverent
The Solo Server
 
Join Date: May 2007
Posts: 416
Default

Well, FV now produces rares.

BUT for some reason Misty thicket, PoJ, and other zones are no longer producing rare forages. Any other 1590+ people having this problem? Can you test? I just have an active population, so this is a bug that it causing a lot of stops on TS/Epics.
__________________
OP of Irreverent Server (The Solo Server)
Our Forums
Reply With Quote
  #14  
Old 07-18-2010, 10:48 AM
Irreverent
The Solo Server
 
Join Date: May 2007
Posts: 416
Default

ok, I think I found the issue...now need a *real* coder than myself.

I put the following lines to show the results in the log. So either if you have multiple forages their sum must be = 100, or the code isn't working as intended....but then again I'm not a C++ guy. in the forage table for zone 33 there are 3 items with 100% chance within them

Added code:
Code:
if (RunQuery(query, MakeAnyLenString(&query, "SELECT itemid,chance FROM forage WHERE zoneid= '%i' and level <= '%i'", ZoneID, skill), errbuf, &result))
	{
		safe_delete_array(query);
		while ((row = mysql_fetch_row(result)) && (index < FORAGE_ITEM_LIMIT)) 	{
			item[index] = atoi(row[0]);
			chance[index] = atoi(row[1])+chancepool;
			LogFile->write(EQEMuLog::Commands, "Possible Forage: %d with a %d chance", item[index], chance[index]);
			chancepool = chance[index];
			index++;
		}
and

Code:
	if (MakeRandomInt(0,199) < skill_level) {
		uint32 foragedfood = 0;
		int32 stringid = FORAGE_NOEAT;
		
		if (MakeRandomInt(0,99) <= 25) {
			LogFile->write(EQEMuLog::Commands, "Requesting Forage from zone: %d with a %d skill", m_pp.zone_id, skill_level);
			foragedfood = database.GetZoneForage(m_pp.zone_id, skill_level);
			LogFile->write(EQEMuLog::Commands, "Returned item: %d from zone %d chance", foragedfood, m_pp.zone_id);
		}
RESULT:
Code:
[07.18. - 10:36:40] Starting Log: logs/eqemu_commands_zone_4288.log
[07.18. - 10:36:40] Requesting Forage from zone: 33 with a 255 skill
[07.18. - 10:36:40] Possible Forage: 14933 with a 100 chance
[07.18. - 10:36:40] Possible Forage: 16496 with a 200 chance
[07.18. - 10:36:40] Possible Forage: 20465 with a 44 chance
[07.18. - 10:36:40] Returned item: 14933 from zone 33 chance
[07.18. - 10:43:33] Requesting Forage from zone: 33 with a 173 skill
[07.18. - 10:43:33] Possible Forage: 14933 with a 100 chance
[07.18. - 10:43:33] Possible Forage: 16496 with a 200 chance
[07.18. - 10:43:33] Possible Forage: 20465 with a 44 chance
[07.18. - 10:43:33] Returned item: 14933 from zone 33 chance
[07.18. - 10:45:15] Requesting Forage from zone: 33 with a 173 skill
[07.18. - 10:45:15] Possible Forage: 14933 with a 100 chance
[07.18. - 10:45:15] Possible Forage: 16496 with a 200 chance
[07.18. - 10:45:15] Possible Forage: 20465 with a 44 chance
[07.18. - 10:45:15] Returned item: 14933 from zone 33 chance
what is weird is where it selects what is returned:
Code:
	rindex = MakeRandomInt(1, chancepool);
	for(int i = 0; i < index; i++) {
		if(rindex <= chance[i]) {
			ret = item[i];
			break;
		}
	}
	
	return ret;
Again, not a coder...but it always just allows "black root" to be the foraged rare of the 3 available...log never changes and players never get anything else but commons
__________________
OP of Irreverent Server (The Solo Server)
Our Forums
Reply With Quote
  #15  
Old 07-19-2010, 11:01 AM
gaeorn
Developer
 
Join Date: Apr 2009
Location: USA
Posts: 478
Default

The problem is because chance[] was an int8, making it's upper limit be 255. Since the pool you are pulling from has three items at 100 chance each, that meant it was trying to set the value to 300, but when you hit 256 it would change to 0. So setting it to 300 made a resultant value of 44.

It does not matter what the sum of the chances are. Only the relative values matter. And chance[index] is going to be the current item chance plus all prior item chances. It is required for the item select code to work properly. Just because the first item will show a 100 chance and the second item will show a 200 chance, it does not mean the second item has twice the chance of being foraged. It just means that when we generate the random number, any values less than or equal to 200 *might* be the second item, but since we check for the first item before the second and any value less than or equal to 100 will return the first, that means the actual range of values that would return the second item is 101-200.
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 01:58 AM.


 

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