Navy points Algorithm

Post bug reports here.

Moderator: Moderators

Navy points Algorithm

Postby x0o » Sat Jul 24, 2010 9:32 pm

400*rank + 2*sqrt(xp) + 2*sqrt(gold/5) + 6*crewpoints + sqrt(totshipstrength/10)

I do not now how the algorithm is written in the scripts at the moment. But I do believe there to be a bug when you got 0 ships (after loosing a fleet for example). What this does is that you get 0 points in navy rank total until you got a ship.

I tried this one out over several ticks by building ships and then selling it before the tick ended. This does that the algorithm tries to divide 0 (totshipstrength) by 10. Am I correct in that assumption? PHP would then throw an error cause you can't divide by zero. When this happen the script should fail right?

Or am I totally wrong in my thoughts here? Is there a catch on totshipstrenght != 0?
x0o
Member
 
Posts: 55
Joined: Wed May 20, 2009 1:13 am

Re: Navy points Algorithm

Postby Twisted » Sun Jul 25, 2010 9:59 am

It doesn't divide by zero, it tries to divide zero.
User avatar
Twisted
Hero
 
Posts: 4083
Joined: Mon Aug 22, 2005 7:12 pm
Location: Belgium

Re: Navy points Algorithm

Postby x0o » Sun Jul 25, 2010 3:40 pm

Ofc it can't divide by zero. But you get my point don't you?
x0o
Member
 
Posts: 55
Joined: Wed May 20, 2009 1:13 am

Re: Navy points Algorithm

Postby Twisted » Sun Jul 25, 2010 6:28 pm

No I don't see your point.

If you don't have any ships, the last part of the formula will be zero: sqrt(0/10) = 0. Now if the formula said srt(10/totalshipstrenght) you'd have a problem if you didn't have any ships. Now you just don't have any points for not having any ships.
User avatar
Twisted
Hero
 
Posts: 4083
Joined: Mon Aug 22, 2005 7:12 pm
Location: Belgium

Re: Navy points Algorithm

Postby x0o » Sun Jul 25, 2010 7:59 pm

The formula should still give points related to gold and xp. In this case after having 0 ships you get 0points total in navy rank. Which is not correct, right?
x0o
Member
 
Posts: 55
Joined: Wed May 20, 2009 1:13 am

Re: Navy points Algorithm

Postby Twisted » Sun Jul 25, 2010 9:50 pm

Well according to the formula it isn't. But the reason is not in the "dividing by zero" as you state. There is no dividing by zero in this formula.
User avatar
Twisted
Hero
 
Posts: 4083
Joined: Mon Aug 22, 2005 7:12 pm
Location: Belgium

Re: Navy points Algorithm

Postby x0o » Sun Jul 25, 2010 10:06 pm

Got me there, I was thinking wrong. But it's still a mishap that you get 0points total with no ships.
x0o
Member
 
Posts: 55
Joined: Wed May 20, 2009 1:13 am

Re: Navy points Algorithm

Postby Zalastra » Mon Jul 26, 2010 11:03 am

That's never the case though? Just look at the lowest ranked navy players: 600 points. That's what you start with, exactly according to the formula.
Zalastra
Forum Admin & Game Mod
 
Posts: 1555
Joined: Mon Aug 22, 2005 6:18 pm

Re: Navy points Algorithm

Postby x0o » Mon Jul 26, 2010 12:59 pm

In this case it's about already established players. For example after you lose all your ships, alternatively sell them. There's plenty of players who can testify that you get 0 points after that.
x0o
Member
 
Posts: 55
Joined: Wed May 20, 2009 1:13 am

Re: Navy points Algorithm

Postby b24019 » Mon Jul 26, 2010 2:55 pm

ive never seen people in the ranking with 0 points, what i do see alot is that if u refresh navy exactly at tic it shows 0 points, whether u sold or bought ships or whatever. that suggests to me that it takes a few seconds to calculate your rankingpoints, position in ranks etc. maybe thats why it showed 0 to u as well? or did u stay at 0 for an entire tic?
b24019
Veteran Member
 
Posts: 315
Joined: Fri Jan 06, 2006 10:08 pm

Re: Navy points Algorithm

Postby x0o » Mon Jul 26, 2010 5:28 pm

Stayed at 0 points over ticks. Ordered a schooner, it was ready at the tick still 0 points. Sold it before the tick ended and built a new one, still 0 points. Same procedure 1 more tick with same results. After keeping the schooner over 1 tick I got back my points =P
x0o
Member
 
Posts: 55
Joined: Wed May 20, 2009 1:13 am


Return to KnC Bug Reports

Who is online

Users browsing this forum: No registered users and 1 guest