Forum - Space Odyssey MMORPG - a massive free online space game
May 18, 2024, 02:07:48 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: New game Astro Galaxy launched by ET Virtual Worlds, http://www.astro-galaxy.com
 
   Home   Help Search Members Login Register  
Pages: [1]
  Send this topic  |  Print  
Author Topic: Stash interest rate incorrect?  (Read 1530 times)
ahydra
Private First Class
*

Reputation: +2/-3
Offline Offline

Posts: 34


View Profile
« on: March 03, 2009, 11:21:36 PM »

This is my stash screen atm:

344.676.773
Interest Rate: 0.02%

but the text underneath says 0.01% for every 100M, so it should be 0.03%. In fact up to today it's been working fine (rounding appropriately) but for some reason it now seems to have frozen at 0.02%.

ahydra

edit: it's now 399.991.787 and showing 0.04% (correct). Not sure what's happening confused
edit2: I donated, got a bunch of credits and it's gone wrong again.
12.302.110.395
Interest Rate: 1.22% (should be 1.23%)

Looks suspiciously like floating point rounding problems - suggest using a 64-bit integer type for the stash credits (and regular credits etc) and then dividing this down to 100x the interest rate first, then converting to a float, rounding and dividing by 100.
« Last Edit: March 08, 2009, 09:22:06 PM by ahydra » Report to moderator   Logged
KenquinnTheInsaneOne
Master Sergeant
*

Reputation: +61/-63
Offline Offline

Posts: 930


View Profile
« Reply #1 on: March 19, 2009, 10:55:26 PM »

First things first the game is written in Java not C++ nearly every browser based game is written in java or javascrpit and not c++ due to how easily java can be hooked in to websites.

I know Emi uses BigINTs and BigDecimals most variables in SpaceO there is no upper limit on the value for either type. Well there is a limit dependent on his ram its just to large to be considered a worry.

Also the interest rates can take a bit to update.

Your example of 12.302.110.395 credits only giving 1.22% interest would be a case of this.

Also just because that value is displaced does not mean you do not get 1.23% in reality its just a value displayed. What happen under the abstraction of the UI cant be said for sure.

There are many other little issue in the game like it Displaying SP/AP as a ship stat when they are not in use. Various spelling issues and typos are also rampant in SpaceO.
« Last Edit: March 19, 2009, 10:57:24 PM by Kenquinn » Report to moderator   Logged
Pages: [1]
  Send this topic  |  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!