This is the result of a couple of ICQ sessions with J. It's rather incomplete, esp. that one crucial formula is evading us.
Factory/Corporations:
1. Each good has demand prognosis for the next turn, based on all sorts of stuff we'll work out.
2. Each corporation will attempt to produce to meet that prognosis.
In other to do that:
3. It'll hire workers.
4. Wages are calculated based on the number of available and needed workers.
5. Available workers is calculated by skills nessecary. This means that it'll be a lot harder to find workers for specialised production than for rudimentary production.
6. Skills are determined by prognosis info at the time of the worker's "education" (each turn when you add to pool, add accord. to prognosis). Skills are static (maybe later add something to change that)
7. At the end of turn you change supply and demand (add a random factor so you won't have correct prognosis all the time), and income, spending and so on is calculated.
Raw Materials Production:
Per Worker: tools*(tech-excavationfactor)/256 - since tech and excFctr can both be unsigned bytes, it would be best to treat them as a sort of percent from 0 to 255.
Then modify the corporation's efficiency factor by the number of workers on tile - the trick here is to lower the efficiency when you have too much workers, but not in a linear way, but like a y=ax^2+bx+c kinda eq. if you know what i mean. by a hitherto unknown formula, and apply to the Per Worker like thus: perworker*effic-modfactor/100. Efficiency is from 1 to 100, and therefore treated as percent, as you can see above.
Basically, the formula now goes like this:
corp.prjct.tools*(corp.tech-good.excFctr)/256*corp.effic-(insert by workers formula here)/100
Disclaimer: The following is based on my rather limited knowledge of OOP programming, mostly in Java.
As you have noticed, several objects (just suggesting):
corp - this represents the corporation, it's pretty much "top level" meaning it isn't an object of anything else if you know what I mean.
corp.prjct - this represents the project dealt with - can represent factories, mines etc..
corp.prjct.tools represents the number of tools available, some tools can be worth more than 1. It prob. needs some more hierarchy there.
corp.effic represents the corporation's efficiency level (maybe make that 256 instead of 100 too? Or is there any way to make new types in C++, 4 bits for example? Then again, it would be best to use all the numbers available, in an unsigned nibble - i think that that's the name - you have 0-127, right?)
Best wishes and may the Force be with you!
PS. this is starting to look like a business simulation lol
Eventually this will be a game that'll need a dual-processor pentium5 50gH with 32GB RAM with all the calculations we'll stuff in there
Factory/Corporations:
1. Each good has demand prognosis for the next turn, based on all sorts of stuff we'll work out.
2. Each corporation will attempt to produce to meet that prognosis.
In other to do that:
3. It'll hire workers.
4. Wages are calculated based on the number of available and needed workers.
5. Available workers is calculated by skills nessecary. This means that it'll be a lot harder to find workers for specialised production than for rudimentary production.
6. Skills are determined by prognosis info at the time of the worker's "education" (each turn when you add to pool, add accord. to prognosis). Skills are static (maybe later add something to change that)
7. At the end of turn you change supply and demand (add a random factor so you won't have correct prognosis all the time), and income, spending and so on is calculated.
Raw Materials Production:
Per Worker: tools*(tech-excavationfactor)/256 - since tech and excFctr can both be unsigned bytes, it would be best to treat them as a sort of percent from 0 to 255.
Then modify the corporation's efficiency factor by the number of workers on tile - the trick here is to lower the efficiency when you have too much workers, but not in a linear way, but like a y=ax^2+bx+c kinda eq. if you know what i mean. by a hitherto unknown formula, and apply to the Per Worker like thus: perworker*effic-modfactor/100. Efficiency is from 1 to 100, and therefore treated as percent, as you can see above.
Basically, the formula now goes like this:
corp.prjct.tools*(corp.tech-good.excFctr)/256*corp.effic-(insert by workers formula here)/100
Disclaimer: The following is based on my rather limited knowledge of OOP programming, mostly in Java.
As you have noticed, several objects (just suggesting):
corp - this represents the corporation, it's pretty much "top level" meaning it isn't an object of anything else if you know what I mean.
corp.prjct - this represents the project dealt with - can represent factories, mines etc..
corp.prjct.tools represents the number of tools available, some tools can be worth more than 1. It prob. needs some more hierarchy there.
corp.effic represents the corporation's efficiency level (maybe make that 256 instead of 100 too? Or is there any way to make new types in C++, 4 bits for example? Then again, it would be best to use all the numbers available, in an unsigned nibble - i think that that's the name - you have 0-127, right?)
Best wishes and may the Force be with you!
PS. this is starting to look like a business simulation lol
Eventually this will be a game that'll need a dual-processor pentium5 50gH with 32GB RAM with all the calculations we'll stuff in there

Comment