PM Alpha Testing: Phase 2

Stellar Emperor Alpha testing. Builds may have a short period of working operation. Gameplay operations may change drastically from day to day. Feel free to join in the testing.
Spectrum
Cadet
Posts: 31
Joined: Mon Oct 13, 2008 5:07 am
Contact:

Re: Alpha Testing: Phase 2

Post by Spectrum »

Willis wrote:
Spectrum wrote:

Code: Select all

OreStock += Miners * 30 * MetalRating * time;

MaxOreProcessed = 40 * time;

OreStock -= MaxOreProcessed;

if (OreStock < 0) OreStock = 0;
I've gone over this snipet of code a few times now, and I can't even begin to point out the many flaws I am seeing in your logic. Ranging from Free Metal from using Ore you don't have to Metal Stock (assumed) being increased incorrectly, to potential 100x overproduction depending on how you store MetalRating. And None of your code, at least in that point acknowledges your mining capacity, and if it does at any point later, it's already using potentially incorrect numbers.

I'd say you're relying TOO much on magic.
Serously, no magic that was a joke...

??? metal rating is stored at a double 0 - 1.

it was missing the cap you are correct.
MaxOreProcessed = 40 * RefiCap * time.
Last edited by Spectrum on Wed Sep 30, 2009 2:45 pm, edited 2 times in total.
User avatar
Cossid
Site Admin
Posts: 262
Joined: Mon Mar 31, 2008 10:39 am
Location: Eau Claire, WI, USA
Contact:

Re: Alpha Testing: Phase 2

Post by Cossid »

There are still other issues, like not properly increasing Metal stock (at the end of your code block, you don't have a valid stored figure for _actual_, just max), and your code also, because of this allows refining ore you don't have (if < 0) = 0 is a bad hack. OreStock -= Min(OreStock, MaxOreProcessed); would be a better alternative, but still has the actual vs max issue.
--Cossid AKA Caleb
Spectrum
Cadet
Posts: 31
Joined: Mon Oct 13, 2008 5:07 am
Contact:

Re: Alpha Testing: Phase 2

Post by Spectrum »

Willis wrote:There are still other issues, like not properly increasing Metal stock (at the end of your code block, you don't have a valid stored figure for _actual_, just max), and your code also, because of this allows refining ore you don't have (if < 0) = 0 is a bad hack. OreStock -= Min(OreStock, MaxOreProcessed); would be a better alternative, but still has the actual vs max issue.
hack?

Your kidding right?
User avatar
Cossid
Site Admin
Posts: 262
Joined: Mon Mar 31, 2008 10:39 am
Location: Eau Claire, WI, USA
Contact:

Re: Alpha Testing: Phase 2

Post by Cossid »

Not at all. You're allowing it to go negative, and then just changing it to 0 when done. This means more metal is being created than you have ore for.
--Cossid AKA Caleb
Spectrum
Cadet
Posts: 31
Joined: Mon Oct 13, 2008 5:07 am
Contact:

Re: Alpha Testing: Phase 2

Post by Spectrum »

Lets back up a minute, the issue is how is metal stock handled - not how much metal is produced.

I was explaining how the refineries and stockpiles work - that is the issue.

handeling the actual metal is a different issue I figured you knew how to do that.
User avatar
Cossid
Site Admin
Posts: 262
Joined: Mon Mar 31, 2008 10:39 am
Location: Eau Claire, WI, USA
Contact:

Re: Alpha Testing: Phase 2

Post by Cossid »

Yes, I do know how to handle metal. I was just pointing out that what you posted cannot reliably refine ore or accurately adjust your metal stock.
--Cossid AKA Caleb
Spectrum
Cadet
Posts: 31
Joined: Mon Oct 13, 2008 5:07 am
Contact:

Re: Alpha Testing: Phase 2

Post by Spectrum »

Willis wrote:Yes, I do know how to handle metal. I was just pointing out that what you posted cannot reliably refine ore or accurately adjust your metal stock.
Must be something in VB because in c/c++/C# it is 100% reliable, accurate and FAST to do an if test than call a function such as Min.

I was adjusting Metal ORE not metal they are different.
User avatar
Cossid
Site Admin
Posts: 262
Joined: Mon Mar 31, 2008 10:39 am
Location: Eau Claire, WI, USA
Contact:

Re: Alpha Testing: Phase 2

Post by Cossid »

Yes, I understand you're adjusting Ore, and yes, the if statement is faster than the Min statement. But the if statement isn't the problem, by then, it's already wrong.
--Cossid AKA Caleb
Spectrum
Cadet
Posts: 31
Joined: Mon Oct 13, 2008 5:07 am
Contact:

Re: Alpha Testing: Phase 2

Post by Spectrum »

Do what you want - I was just trying to help and did not want to get into an argument about simple programing techniques.

Your original understanding of the manual was wrong - Refi cap is Fully automated as stated in the manual. Feel free to modify it as you want.

It is your game now.
Spectrum
Cadet
Posts: 31
Joined: Mon Oct 13, 2008 5:07 am
Contact:

Re: Alpha Testing: Phase 2

Post by Spectrum »

one last post.. from the version notes:

Code: Select all

Mining works as follows: 
          
          A miner will produce 40 times the metal value of the planet in
          a year. The old value was 10. 
          
          The refinery will refine 40 units of ore per year per refining
          unit installed, producing 40 units of metal. The old value was
          10. 
          
          Thus, on a 0.5 metal planet, a mining job with adequate
          refining capacity will produce 20 units of metal per year, the
          same as a service sector job. Since the cost of creating new
          refining capacity is the same a creating new service jobs, on
          high metal planets mining will be more advantageous than
          service sector. Of course, the standard of living is still
          lower for miners. 
          
          The ore stockpile setting does *not* affect refining, all
          available ore will be refined, any left over will be sold up to
          the stockpile value. 
This clearly demonstrates the difference between a mining job and the capacity.

There was a revision that set the amount mined from 40 to 30 but I dont see it right now, but it may have been an undocumented revision but at the time 30 was the correct value on CIS - I have revised the value in MW3TR to something else I dont remember and I dont have time to look.
beaker
Cadet
Posts: 50
Joined: Fri Apr 25, 2008 9:24 pm

Re: Alpha Testing: Phase 2

Post by beaker »

And all of this simply because i thought the excess stocks of ore would disappear... tsk tsk :lol:
Spectrum
Cadet
Posts: 31
Joined: Mon Oct 13, 2008 5:07 am
Contact:

Re: Alpha Testing: Phase 2

Post by Spectrum »

I know <sigh>

lets all kill beaker!
beaker
Cadet
Posts: 50
Joined: Fri Apr 25, 2008 9:24 pm

Re: Alpha Testing: Phase 2

Post by beaker »

I'm pretty sure that's already been done ;)
User avatar
Cossid
Site Admin
Posts: 262
Joined: Mon Mar 31, 2008 10:39 am
Location: Eau Claire, WI, USA
Contact:

Re: Alpha Testing: Phase 2

Post by Cossid »

Spectrum wrote:lets all kill beaker!
That's like shooting dead fish in a barrel.


Anyway, I've spent various free time researching how different methods work, and what numbers are correct.

I've come to the following conclusions:
I certainly mis-understood certain aspects of refining. Refining isn't people, it is machines, and while it's capacity is associated with people, it's function is not.
Therefore, refining rate would have to be a constant, which is that of the best efficiency on a 100% metal planet.

This all means that ore can eventually be refined (I did always think it was odd that my understanding didn't allow that).

Which brings me to the final issue: what number to use?
MW3 manual states 40% (0.4*), Spectrum claims 30% was used in CIS MW3.

My finding is that SE was certainly different. To the best of my calculations, SE was coming out at 53-58%. Of course, I know my calculations have a margin of error that forces them to be on the highest possible end of possible values. This is caused by taking values at a static time when there is snowball-like build up to get to those numbers. On the intentional 'low' end I was around 44% which puts an unweighted median at 51, but mathmatically that number would also be just slightly high.

So the deduction I came to was that SE was 50%

This means 50% metal planets is where Services became the better alternative to mining as well, which does in fact match at statement from Pitchonomics:
Pitchonomics wrote:Planets with Metal Ratings of less than 50% require a different style of PM in order for the planet to be successful. I suggest that if you wish to establish low metal planets that you experiment with the PM discussed under Low Metals PM]
I was previously using 40% but will likely be changing to 50% in my next update, but I haven't decided when to apply this just yet.
--Cossid AKA Caleb
User avatar
Cossid
Site Admin
Posts: 262
Joined: Mon Mar 31, 2008 10:39 am
Location: Eau Claire, WI, USA
Contact:

Re: Alpha Testing: Phase 2

Post by Cossid »

Live server has been updated to 50% (you should now be getting more metal for the same installed percentages).

Please let me know how this feels, I'll be monitoring it.
--Cossid AKA Caleb
Locked