Home World Forum
Stars! AutoHost web forums

Jump to Stars! AutoHost


 
 
Home » Stars! 2.6/7 » The Academy » population calculations
population calculations Sun, 19 April 2009 23:01 Go to previous message
venom087 is currently offline venom087

 
Crewman 3rd Class

Messages: 4
Registered: March 2009
I'm working on a Stars! tool right now and my numbers are coming out slightly off for the population calculations. I know there's several tools like this already but I'm planning on having some cool features that the others don't have. Once it's ready for an alpha release I'll do a proper announcement Very Happy I'm wondering if anyone here can help me with some of the details of how Stars! math works.

I'm using the equation from the faq:
pop * growth rate * planet value
over 25% apply crowding factor: (16/9) * (1-cap%)^2

It's mostly working. About half my calculations are correct and the rest are only off by 100 or 200 people. So I'm wondering if anyone knows more intimate details about how Stars! rounds numbers. I know the app is 16 bit, so what does that mean in terms of how precise floating point variables are? For instance, that (16/9) fraction is 1.7777777777. Should I use 1.77? 1.78? Something more precise?

Also, how does the game round the actual populations? Does 690 people round to 700 or 600? Or even more tricky, does Stars! actually use 690 for the math but display the rounded number in the game interface and in reports.

And yet another question, what planet capacity numbers does the game use? I turned on newreports in my stars.ini and that only reports cap% to two significant digits (e.g. 25%). Should I use 4, or more?

Thanks in advance for the help!

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Yet another MT question.
Next Topic: initiative
Goto Forum:
  


Current Time: Mon May 20 10:07:50 EDT 2024