User Name
Password

Go Back   Planetarion Forums > Planetarion Related Forums > Planetarion Discussions

Reply
Thread Tools Display Modes
Unread 22 Sep 2008, 01:53   #1
MrLobster
Commander in Briefs!
 
MrLobster's Avatar
 
Join Date: Dec 2000
Location: UK
Posts: 783
MrLobster has much to be proud ofMrLobster has much to be proud ofMrLobster has much to be proud ofMrLobster has much to be proud ofMrLobster has much to be proud ofMrLobster has much to be proud ofMrLobster has much to be proud ofMrLobster has much to be proud ofMrLobster has much to be proud of
Production Formulas

Now this is more of a help me i'm stuck question so this forum seemed more apt.

Could anyone help with the production formulas and produce a working line of code thats in either C++ or Delphi.

PU = (total_resources_spent^1/2)*LN(total_resources_spent^2)

PU Output = int(((4000 * # factories)^0.98) * (1 + (pop_bonus + gov_bonus + race_bonus) / 100))

Its just the ^ thats causing the problem, I know its to the "power of" but cant for the life of me figure out a way a programming language would calc it.
__________________
<Kila> WHAT HAVE YOU DONE WITH MY PRECIOUS FORUMS
<Zeyi> 24h forum closure
<Zeyi> all posts recalled

"he's got a proven track record when it comes to showy art composition" - Tommy

<Sigi> Light: can I ask u how many open internet-windows u always have?
<MrLobster|PM> i have 2, the pa page, and the website for naked light pictures
<Ave> both has bad gfx
MrLobster is offline   Reply With Quote
Unread 22 Sep 2008, 02:42   #2
Cincinnatus
PA Team
 
Cincinnatus's Avatar
 
Join Date: Apr 2004
Posts: 1,874
Cincinnatus has much to be proud ofCincinnatus has much to be proud ofCincinnatus has much to be proud ofCincinnatus has much to be proud ofCincinnatus has much to be proud ofCincinnatus has much to be proud ofCincinnatus has much to be proud ofCincinnatus has much to be proud ofCincinnatus has much to be proud of
Re: Production Formulas

believe c and probably c++ as well has a function called pow.
say if you want 4^2, it be pow(4,2)
__________________
Requested: 1,000 kilometres of fulcrum cable, 1 Mark 5 ECM unit, one low yield nuclear weapon.
Purpose: Surprise party for foreign dignitary
Support Team - #support
MultiHunter Team -#multihunters
Cincinnatus is offline   Reply With Quote
Unread 22 Sep 2008, 03:06   #3
MrLobster
Commander in Briefs!
 
MrLobster's Avatar
 
Join Date: Dec 2000
Location: UK
Posts: 783
MrLobster has much to be proud ofMrLobster has much to be proud ofMrLobster has much to be proud ofMrLobster has much to be proud ofMrLobster has much to be proud ofMrLobster has much to be proud ofMrLobster has much to be proud ofMrLobster has much to be proud ofMrLobster has much to be proud of
Re: Production Formulas

Quote:
Originally Posted by Cincinnatus View Post
believe c and probably c++ as well has a function called pow.
say if you want 4^2, it be pow(4,2)
Yep found that out by looking at some java script and then found the function in delphi.

floor( power( (4000 * 1), 0.98) * (1 + (BonusPU + Population.BonusPU)/100) )
__________________
<Kila> WHAT HAVE YOU DONE WITH MY PRECIOUS FORUMS
<Zeyi> 24h forum closure
<Zeyi> all posts recalled

"he's got a proven track record when it comes to showy art composition" - Tommy

<Sigi> Light: can I ask u how many open internet-windows u always have?
<MrLobster|PM> i have 2, the pa page, and the website for naked light pictures
<Ave> both has bad gfx

Last edited by MrLobster; 22 Sep 2008 at 03:14.
MrLobster is offline   Reply With Quote
Unread 22 Sep 2008, 08:04   #4
Mzyxptlk
mz.
Alien Invasion Champion, Submarine Champion, Tiger Punch Champion, Barts Watersports Adventure Champion
 
Join Date: Aug 2005
Posts: 8,587
Mzyxptlk has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Mzyxptlk has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Mzyxptlk has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Mzyxptlk has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Mzyxptlk has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Mzyxptlk has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Mzyxptlk has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Mzyxptlk has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Mzyxptlk has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Mzyxptlk has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Mzyxptlk has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.
Re: Production Formulas

It is worth noting that this formula

PU = (total_resources_spent^1/2)*LN(total_resources_spent^2)

is terrible.

If you're planning on coding a production calculator, I would instead use

PU = (total_resources_spent^1/2)*2*LN(total_resources_spent)

These two formulae are equivalent, but evade the need for a ****ing gigantic variable to store total_resources_spent^2 in.
__________________
The outraged poets threw sticks and rocks over the side of the bridge. They were all missing Mary and he felt a contented smug feeling wash over him. He would have given them a coy little wave if the roof hadn't collapsed just then. Mary then found himself in the middle of an understandably shocked family's kitchen table. So he gave them the coy little wave and realized it probably would have been more effective if he hadn't been lying on their turkey.
Mzyxptlk is offline   Reply With Quote
Unread 22 Sep 2008, 11:59   #5
MrLobster
Commander in Briefs!
 
MrLobster's Avatar
 
Join Date: Dec 2000
Location: UK
Posts: 783
MrLobster has much to be proud ofMrLobster has much to be proud ofMrLobster has much to be proud ofMrLobster has much to be proud ofMrLobster has much to be proud ofMrLobster has much to be proud ofMrLobster has much to be proud ofMrLobster has much to be proud ofMrLobster has much to be proud of
Re: Production Formulas

i presume the 1/2 in the formula is 0.5?
__________________
<Kila> WHAT HAVE YOU DONE WITH MY PRECIOUS FORUMS
<Zeyi> 24h forum closure
<Zeyi> all posts recalled

"he's got a proven track record when it comes to showy art composition" - Tommy

<Sigi> Light: can I ask u how many open internet-windows u always have?
<MrLobster|PM> i have 2, the pa page, and the website for naked light pictures
<Ave> both has bad gfx
MrLobster is offline   Reply With Quote
Unread 22 Sep 2008, 12:26   #6
Mzyxptlk
mz.
Alien Invasion Champion, Submarine Champion, Tiger Punch Champion, Barts Watersports Adventure Champion
 
Join Date: Aug 2005
Posts: 8,587
Mzyxptlk has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Mzyxptlk has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Mzyxptlk has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Mzyxptlk has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Mzyxptlk has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Mzyxptlk has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Mzyxptlk has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Mzyxptlk has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Mzyxptlk has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Mzyxptlk has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Mzyxptlk has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.
Re: Production Formulas

Yes.

It should be

PU = (total_resources_spent^(1/2))*2*LN(total_resources_spent)

or

PU = (total_resources_spent^0.5)*2*LN(total_resources_spent)

or

PU = SQRT(total_resources_spent)*2*LN(total_resources_spent)
__________________
The outraged poets threw sticks and rocks over the side of the bridge. They were all missing Mary and he felt a contented smug feeling wash over him. He would have given them a coy little wave if the roof hadn't collapsed just then. Mary then found himself in the middle of an understandably shocked family's kitchen table. So he gave them the coy little wave and realized it probably would have been more effective if he hadn't been lying on their turkey.
Mzyxptlk is offline   Reply With Quote
Unread 22 Sep 2008, 18:04   #7
Heartless
CRASHING BEATS 'N FANTASY
 
Heartless's Avatar
 
Join Date: Mar 2001
Location: Cold Country.
Posts: 1,912
Heartless is an inspiration to us all and we should try to be more like himHeartless is an inspiration to us all and we should try to be more like himHeartless is an inspiration to us all and we should try to be more like himHeartless is an inspiration to us all and we should try to be more like himHeartless is an inspiration to us all and we should try to be more like himHeartless is an inspiration to us all and we should try to be more like himHeartless is an inspiration to us all and we should try to be more like himHeartless is an inspiration to us all and we should try to be more like himHeartless is an inspiration to us all and we should try to be more like himHeartless is an inspiration to us all and we should try to be more like himHeartless is an inspiration to us all and we should try to be more like him
Re: Production Formulas

Let's also mention that the multiplication by 2 is much faster than calculating the power of 2.
__________________
Ià! Ià! Munin F'tagn! - [*scendancy]
Heartless is offline   Reply With Quote
Unread 23 Sep 2008, 07:14   #8
Mzyxptlk
mz.
Alien Invasion Champion, Submarine Champion, Tiger Punch Champion, Barts Watersports Adventure Champion
 
Join Date: Aug 2005
Posts: 8,587
Mzyxptlk has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Mzyxptlk has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Mzyxptlk has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Mzyxptlk has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Mzyxptlk has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Mzyxptlk has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Mzyxptlk has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Mzyxptlk has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Mzyxptlk has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Mzyxptlk has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Mzyxptlk has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.
Re: Production Formulas

I assume the same goes for sqrt( x ) vs. pow( x , 0.5 )?
__________________
The outraged poets threw sticks and rocks over the side of the bridge. They were all missing Mary and he felt a contented smug feeling wash over him. He would have given them a coy little wave if the roof hadn't collapsed just then. Mary then found himself in the middle of an understandably shocked family's kitchen table. So he gave them the coy little wave and realized it probably would have been more effective if he hadn't been lying on their turkey.
Mzyxptlk is offline   Reply With Quote
Unread 1 Oct 2008, 23:15   #9
qebab
The Original Carebear
 
Join Date: Nov 2004
Location: Trondheim, Norway
Posts: 1,048
qebab is an inspiration to us all and we should try to be more like himqebab is an inspiration to us all and we should try to be more like himqebab is an inspiration to us all and we should try to be more like himqebab is an inspiration to us all and we should try to be more like himqebab is an inspiration to us all and we should try to be more like himqebab is an inspiration to us all and we should try to be more like himqebab is an inspiration to us all and we should try to be more like himqebab is an inspiration to us all and we should try to be more like himqebab is an inspiration to us all and we should try to be more like himqebab is an inspiration to us all and we should try to be more like himqebab is an inspiration to us all and we should try to be more like him
Re: Production Formulas

Quote:
Originally Posted by Mzyxptlk View Post
I assume the same goes for sqrt( x ) vs. pow( x , 0.5 )?
That depends, but normally it would be (Cheapass systems could translate the sqrt(x) call into pow(x, 0.5) thus making it slower, but most proper systems don't do that).

These details are so minor though, that you are unlikely to notice it unless you run a hundred thousand consecutive operations like that.
__________________
If at first you don't succeed, try, try again. Then quit. No use being a damn fool about it.

Oh crap, I might be back. I should take my own advice.
qebab is offline   Reply With Quote
Unread 2 Oct 2008, 07:51   #10
Mzyxptlk
mz.
Alien Invasion Champion, Submarine Champion, Tiger Punch Champion, Barts Watersports Adventure Champion
 
Join Date: Aug 2005
Posts: 8,587
Mzyxptlk has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Mzyxptlk has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Mzyxptlk has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Mzyxptlk has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Mzyxptlk has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Mzyxptlk has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Mzyxptlk has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Mzyxptlk has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Mzyxptlk has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Mzyxptlk has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Mzyxptlk has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.
Re: Production Formulas

Quote:
Originally Posted by qebab View Post
That depends, but normally it would be (Cheapass systems could translate the sqrt(x) call into pow(x, 0.5) thus making it slower, but most proper systems don't do that).

These details are so minor though, that you are unlikely to notice it unless you run a hundred thousand consecutive operations like that.
But really it's not so much about speed as it is about doing it the right way™.
__________________
The outraged poets threw sticks and rocks over the side of the bridge. They were all missing Mary and he felt a contented smug feeling wash over him. He would have given them a coy little wave if the roof hadn't collapsed just then. Mary then found himself in the middle of an understandably shocked family's kitchen table. So he gave them the coy little wave and realized it probably would have been more effective if he hadn't been lying on their turkey.
Mzyxptlk is offline   Reply With Quote
Unread 2 Oct 2008, 13:24   #11
qebab
The Original Carebear
 
Join Date: Nov 2004
Location: Trondheim, Norway
Posts: 1,048
qebab is an inspiration to us all and we should try to be more like himqebab is an inspiration to us all and we should try to be more like himqebab is an inspiration to us all and we should try to be more like himqebab is an inspiration to us all and we should try to be more like himqebab is an inspiration to us all and we should try to be more like himqebab is an inspiration to us all and we should try to be more like himqebab is an inspiration to us all and we should try to be more like himqebab is an inspiration to us all and we should try to be more like himqebab is an inspiration to us all and we should try to be more like himqebab is an inspiration to us all and we should try to be more like himqebab is an inspiration to us all and we should try to be more like him
Re: Production Formulas

Quote:
Originally Posted by Mzyxptlk View Post
But really it's not so much about speed as it is about doing it the right way™.
The Right Way would be a formula that's easier to solve for total_resources_spent. Sort of hard for people to estimate, as it is now. If anyone wonders, the solution for total_resources_spent is (with total_re... = t and PU = p)
t = p ^ 2 / 16LambertW(-p/4)^2

Try to estimate that in your head.

PS! If anyone wonders why you would want to do that, it's to estimate how much you could spend in n ticks with m factories. So you don't screw up your spend before round end like mz did! (In like round 23 or something?)
__________________
If at first you don't succeed, try, try again. Then quit. No use being a damn fool about it.

Oh crap, I might be back. I should take my own advice.
qebab is offline   Reply With Quote
Unread 2 Oct 2008, 13:29   #12
Mzyxptlk
mz.
Alien Invasion Champion, Submarine Champion, Tiger Punch Champion, Barts Watersports Adventure Champion
 
Join Date: Aug 2005
Posts: 8,587
Mzyxptlk has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Mzyxptlk has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Mzyxptlk has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Mzyxptlk has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Mzyxptlk has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Mzyxptlk has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Mzyxptlk has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Mzyxptlk has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Mzyxptlk has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Mzyxptlk has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Mzyxptlk has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.
Re: Production Formulas

Quote:
Originally Posted by qebab View Post
The Right Way would be a formula that's easier to solve for total_resources_spent. Sort of hard for people to estimate, as it is now. If anyone wonders, the solution for total_resources_spent is (with total_re... = t and PU = p)
t = p ^ 2 / 16LambertW(-p/4)^2

Try to estimate that in your head.
We actually played around with that a bit about 6 months ago. x^x is a bitch to solve.

P.S. How about you help me find a closed form formula for this recurrence relation:
a(0)=1
a(1)=3
a(n) = 2*a(n-1)+a(n-2)


Quote:
Originally Posted by qebab View Post
PS! If anyone wonders why you would want to do that, it's to estimate how much you could spend in n ticks with m factories. So you don't screw up your spend before round end like mz did! (In like round 23 or something?)
Would only help if you managed to actually remember how long the round was supposed to last though!
__________________
The outraged poets threw sticks and rocks over the side of the bridge. They were all missing Mary and he felt a contented smug feeling wash over him. He would have given them a coy little wave if the roof hadn't collapsed just then. Mary then found himself in the middle of an understandably shocked family's kitchen table. So he gave them the coy little wave and realized it probably would have been more effective if he hadn't been lying on their turkey.
Mzyxptlk is offline   Reply With Quote
Unread 2 Oct 2008, 13:32   #13
qebab
The Original Carebear
 
Join Date: Nov 2004
Location: Trondheim, Norway
Posts: 1,048
qebab is an inspiration to us all and we should try to be more like himqebab is an inspiration to us all and we should try to be more like himqebab is an inspiration to us all and we should try to be more like himqebab is an inspiration to us all and we should try to be more like himqebab is an inspiration to us all and we should try to be more like himqebab is an inspiration to us all and we should try to be more like himqebab is an inspiration to us all and we should try to be more like himqebab is an inspiration to us all and we should try to be more like himqebab is an inspiration to us all and we should try to be more like himqebab is an inspiration to us all and we should try to be more like himqebab is an inspiration to us all and we should try to be more like him
Re: Production Formulas

Yeah, the only really viable way of doing this is to use Newtons method or equivalent to find a reasonable approximation. Which isn't hard, but unnecessarily much work.
__________________
If at first you don't succeed, try, try again. Then quit. No use being a damn fool about it.

Oh crap, I might be back. I should take my own advice.
qebab is offline   Reply With Quote
Reply


Thread Tools
Display Modes

Forum Jump


All times are GMT +1. The time now is 14:37.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2002 - 2018