Exp in INT? too small...

All Helbreath Server Source Discussion here.
Post Reply
wannabee
Loyal fan
Posts: 270
Joined: Sun Dec 21, 2003 12:42 am

Post by wannabee »

ok, exp is stored in INT's (those fools...) thats why it goes negative whenever it gets too much for it (can't go over lvl 390+ i think). I've tryed using 'unsigned __INT64' it didn't work to well (lvling up to like 1800+).

so who feels like there up to the job in making a int sorting method that:
a ) breaks up the int and stors in chr form
b ) stors the exp strait to the file or temp file (this may slow down hgservers a bit)
or
c ) something i havn't thought of...

<_< have fun?
<!--QuoteBegin--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> </td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->Human knowleag belongs to THE WORLD<!--QuoteEnd--></td></tr></table><div class='signature'><!--QuoteEEnd--><br>So i highly dislike people who keep to their proud selfs... thats why i wanna share everything i got with you guys :D
Ice-T
Loyal fan
Posts: 262
Joined: Sat Oct 18, 2003 8:51 am
Location: nowere

Post by Ice-T »

an interger can store numbers up to 64k 6500 sumthing~~

the problem is not here, its in the exp calculation to be more exact

m_pClientList[iClientH]->m_iNextLevelExp
and
m_pClientList[iClientH]->m_iExp

the maximum number they can sucsessfully calculate is arount 1.5 billion - 2 billion the higher the number the less acurate the calculation
<img src='http://www.prism.gatech.edu/~gtg818f/basesig.gif' border='0' alt='user posted image' /><br><img src='http://img228.imageshack.us/img228/439/steam1tf.gif' border='0' alt='user posted image' />
Ice-T
Loyal fan
Posts: 262
Joined: Sat Oct 18, 2003 8:51 am
Location: nowere

Post by Ice-T »

ah i know why its fucking up,
the calculation of nextlevel exp after level 391 has a recuring number = negitive exp
<img src='http://www.prism.gatech.edu/~gtg818f/basesig.gif' border='0' alt='user posted image' /><br><img src='http://img228.imageshack.us/img228/439/steam1tf.gif' border='0' alt='user posted image' />
smalls1281
just visiting
Posts: 2
Joined: Sun Feb 20, 2005 12:12 am

Post by smalls1281 »

>.>

its because most things can only count up to 7FFFFFFF in hex, or apx. 1.8 billion... after that, it will either go into denial, and say NaN, or it will go negative... here it goes negative... simple solution: cut all exp needed down by a digit or 2, and it should work (you will prolly have to change exp rates after doing so)
marburg
just visiting
Posts: 4
Joined: Wed Feb 23, 2005 8:58 am

Post by marburg »

for your info:

We did this (divide all exp by 100) and it works fine up til lvl 1318 now.
DMZ2
noob
Posts: 21
Joined: Sun Jan 16, 2005 10:06 am

Post by DMZ2 »

in doing that wouldnt you need to devide the exp in the npc file by 100 also? if so did it work to the same ammount of time to level as it previously did?
Post Reply