Jump to content

efficiency not shown when buying troops from 0


iMatt

Recommended Posts

When I'm at 0 soldiers and I try to buy, say 100 soldiers, it says this:

This transaction will purchase 100 soldiers for a total price of $733.81. Based on this transaction you will have a real military of 100 soldiers with an efficiency of 100 and 0 (0) deployed soldiers.

It doesn't show the right efficiency number, it doesn't multiply the 100 by my GCs and Barracks increases.

I'm fairly certain it's something to do with buying soldiers from *zero*, because I've had others test it and it shows the right efficiency numbers. I have 5 GCs and 5 Barracks.

Edited by imatt15
Link to comment
Share on other sites

When you have zero soldiers the game doesn't know what your efficiency will be because of a division by zero issue. I'm thinking on a way to correct this but it will be tricky.

*admin goes off to think some more.

Link to comment
Share on other sites

If there's a formula to calculate the efficiency based on your current amount of soldiers and your efficiency multiplier, can't you use it on the purchase screen? If you're currently predicting the future efficiency on the purchase screen by dividing the current soldier efficiency by the current soldier count, I wonder what would happen if you had very few soldiers and tried to buy more. I think the prediction shown might be inaccurate if you use the integer value of soldier efficiency, because 4.4 turns into 4, so if you had 1 (4) soldier and tried to purchase 1000 more, it would predict an efficiency of 4004 even though your efficiency multiplier is 4.4. Or maybe you do use a double value of the current efficiency level to predict the new one. Either way it's kind of a weird way to do it, might as well use the formula that's used in calculating your real efficiency level when you actually press the purchase button. If it slows down the game, you could store a three-decimal "efficiency multiplier" number for every nation, that is shown on the purchase screen. That way you only have to send that number along instead of fetching all the improvement/trade data to calculate the multiplier every time someone visits the soldier purchase screen.

You could just remove "with an efficiency of..." when buying from 0 if you really wanted.

I'd say it's especially important to include it when you have 0 soldiers, because that's the only time you can't guess your new efficiency unless you manually add up all your efficiency bonuses.

Edited by Viluin
Link to comment
Share on other sites

Calculating efficiency should be an easy matter:

Currently if I want to calculate someone's efficiency I use this:

Efficiency=floor(Soldiers*GovSol*IF(Alu=1,1.2,1)*IF(Coal=1,1.08,1)*IF(Oil=1,1.1,

1)*IF(Pigs=1,1.15,1)*(1+IF(GC>=0,IF(GC<=5,GC*0.35,5*0.35),0))*(1+IF(Barracks>=0,IF(Barracks<=5,Barracks*0.1,5*0.1),0)),0)

to modify this for the purchase screen all one needs to do is:

Soldier Purchase Efficiency=floor(Soldiers Being Bought*GovSol*IF(Alu=1,1.2,1)*IF(Coal=1,1.08,1)*IF(Oil=1,1.1,1)*IF(Pigs=1,1.15,1

)*(1+IF(GC>=0,IF(GC<=5,GC*0.35,5*0.35),0))*(1+IF(Barracks>=0,IF(Barracks<=5,Barracks*0.1,5*0.1),0)),0)

Link to comment
Share on other sites

When you have zero soldiers the game doesn't know what your efficiency will be because of a division by zero issue. I'm thinking on a way to correct this but it will be tricky.

*admin goes off to think some more.

nooo dont divide by 0 D: you'll tear a whole in the fabric of time and the universe will implode :o

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...