Forum - Space Odyssey MMORPG - a massive free online space game
May 04, 2024, 10:39:02 AM *
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: Replication not giving out all the minerals it should!  (Read 3207 times)
ahydra
Private First Class
*

Reputation: +2/-3
Offline Offline

Posts: 34


View Profile
« on: March 29, 2009, 01:41:28 PM »

Yet another bug - quite major this time 10

I've been replicating some diamond, but it hasn't given me everything it should. I first noticed this when I tried to do diamond->carbon and it should have given me 31256 but gave me about 30000. Next I did diamond->gold and got 2600 or so instead of the 3126 I should have; then finally (I took screenshots of this one) diamond->ice which gave only 4251 instead of 5001. In each case I put 1275 diamond in to start with as it says "replication is 1275 diamond into..."

I have 5 replication output modules and 3 replication input modules. Hence I should get a 25% bonus to output, and the input should be 1275 (100-15% = 85% of 1500 which seems to be the default without any modules)

I think the code for replication output may be missing the input module adjustment - if you take the amount I should be getting and multiply by 0.85, it gives the amount I got in each case. This is because it looks for 1500 resources instead of 1275. (I'll do a test in a minute, putting in 1500. I imagine I'll get the right amount of output but it will only take 1275. I'll edit the post to confirm what happens)

EDIT: Yes that's what happened. 1500 diamond -> 5001 ice and 225 spare diamond. So it seems at the moment you have code like (sorry it's C-style but I think Java is similar):

Code:
in_resource_qty = replication_production * 5 * (1-0.05*replication_input_modules); // what happens if you have 20 modules?
out_resource_qty = replication_production * 5 * (1+0.05*replication_output_modules) * (reptable[in_resource] / reptable[out_resource);

if (mining_facility.resources[in_resource] < 1500) // this may in fact say (5 * replication_production), I haven't tested it enough to be sure)
{
  out_resource_qty *= (mining_facility.resources[in_resource] / 1500); // same here
  // see * below, there is a line missing here!
}

mining_facility.add_resource(in_resource, -in_resource_qty);
mining_facility.add_resource(out_resource, out_resource_qty);

You need to change the 1500's in the if block to in_resource_qty's and add a line as follows:

Code:
if (mining_facility.resources[in_resource] < in_resource_qty)
{
  out_resource_qty *= (mining_facility.resources[in_resource] / in_resource_qty]);
  in_resource_qty = mining_facility.resources[in_resource]; // you need to add this to prevent negative resource amounts appearing
}

*: There's another bug here. If you put 1 diamond in it will produce 1 ice but leave you with -1274 diamond... You can counter this with yet another bug 13 if you have negative of a resource, select that resource, type a number into the box and click "Withdraw", it resets to zero!

Please fix this ASAP. With this bug in place, for any replication under 1500 resources you get penalised for no reason and your input modules become effectively useless.

ahydra

ps. I'm not worried about a refund of the 750 missing ice. I can nick that from the unfortunate guy next door. ^^

pps. Small typo - it should say "replication for this structure successfully chanGed", not "chanced".
« Last Edit: March 29, 2009, 02:39:45 PM by ahydra » Report to moderator   Logged
whitelightercarl
Corporal
*

Reputation: +44/-4
Offline Offline

Posts: 116


View Profile
« Reply #1 on: March 29, 2009, 07:08:42 PM »

 wow Can't say anything
Report to moderator   Logged

jessiedog
Master Sergeant
*

Reputation: +126/-32
Offline Offline

Posts: 872


View Profile
« Reply #2 on: March 29, 2009, 08:53:52 PM »

or just put 1500 diamond in... its not a big deal
Report to moderator   Logged

And thus I clothe my naked villainy
With old odd ends, stol'n forth of holy writ;
And seem a saint, when most I play the devil.
ahydra
Private First Class
*

Reputation: +2/-3
Offline Offline

Posts: 34


View Profile
« Reply #3 on: March 30, 2009, 05:46:32 AM »

or just put 1500 diamond in... its not a big deal

Better that the game works as expected, right? 10 At the moment I am ensuring I put 1500 in at a time but when the game gets to the stage where minerals have to be mined from planets not from space, every mineral will count..
Report to moderator   Logged
jessiedog
Master Sergeant
*

Reputation: +126/-32
Offline Offline

Posts: 872


View Profile
« Reply #4 on: March 30, 2009, 06:02:18 PM »

actually it works fine the way it is.

originally to use full replication (100%) you have to have what? 2500 diamond there? for one hours use. so really that is what you should need.
Report to moderator   Logged

And thus I clothe my naked villainy
With old odd ends, stol'n forth of holy writ;
And seem a saint, when most I play the devil.
ahydra
Private First Class
*

Reputation: +2/-3
Offline Offline

Posts: 34


View Profile
« Reply #5 on: March 31, 2009, 09:05:41 AM »

no, 1500

but the point of input modules is to reduce the amount needed 1

ahydra
Report to moderator   Logged
SirEmi
Administrator
First Sergeant
*

Reputation: +192/-122
Offline Offline

Posts: 1655



View Profile WWW
« Reply #6 on: March 31, 2009, 02:49:43 PM »

That's some good info there. I should be able to track the bug and fix it asap.

Thank you.
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!