Home World Forum
Stars! AutoHost web forums

Jump to Stars! AutoHost


 
 
Home » Stars! 2.6/7 » The Academy » Factory and Mine compounding (How do you optimize resources over time?)
Factory and Mine compounding Wed, 06 November 2013 10:31 Go to next message
skoormit is currently offline skoormit

 
Lieutenant

Messages: 665
Registered: July 2008
Location: Alabama
I've been playing Stars on and off (mostly off) since 1995 (when I got a demo with my subscription to PC Gamer magazine) and I still don't have an airtight mental model for how factory and mine compounding interact. Can I get some of you smarter people to show me how it's done? Here's the question:

A mine costs 3 resources and provides 1kt in minerals per year.
A factory costs 10 resources and 3kt of germanium and provides 1.2 resources per year.

In year 2450, you colonize a planet, fill it to 100% capacity, and leave 150kt of Germanium on the surface.
The population on the planet provides 500 resources, can operate 500 factories, and can operate 500 mines.


Assume germanium concentration is 100 and will not drop as you mine it.
Assume that you will not add or remove pop and that you will not terraform the planet.
What is the optimal build path to maximize the total resources produced by this planet through year 2500?
Show your work, please. Smile



What we need's a few good taters.

Report message to a moderator

Re: Factory and Mine compounding Wed, 06 November 2013 11:09 Go to previous messageGo to next message
XAPBob is currently offline XAPBob

 
Lt. Commander

Messages: 957
Registered: August 2012
Build factories until you have no more Germ, then build as many mines as possible that year.
Build as many factories as possible, and then as many mines as possible.

This can be done by autobuild orders, but you might waste a few resources on half building a factory, when you could have built a whole mine.

In general I *think* that half building a factory is better than building a mine UNTIL you are out of Germanium.

The reasoning is as follows:
Mines do not compound, Factories do.
You therefore want as many Factories as possible as fast as possible - mining can wait.
When you can't build any more factories you are out of Germanium, so build as many mines as possible.

Next year you will have some mined Germanium, which should be converted to Factories...

The tweaks come in 2 possible places:
- Whilst using your initial G you might end up being able to build n+0.5 Factories, Then you could instead build n Factories and 1 mine - I still think that the part factory is a better bet
- When you are G limited the above question might have a different answer, you might go for the additional mine in that year.

Report message to a moderator

Re: Factory and Mine compounding Wed, 06 November 2013 12:01 Go to previous messageGo to next message
skoormit is currently offline skoormit

 
Lieutenant

Messages: 665
Registered: July 2008
Location: Alabama
XAPBob wrote on Wed, 06 November 2013 10:09
Build factories until you have no more Germ, then build as many mines as possible that year.
Build as many factories as possible, and then as many mines as possible.

...

The reasoning is as follows:
Mines do not compound, Factories do.
You therefore want as many Factories as possible as fast as possible - mining can wait.
When you can't build any more factories you are out of Germanium, so build as many mines as possible.


This is how I run my queues, but I don't *think* it is optimal. My intuition is that it's pretty darn close to optimal, but that there's probably a better way to stay ahead of the germanium bottleneck. I just don't know what that way is.



What we need's a few good taters.

Report message to a moderator

Re: Factory and Mine compounding Wed, 06 November 2013 12:58 Go to previous messageGo to next message
XAPBob is currently offline XAPBob

 
Lt. Commander

Messages: 957
Registered: August 2012
The only better way is to tune your queies so you get a whole number of factories built each year, and I don't think that wins in terms of resoirce integral.

I'll pop a spreadsheet together some time...


if 10 facs give 12 res, then do 5 give 6?
if 10 give 12, then do 9 give 10?


[Updated on: Wed, 06 November 2013 13:07]

Report message to a moderator

Re: Factory and Mine compounding Wed, 06 November 2013 15:42 Go to previous messageGo to next message
skoormit is currently offline skoormit

 
Lieutenant

Messages: 665
Registered: July 2008
Location: Alabama
XAPBob wrote on Wed, 06 November 2013 11:58

if 10 facs give 12 res, then do 5 give 6?
if 10 give 12, then do 9 give 10?


Use 10 give 10 to make the math simpler. I'd prefer to solve the general case.

In my spreadsheets I use FLOOR(FLOOR(Factories,1)*ResourcesPerFactory,1).
In other words, truncate any partial factories, multiply by res/fac, then round down. Stars itself might round up or down, though; I'm not sure.



What we need's a few good taters.

Report message to a moderator

Re: Factory and Mine compounding Wed, 06 November 2013 17:39 Go to previous messageGo to next message
XAPBob is currently offline XAPBob

 
Lt. Commander

Messages: 957
Registered: August 2012
10 give ten only asks one of the questions though...

Report message to a moderator

Re: Factory and Mine compounding Wed, 06 November 2013 18:44 Go to previous messageGo to next message
skoormit is currently offline skoormit

 
Lieutenant

Messages: 665
Registered: July 2008
Location: Alabama
XAPBob wrote on Wed, 06 November 2013 16:39
10 give ten only asks one of the questions though...


What am I missing?

If 10 give 10, then 1 gives 1. No rounding needed.



What we need's a few good taters.

Report message to a moderator

Re: Factory and Mine compounding Thu, 07 November 2013 02:01 Go to previous messageGo to next message
XAPBob is currently offline XAPBob

 
Lt. Commander

Messages: 957
Registered: August 2012
it can't ask the fractional resource question Wink

Report message to a moderator

Re: Factory and Mine compounding Thu, 07 November 2013 04:57 Go to previous messageGo to next message
m.a@stars is currently offline m.a@stars

 
Commander

Messages: 2765
Registered: October 2004
Location: Third star to the left
skoormit wrote on Wed, 06 November 2013 18:01
there's probably a better way to stay ahead of the germanium bottleneck.

Well, that would depend on what you want to optimize. Sherlock

If you want max Resources, definitely run, don't walk, towards G bottleneck. Whip

If you want to guarantee there's enough G available for ships, stations, et al, then things become more interesting, but that's Stars!. Twisted Evil



So many Stars, so few Missiles!

In space no one can hear you scheme! Deal

Report message to a moderator

Re: Factory and Mine compounding Fri, 08 November 2013 15:57 Go to previous messageGo to next message
skoormit is currently offline skoormit

 
Lieutenant

Messages: 665
Registered: July 2008
Location: Alabama
XAPBob wrote on Thu, 07 November 2013 01:01
it can't ask the fractional resource question Wink


I'm not sure which question that is.



What we need's a few good taters.

Report message to a moderator

Re: Factory and Mine compounding Fri, 08 November 2013 16:25 Go to previous messageGo to next message
skoormit is currently offline skoormit

 
Lieutenant

Messages: 665
Registered: July 2008
Location: Alabama
An interesting observation:

Given the parameters above (facs cost 10R and 3G and produce 1.2R, mines cost 3R and produce 1G, pop produces 500R and can operate 500 facs and 500 mines, 150G already on the surface), I have analyzed two different build paths:

Path A) Build as many complete facs as you can each year, starting with the 150kt of G on the surface. Each year, build mines only with leftover resources that can't be spent on facs.

Path B) Build 0 facs and 166+2/3 mines the first year. After that, follow the same guideline as in Path A (build facs until out of germ, leftover resources to mines).

In other words, the only real difference between the paths is what they do in year 1. Path A uses the 150kt of Germ to build 50 facs right away. Path B instead spends the first year building mines, then tries to catch up.

Both paths complete 500 facs and 500 mines in 9 years.
In year 9, path A has 111 resources leftover and 194kt germ to spare.
In year 9, path B has 69 resources leftover and 185kt germ to spare.

Path A is better in nearly every meaningful way, but the difference is much smaller than I would have guessed.

What about the middle way?

Path C) Build 25 facs and 83+1/3 mines in the first year. After that, follow the same guideline as in Path A (build facs until out of germ, leftover resources to mines).

Path C also completes 500f/500m in 9 years.
In year 9, path C has 106 resources leftover and 194kt germ to spare.

The difference between path A and path C is only 5 resources. Almost nothing.





[Updated on: Fri, 08 November 2013 16:25]




What we need's a few good taters.

Report message to a moderator

Re: Factory and Mine compounding Sat, 09 November 2013 04:50 Go to previous messageGo to next message
XAPBob is currently offline XAPBob

 
Lt. Commander

Messages: 957
Registered: August 2012
Interesting indeed.

What of the "Build 5-10 mines each year, followed by Factories"

Report message to a moderator

Re: Factory and Mine compounding Mon, 11 November 2013 04:47 Go to previous messageGo to next message
m.a@stars is currently offline m.a@stars

 
Commander

Messages: 2765
Registered: October 2004
Location: Third star to the left
skoormit wrote on Fri, 08 November 2013 22:25
In year 9, path A has 111 resources leftover...
In year 9, path B has 69 resources leftover...

In other words, almost 38% less Resources. Shocked

And don't forget the "resource integral", that is, the sum total of all available Resources for the time period considered. Pirate


Quote:
The difference between path A and path C is only 5 resources. Almost nothing.

Very interesting! Rolling Eyes Still, this is Stars! where every little bit counts and even just 5 Res (4.5%) might be a significant handicap. Wall Bash

Also, yours might be considered an extreme case, with Mines much cheaper than Facts. What happens when costs vary? Sherlock



So many Stars, so few Missiles!

In space no one can hear you scheme! Deal

Report message to a moderator

Re: Factory and Mine compounding Mon, 11 November 2013 05:42 Go to previous messageGo to next message
XAPBob is currently offline XAPBob

 
Lt. Commander

Messages: 957
Registered: August 2012
That's just the resource count in the last year - the integral is otherwise the same (assuming the same number of mines are built, which it looks like they are, 500 of each is mentioned)

The question is also how many other minerals are available...
I'd rather have 5 fewer resources, but enough minerals to build a freighter of some description, than 5 more resources, but insufficient minerals.

Report message to a moderator

Re: Factory and Mine compounding Mon, 11 November 2013 07:39 Go to previous messageGo to next message
skoormit is currently offline skoormit

 
Lieutenant

Messages: 665
Registered: July 2008
Location: Alabama
m.a@stars wrote on Mon, 11 November 2013 03:47
And don't forget the "resource integral", that is, the sum total of all available Resources for the time period considered.


The resource integral is irrelevant in this case, since all resources are being used each year to build factories and mines. The only thing that matters is how much is leftover in the last year.


[Updated on: Mon, 11 November 2013 07:39]




What we need's a few good taters.

Report message to a moderator

Re: Factory and Mine compounding Mon, 11 November 2013 07:45 Go to previous messageGo to next message
skoormit is currently offline skoormit

 
Lieutenant

Messages: 665
Registered: July 2008
Location: Alabama
XAPBob wrote on Mon, 11 November 2013 04:42

The question is also how many other minerals are available...
I'd rather have 5 fewer resources, but enough minerals to build a freighter of some description, than 5 more resources, but insufficient minerals.


The difference in remaining germ is also the difference in the other minerals mined.

It takes 1500 germ to build the 500 factories. 150 germ was available on the surface. That means that 1350 germ must be mined.

To determine the amount of the other minerals that have been mined, add 1350 to whatever germ surplus remains in the last year. (All of this is simplifying, of course, to a concentration of 100 with no depletion, but the principle is the same.)



What we need's a few good taters.

Report message to a moderator

Re: Factory and Mine compounding Mon, 11 November 2013 07:52 Go to previous messageGo to next message
skoormit is currently offline skoormit

 
Lieutenant

Messages: 665
Registered: July 2008
Location: Alabama
m.a@stars wrote on Mon, 11 November 2013 03:47
yours might be considered an extreme case, with Mines much cheaper than Facts. What happens when costs vary?


It's not an extreme case. The settings I chose are rather typical. Varying the costs will probably cause the exact differences between paths to vary, but it probably won't change the relative results of the different paths.



What we need's a few good taters.

Report message to a moderator

Re: Factory and Mine compounding Tue, 12 November 2013 13:49 Go to previous messageGo to next message
m.a@stars is currently offline m.a@stars

 
Commander

Messages: 2765
Registered: October 2004
Location: Third star to the left
skoormit wrote on Mon, 11 November 2013 13:39
The only thing that matters is how much is leftover in the last year.

In a test, perhaps. In a real game the only thing that matters is how many Res & Mins you have when you need them, which can be at any time and without warning. Dueling



So many Stars, so few Missiles!

In space no one can hear you scheme! Deal

Report message to a moderator

Re: Factory and Mine compounding Tue, 12 November 2013 13:52 Go to previous messageGo to next message
XAPBob is currently offline XAPBob

 
Lt. Commander

Messages: 957
Registered: August 2012
I'm putting together a quick and dirty, but surprisingly detailed, spreadsheet. Taking into account pop growth, mines and factories - with racial settings defined in a seperate sheet...
Then I can push a few algorithms for factory/mine/TF building...

Report message to a moderator

Re: Factory and Mine compounding Tue, 12 November 2013 13:58 Go to previous messageGo to next message
m.a@stars is currently offline m.a@stars

 
Commander

Messages: 2765
Registered: October 2004
Location: Third star to the left
skoormit wrote on Mon, 11 November 2013 13:52
The settings I chose are rather typical.

I wouldn't be so sure. Facs cost > 9 are fairly rare, because of their weak compounding, at least for econ-oriented races. my 2 cents my 2 cents my 2 cents my 2 cents

And Mines cost 3 is an ideal case, because they "drag" the least, but there's plenty of other options, starting with more Efficiency. Whip



So many Stars, so few Missiles!

In space no one can hear you scheme! Deal

Report message to a moderator

Re: Factory and Mine compounding Wed, 13 November 2013 03:54 Go to previous messageGo to next message
neilhoward

 
Commander

Messages: 1112
Registered: April 2008
Location: SW3 & 10023
XAPBob wrote on Tue, 12 November 2013 10:52
I'm putting together a quick and dirty, but surprisingly detailed, spreadsheet. Taking into account pop growth, mines and factories - with racial settings defined in a seperate sheet...
Then I can push a few algorithms for factory/mine/TF building...

Sweet. My mod of the old Posey pages is pretty lacking. I can't wait to testdrive a new spreadsheet. This is exactly the kind of gogetitness the community needs.

Report message to a moderator

Re: Factory and Mine compounding Wed, 13 November 2013 04:55 Go to previous messageGo to next message
XAPBob is currently offline XAPBob

 
Lt. Commander

Messages: 957
Registered: August 2012
neilhoward wrote on Wed, 13 November 2013 08:54
XAPBob wrote on Tue, 12 November 2013 10:52
I'm putting together a quick and dirty, but surprisingly detailed, spreadsheet. Taking into account pop growth, mines and factories - with racial settings defined in a seperate sheet...
Then I can push a few algorithms for factory/mine/TF building...

Sweet. My mod of the old Posey pages is pretty lacking. I can't wait to testdrive a new spreadsheet. This is exactly the kind of gogetitness the community needs.


First Draft:
https://docs.google.com/spreadsheet/ccc?key=0ApuHYsdv1Z79dFk 3OFBiRXFYWVBFX2h1UTBtV1ZBQlE&usp=sharing

NOTES:
- Minerals do not deplete (yet), and there is no "Is Homeworld" setting.
- Partial factories and mines can be built, they will not be used in calculations regarding mining or resource generation
- Partial kT mined and resources generated are rounded down
- Pop growth is always rounded down to the nearest 100 (which seems to mean that at 18% growth on a 100% world you'll never actually fill it)

Targets:
- Mineral depletion
- TF (really hard to work out, so a way down the road)

Features:
Different sheets will hold different planetary queue algorithms (e.g. save 5 mines worth of resources from the factory queue when that many mines can be built) or build mines first (clearly not a good plan) or -F or whatever...
Existing sheet is the "standard" "Up to ... Factories, Up to ... Mines" (I've not specified the numbers, so it's unlimited at the moment)


[Updated on: Wed, 13 November 2013 05:01]

Report message to a moderator

Re: Factory and Mine compounding Thu, 14 November 2013 14:45 Go to previous messageGo to next message
skoormit is currently offline skoormit

 
Lieutenant

Messages: 665
Registered: July 2008
Location: Alabama
XAPBob wrote on Wed, 13 November 2013 03:55

First Draft:
https://docs.google.com/spreadsheet/ccc?key=0ApuHYsdv1Z79dFk 3OFBiRXFYWVBFX2h1UTBtV1ZBQlE&usp=sharing


Promising work.

I have a similar spreadsheet that I use for managing my empires. It's not perfect, but it does this stuff.

The logic in my worksheet template assumes the building priority is the construction queue, then terraforming, then factories, then mines, but it is easy to override that logic in any given year. And of course I often zero out the terraforming for a while on a newly colonized planet.

I'm not sure the mineral concentration depletion will be easily solvable in google. You have to keep track of how many kt have been mined of each mineral since the last time the concentration dropped for that mineral. It gets tricky to handle the case when the mining rate is high enough to drop the concentration more than one point in a year. I solved it by adding a sheet with a chart of how many minerals are available at each concentration. My planet sheet uses a lookup on that chart, and also uses array formulas to calculate the sums. I don't know if a Google spreadsheet can do those things, but you can probably use index(match()) to perform a lookup, and you can acheive the result of an array formula just by adding a column that performs whatever aggregation function you are using.

Oh, a minor note: pop growth happens after production, so you need to point your pop growth formula to the following year's planet value, to benefit from any terraforming you perform in the current year.



What we need's a few good taters.

Report message to a moderator

Re: Factory and Mine compounding Thu, 14 November 2013 18:29 Go to previous messageGo to next message
XAPBob is currently offline XAPBob

 
Lt. Commander

Messages: 957
Registered: August 2012
except for CA instaforming, or remote TF.

Hmm, can CA buy TF if someone if remotely deTFing them?

Report message to a moderator

Re: Factory and Mine compounding Thu, 14 November 2013 20:21 Go to previous messageGo to previous message
magic9mushroom is currently offline magic9mushroom

 
Commander

Messages: 1361
Registered: May 2008
XAPBob wrote on Fri, 15 November 2013 10:29
except for CA instaforming, or remote TF.

Hmm, can CA buy TF if someone if remotely deTFing them?


No, but the instaforming takes effect every single turn, so the deterraforming will be removed as soon as the Orbital Adjusters are no longer maintaining it.

(OoE goes production (incl TF) -> growth -> instaforming -> orbital TF, so OAs will be able to maintain 1 turn's worth of deterra against a CA.)

Report message to a moderator

Previous Topic: Ship Teleportation bug
Next Topic: Running out of fuel while hitting a minefield
Goto Forum:
  


Current Time: Fri May 03 17:12:04 EDT 2024