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 12-02-2003, 04:51 AM
Scorpious2k's Avatar
Scorpious2k
Demi-God
 
Join Date: Mar 2003
Location: USA
Posts: 1,067
Default MOBs and Minor typo

In mob.cpp Mob::CalculateDistance it reads:

Code:
    return (float)sqrt( ((x_pos-x)*(x_pos-x)) + ((y_pos-x)*(y_pos-x)) + ((z_pos-z)*(z_pos-z)) );
and should be... (notice the y calc)

Code:
    return (float)sqrt( ((x_pos-x)*(x_pos-x)) + ((y_pos-y)*(y_pos-y)) + ((z_pos-z)*(z_pos-z)) );
Among other things it might explain the vanishing mobs.
__________________
Maybe I should try making one of these servers...
Reply With Quote
  #2  
Old 12-02-2003, 05:37 AM
Edgar1898
Senior Member
Former EQEmu Developer
Current EQ2Emu Lead Developer
 
Join Date: Dec 2002
Posts: 1,065
Default

good catch! I'll fix that tonight
__________________
Lethal Encounter
Reply With Quote
  #3  
Old 12-02-2003, 07:59 AM
Scorpious2k's Avatar
Scorpious2k
Demi-God
 
Join Date: Mar 2003
Location: USA
Posts: 1,067
Default

Quote:
Originally Posted by Edgar1898
good catch! I'll fix that tonight
Thanks.

To be honest, I was in the process of replacing it with some expiremental code when I noticed it...

expiremental code:
Code:
	float xDiff=(x_pos-x);
	float yDiff=(y_pos-y);
	float zDiff=(z_pos-z);
	
	float calctemp;
	float calcdist;

	__asm 
	{
		fld		xDiff
		fmul	xDiff
		fst		calctemp
		fld		yDiff
		fmul	yDiff
		fadd	calctemp
		fst		calctemp
		fld		zDiff
		fmul	zDiff
		fadd	calctemp
		fsqrt
		fst		calcdist
	}
	return calcdist;
So far, it seems to work correctly.
__________________
Maybe I should try making one of these servers...
Reply With Quote
  #4  
Old 12-02-2003, 10:25 AM
Trumpcard
Demi-God
 
Join Date: Jan 2002
Location: Charlotte, NC
Posts: 2,614
Default

That was probably my mistake when I was refactoring the DIST calculations.. Doh! Classic cut and paste error!

Good catch and thanks!

Scorp, I tried to use the inline asm, but the implementation doesnt work well with gcc/gas. I'll see if I can convert it over, but I stopped worrying about it when I eliminated 99.99% of the dist calls in the 1st place... (did a precheck before calling the dist function so its only called when its needed) At this point, converting it too assembly might be an overcomplication with minimal performance gains, not that I dont appreciate the work necessary to generate it.
__________________
Quitters never win, and winners never quit, but those who never win and never quit are idiots.
Reply With Quote
  #5  
Old 12-02-2003, 10:52 AM
Scorpious2k's Avatar
Scorpious2k
Demi-God
 
Join Date: Mar 2003
Location: USA
Posts: 1,067
Default

Quote:
Originally Posted by Trumpcard
That was probably my mistake when I was refactoring the DIST calculations.. Doh! Classic cut and paste error!
And I thought I was the only one who did that... note to self: cancel patent search on cut & paste errors.

Quote:
I tried to use the inline asm, but the implementation doesnt work well with gcc/gas.
Compatability. A very good reason to keep it out.

Quote:
stopped worrying about it when I eliminated 99.99% of the dist calls in the 1st place... (did a precheck before calling the dist function so its only called when its needed)
I saw that. A brilliant move.

Quote:
At this point, converting it too assembly might be an overcomplication with minimal performance gains, not that I dont appreciate the work necessary to generate it.
It really wasn't much work.

There are some people who might 1) do it just to prove to himself that it works and 2) think cutting clock cycles with ingenuity is actually fun.

The fifth amendment gives me the right to not mention the name of one of these people.
__________________
Maybe I should try making one of these servers...
Reply With Quote
  #6  
Old 12-02-2003, 12:04 PM
Trumpcard
Demi-God
 
Join Date: Jan 2002
Location: Charlotte, NC
Posts: 2,614
Default

I'm all for performance/process improvement (look up 6 sigma blackbelts if you get the chance..lol... Thats a big part of what i do).. If I can test the compile of it on VS.net (I've only got 6) , we can put the inline assembly in an #ifdef WIN32 , clause until i can work out the gas implementation...
__________________
Quitters never win, and winners never quit, but those who never win and never quit are idiots.
Reply With Quote
  #7  
Old 12-03-2003, 05:37 AM
bobzub
Sarnak
 
Join Date: Dec 2002
Posts: 31
Default

I just wanted to mention that I did not find the line Scorp listed above,
in mob.cpp. I found it in MobAI.cpp.

-bobzub
Reply With Quote
  #8  
Old 12-03-2003, 06:06 AM
Eglin
Hill Giant
 
Join Date: Nov 2003
Posts: 168
Default

Quote:
Originally Posted by Trumpcard
look up 6 sigma blackbelts if you get the chance..lol... Thats a big part of what i do
ack! I feel your pain, man. Looked it up out of curiousity, and everthing from the intro on made me feel sick.
Quote:
Originally Posted by From the Six Sigma Source website
The 6 Sigma Black Belt is a team leader, a project coordinator, and a mentor. She identifies trends that may be causing defects, and pursues perfection. Her training results is higher profitability and lower costs for the entire organization.
I'm not a sexist, but I sure as hell wouldn't bring the authors of this statement in to train my QA team. She and Her? You know, I'm looking at that and wondering what the hell they were thinknig. Then again, QA people always do manage to get under my skin somehow ;)
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 06:31 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 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3