Author Topic: Stockpile energy thoughts  (Read 5131 times)

0 Members and 1 Guest are viewing this topic.

Offline Yitzi

Stockpile energy thoughts
« on: September 30, 2013, 11:13:17 PM »
I've begun the investigation to fix the stockpile energy bug, and begun thinking about what would happen instead...

The most logical way to do it, I think, is as follows:
Case 1:If you finish something (doesn't matter what), and the next thing in your queue is stockpile energy, and the "build multiple things per turn" feature (which I will add while I'm at it, as it's the same area of the code) is on, any leftover minerals (up to a maximum equal to the usual maximum carry-over minerals) are immediately turned into energy.  Your production is then set to stockpile energy.  Changes in this case: 1. Any minerals already used for producing the facility are not turned into energy.  2. Any minerals over the maximum carry-over are not turned into energy.  (This makes sense; if they can't be used to make another unit or facility, why can they be made into energy?).  3. If you can't build multiple things per turn, you won't get any extra energy when you finish a facility or unit (also makes sense; if you can't use those extra minerals for a scout patrol until next turn, the same should go for turning them into energy.)  4. If it is turned into energy, those minerals are removed from production.  (This is the flip-side of #1: If you use it for production, it can't become energy.  If you use it for energy, it can't become production.)
Case 2:If you finish something with nothing left in the queue, and is set to automatically stockpile (e.g. a facility; I believe that this is customizable to some extent in-game) it switches to stockpiling energy but will not stockpile any energy this turn.  This is to allow you a chance to change production before losing it if you don't like messing with queues.  Changes in this case are the same as case 1, except that you don't get any extra energy (and don't lose production) regardless of whether it's possible to build multiple things per turn.  This doesn't make you lose energy, it's just delayed, because:
Case 3:If you are already "building" stockpile energy, any accumulated production is added to your per-turn production (and then used up when you get energy from stockpile).  This lets you "cash in" accumulated production if you want (at the usual inefficient rate of stockpile energy).  It also means that if a base is producing only 1 mineral per turn (and is therefore not going to produce anything via stockpile energy) it can be set to build something else and then cashed in once it's enough.  That's a bit of a hassle, though, and there's really no logical reason you shouldn't be able to make use of production that doesn't boost your energy anyway, so:
Case 4: Stockpile energy will give as much energy as it can, but any minerals not needed for that much energy will not be used, and will just be stored up as stored production.
Finally, two more changes while I'm at it:
1. The Planetary Energy Grid adds 25% to your minerals being turned into energy, rather than your actual energy received, i.e. it is not rounded down beforehand.  So, for instance, 7 minerals will be turned into 4 energy rather than 3 with the Planetary Energy Grid.  (This is simply because the less effect rounding has, the better).
2. While stockpile energy normally gives 1 energy per 2 minerals, it will be possible to change that, with the minerals to produce 1 energy being the value at "cost" for stockpile energy.  (So by default that will be 2, if you change it to 5 then you only get 1 energy per 5 minerals.)

So...thoughts?  Comments?  Criticisms?  Suggestions?  Nothing's been implemented yet, so it's easy to change any plans at this point.

Offline JarlWolf

Re: Stockpile energy thoughts
« Reply #1 on: September 30, 2013, 11:21:59 PM »
I think that it should remain that there be no efficient surefire way to convert minerals to energy by switching production. Something like that can be horribly abused and lead to more problems.

An example of that would be,

Someone is building up a high mineral building/unit, and then at the last second they switch their production to stockpile energy. If there was efficient mineral-energy conversion you'd just have people abusing changing production ques just to bootleg energy.

So keep it as is, it seems balanced to me. If someone counters and states, what if you have loads of leftover minerals from a failed project, well then I'd reply: That's your fault and problem for not finishing the project. Use those over abundant minerals to make a colony pod, we need more people.  ;lol  :danc:



"The chains of slavery are not eternal."

Offline Yitzi

Re: Stockpile energy thoughts
« Reply #2 on: September 30, 2013, 11:58:14 PM »
I think that it should remain that there be no efficient surefire way to convert minerals to energy by switching production. Something like that can be horribly abused and lead to more problems.

An example of that would be,

Someone is building up a high mineral building/unit, and then at the last second they switch their production to stockpile energy.

Then they get the same energy as they would if they'd just used stockpile energy the whole time.

This doesn't let you convert minerals to energy any more efficiently than stockpile energy already would (except that it vastly decreases losses due to rounding*); the only real change is that you can change it and the stuff you were building is treated as if you'd been stockpiling all the time.

Although...maybe it should be made to have the usual production-change penalty.


*Instead of a maximum of .5 energy per base per turn, or up to 1.375 energy per base per turn with the Planetary energy grid, you lose nothing due to rounding without the PEG, or a maximum of 0.5 per base per turn with it.

Quote
So keep it as is, it seems balanced to me.

Well, the stockpile energy bug is definitely not balanced, so something has to change; the question here is whether you should be able to change production to stockpile at no penalty (but the same low efficiency stockpile always gets), or at the usual 50% penalty for everything after the first 10 minerals (on top of said low efficiency), or not at all.

What do you think of the other features (getting the energy the turn you finish the last thing if you have multibuild and queued stockpile, and having it stay as production otherwise, and letting leftover minerals carry over when stockpiling)?

Offline Nexii

Re: Stockpile energy thoughts
« Reply #3 on: October 01, 2013, 05:56:40 AM »
It would be game changing for sure.  You would be able to drop everything in production to get energy to rush a secret project.  Granted it's not very efficient because its 2 mineral per 1 energy then you're spending 4 energy per 1 mineral (assuming no other exploits).  I think it's fine to allow this without an additional switching penalty.

I think carrying forward the excess minerals while stockpiling is fine too.  Would it be possible to convert them as they get to the required amount on subsequent turns (i.e. 1 mineral production base, first turn it stores the mineral, second turn you get 1 energy and it goes back to 0 minerals)?

While on the topic, if multiple builds are allowed per turn, would multiple rush buys be possible in the same base?  For example if I have 20 minerals and want to rush a Recycle Tanks and Rec Commons.  Would it be 40 for the Recycle tanks and 160 for the Rec Commons?   Or would it be 120 since I have 10 minerals already towards both.   I would say the latter...I think I'd say that if you rushed one item then the 'first 10 minerals' penalty wouldn't apply to any subsequent purchases.

Offline Yitzi

Re: Stockpile energy thoughts
« Reply #4 on: October 01, 2013, 12:12:40 PM »
It would be game changing for sure.  You would be able to drop everything in production to get energy to rush a secret project.  Granted it's not very efficient because its 2 mineral per 1 energy then you're spending 4 energy per 1 mineral (assuming no other exploits).

"Not very efficient" is the least of it; building units (not crawlers) to disband in the project-building base is roughly four times as efficient.

Quote
I think carrying forward the excess minerals while stockpiling is fine too.  Would it be possible to convert them as they get to the required amount on subsequent turns (i.e. 1 mineral production base, first turn it stores the mineral, second turn you get 1 energy and it goes back to 0 minerals)?

That's the idea: Because you're adding whatever's accumulated, the first turn it stores the mineral and the second it adds that one to whatever it's got for a total of 2, so it converts it to 1 energy.

Quote
While on the topic, if multiple builds are allowed per turn, would multiple rush buys be possible in the same base?

Only by rushing to enough minerals to build both things, and only if the carry-over is allowed to be at least the cost of the second item (as multibuild just lets you build multiple things if enough minerals carry over; it doesn't let you carry over more than before).

Offline gwillybj

Re: Stockpile energy thoughts
« Reply #5 on: October 01, 2013, 12:54:52 PM »
:scratch:
I like this part of Case 1:
3. If you can't build multiple things per turn, you won't get any extra energy when you finish a facility or unit (also makes sense; if you can't use those extra minerals for a scout patrol until next turn, the same should go for turning them into energy.)  4. If it is turned into energy, those minerals are removed from production.  (This is the flip-side of #1: If you use it for production, it can't become energy.  If you use it for energy, it can't become production.)

And all of case 2:
Quote
Case 2:If you finish something with nothing left in the queue, and is set to automatically stockpile (e.g. a facility; I believe that this is customizable to some extent in-game) it switches to stockpiling energy but will not stockpile any energy this turn.  This is to allow you a chance to change production before losing it if you don't like messing with queues.  Changes in this case are the same as case 1, except that you don't get any extra energy (and don't lose production) regardless of whether it's possible to build multiple things per turn.  This doesn't make you lose energy, it's just delayed...

The PEG change looks good, too.
Two possibilities exist: Either we are alone in the Universe or we are not. Both are equally terrifying. ― Arthur C. Clarke
I am on a mission to see how much coffee it takes to actually achieve time travel. :wave:

Offline Yitzi

Re: Stockpile energy thoughts
« Reply #6 on: October 01, 2013, 02:24:39 PM »
It occurred to me...the whole point of multibuild is to let high-production bases build multiple cheap units at once.  But that won't happen due to the limit of 10 minerals carried over.  One option is simply to let more be carried over, which makes sense anyway so that high production bases lose less of their total production...the problem, though, is that then if you want to hurry a project you could instead build a cheap facility, hurry it (at the cheaper per-facility cost) to enough to build the facility and the project, queue the project, and effectively hurry the project at a cheaper cost.

It would be possible to have the high carry-over be only for things in the same category, but that would be a bit more difficult and still would leave problems (e.g. using a scout patrol hurry to hurry an expensive unit from scratch and bypass the high cost for hurrying expensive units, and that you'd lose a lot of minerals in high-production bases when switching types); perhaps the best way is just, if using multibuild, to have a rule (it's not like there aren't already anti-exploit rules) that you can't hurry to more than 10 minerals past completion if it would decrease the hurry price on something later in your queue (or hurry and then add something to your queue that is thereby hurried for cheap.)

Also, Jarlwolf, I'm wondering if I've persuaded you that the resulting ability to turn stored minerals into energy is not efficient, and is therefore no more of a problem than normal Stockpile Energy is.  (Everyone else seems ok with it, and it'd be easier to code with that happening than to prevent it but still be able to eliminate the rounding losses.)

Offline Nexii

Re: Stockpile energy thoughts
« Reply #7 on: October 01, 2013, 06:37:01 PM »
I think the fix would be to jump the cost based on the next thing on the queue, and cap each rush to fill the mineral rows of the current thing in production.  Example rushing a Recycling tanks with 10 minerals done.  Limit is 60 energy towards it...any thing beyond 60 energy gets the rate of the next item.  However this could get complex indeed with queue switching.

Would it be simpler if rushing to fill every mineral (i.e. turns to complete = 0) gave you the facility, unit, SP immediately?  Granted this would have a big game impact.  But as it is you're best off rushing to 1 turn to completion (which requires manual calculation) to avoid going over the 10 mineral excess cap.

Another fix to simplify might be just to remove the doubling in cost for rushing before the first 10 minerals.  I never really understood the need for this, when rushing is already very expensive.  Maybe it was intended to make the -SUPPORT SE more punitive for new bases.  Alternatively this doubling could be removed only for rushes beyond the first *when you already had 10 minerals on the first rush*.  But that's more to keep track of.

Offline Geo

Re: Stockpile energy thoughts
« Reply #8 on: October 01, 2013, 09:35:14 PM »
Finally, I get the impact of what's discussed here. Thanks Nexii. ;)

Offline Yitzi

Re: Stockpile energy thoughts
« Reply #9 on: October 01, 2013, 10:10:09 PM »
Would it be simpler if rushing to fill every mineral (i.e. turns to complete = 0) gave you the facility, unit, SP immediately?  Granted this would have a big game impact.  But as it is you're best off rushing to 1 turn to completion (which requires manual calculation) to avoid going over the 10 mineral excess cap.

Giving it immediately would be too large an impact, not to mention being a huge pain to code.  Giving it as the rate of the next item of the queue would be easier, but still tricky, and I still don't really see that much need for it; without it there isn't a problem unless you rush to overflow by more than 10 minerals (which can be banned), with it there is still a problem if you queue switch.  The only thing it would really help with is if you want people to be able to rush (as opposed to build normally) multiple things in a single turn.  Thoughts?

Quote
Another fix to simplify might be just to remove the doubling in cost for rushing before the first 10 minerals.  I never really understood the need for this, when rushing is already very expensive.

Firstly, rushing really isn't that expensive when you consider that energy is a lot easier to boost than minerals.  Secondly, I think the idea is so that you make at least some through production, and they just didn't consider that you could rush to 10 overflow.

In any case, making the option to remove that doubling would be more work than I think it's worth at this point in time; the only real concerns here, as far as I see, are (1) making Stockpile make sense, and (2) allowing high-production bases to build more than one thing a turn, without allowing exploits to make rushing cheaper.

Offline Yitzi

Re: Stockpile energy thoughts
« Reply #10 on: October 02, 2013, 02:40:01 AM »
I have made a discovery that changes things somewhat: If you have more production stored than is needed to build the current thing, the extra production is lost and none of it carries over; the 10 minerals carry-over is only for what you got this turn.  Thus, the concern about hurrying an extra amount so that you can hurry at the cheaper price is simply not an issue; you can never carry over more than your production for this turn.
Stockpile energy will still allow carry-over, though, I think...it's slightly easier to code, but more importantly it means that a finished facility can have the extra not immediately changed to stockpile energy (so that you have a chance to build something else instead and not lose the extra), but if you do keep it on stockpile energy the extra isn't lost.  That does mean that you can "cash in" a half-produced facility to get the money you would have gotten by stockpiling that whole time, but that's no more efficient than regular stockpile, or selling facilities, so I don't think it would be an issue.

I also found that the amount that carries over is not quite unchangeable; it's set to be equal to the size of a row at +0 INDUSTRY (i.e. no matter what your INDUSTRY is, it's the number of minerals per row at +0).  Still, I think it could do with being made separately changeable.

Offline Nexii

Re: Stockpile energy thoughts
« Reply #11 on: October 02, 2013, 03:26:02 AM »
I discovered something else while playing around with customized mineral penalty/carryforward: the exempt minerals variable is also used as the mineral carry forward cap.  I put the exempt minerals to 20 and the game lets me carry forward 20 minerals instead of 10.  This is why going to +5 INDUSTRY doesn't change the fact that you still need 10 minerals by default to get the normal rush price (even though it would be 2 full rows of 5 minerals each in that case).

But I suppose that is good.  What does this imply for rushing to 1 turns completion vs 0 turns completion?  I'm seeing the same for rushing to 0 turns completion in bases with over 10 minerals production: the excess minerals are simply lost.  I'm not able to trigger the "Classic Stockpile" bug through empty queue or stockpile queue, is there something I'm missing here?

One could argue with multi building that even carrying forward 10 minerals would be a minor exploit.  It's cheaper to excess build a facility by 10 minerals and queue on a Scout Infantry in that case, rather than to just build the facility to 1 turns completion and rush the Scout Infantry the next turn.  What if for queue switches, you simply used the value of the excess *energy* rather than minerals, and converted it to what that energy would buy towards the next thing?  Would that be simpler?

Maybe all excess minerals should get stored and if stockpile energy isn't switched off then on the next turn it's all converted (plus that turn's stockpile energy).

Another bug I noticed with building and the city screen is that it assumes 10, 50% I believe when calculating the turns it will take to complete a switched thing.  For example a base with 40 minerals producing 7/turn and making a Recycling tanks, it'll show 3 turns if I switch to Rec Commons, even if I put the variables at 0, and 0% (no penalty).   It does display correctly once you've actually switched.

Offline Yitzi

Re: Stockpile energy thoughts
« Reply #12 on: October 02, 2013, 03:52:50 AM »
I discovered something else while playing around with customized mineral penalty/carryforward: the exempt minerals variable is also used as the mineral carry forward cap.

You're right, my mistake.

Quote
But I suppose that is good.  What does this imply for rushing to 1 turns completion vs 0 turns completion?  I'm seeing the same for rushing to 0 turns completion in bases with over 10 minerals production: the excess minerals are simply lost.  I'm not able to trigger the "Classic Stockpile" bug through empty queue or stockpile queue, is there something I'm missing here?

Hmm...I thought it was unfixed, but it seems that Kyrub sort-of fixed it.  That is, he fixed it, but in the process he broke some other stuff, in that now (1) the extra minerals are completely wasted, when logically you should at least get for what you had beforehand, and (2) Stockpile Energy doesn't work properly even when you're not trying to exploit the bug.  (It simply gives you no energy for the first turn.)

Quote
It's cheaper to excess build a facility by 10 minerals and queue on a Scout Infantry in that case, rather than to just build the facility to 1 turns completion and rush the Scout Infantry the next turn.

Except that if you excess-rush, you lose the excess.  You never carry over more than the base's mineral production.

Quote
What if for queue switches, you simply used the value of the excess *energy* rather than minerals, and converted it to what that energy would buy towards the next thing?  Would that be simpler?

No, and it'd still allow for unusual behavior.  I think the best way is simply that the carry-over is capped at the base's production, so you can never hurry past 100% completion and get an advantage that way.

Quote
Maybe all excess minerals should get stored and if stockpile energy isn't switched off then on the next turn it's all converted (plus that turn's stockpile energy).

That's the idea; the only exception would be if you explicitly queue stockpile with multibuild on; in that case, they turn into energy immediately.

Quote
Another bug I noticed with building and the city screen is that it assumes 10, 50% I believe when calculating the turns it will take to complete a switched thing.  For example a base with 40 minerals producing 7/turn and making a Recycling tanks, it'll show 3 turns if I switch to Rec Commons, even if I put the variables at 0, and 0% (no penalty).   It does display correctly once you've actually switched.

That's a different part of the code, and as a minor display bug it's just not enough to make the short list.  Once I start taking general requests, it's definitely a valid request, though.

Offline Nexii

Re: Stockpile energy thoughts
« Reply #13 on: October 02, 2013, 04:51:12 AM »
Another minor and longstanding exploit is that you can rush a facility and then pay the 50% switching cost to a unit, and come out ahead (related to what I mentioned before).  Only is true however when not much has been produced towards the current.  Not sure this can be fixed without making unit rush costs linear and it's probably not related to stockpile energy directly anyways. 

[I think the best way is simply that the carry-over is capped at the base's production, so you can never hurry past 100% completion and get an advantage that way.]

Is this assuming multi building or in both cases?  This seems like a logical start, since then you will never lose the excess minerals for rushing to turns:0 which the game wants you to do by default.   I assume that if you switch down (i.e. something expensive to cheap) then the carried forward minerals in excess of production would get auto-converted back to energy on the next production turn?  I think if Stockpile energy isn't explicitly selected then they should still go to energy rather than be lost.

Offline Yitzi

Re: Stockpile energy thoughts
« Reply #14 on: October 02, 2013, 12:27:07 PM »
Another minor and longstanding exploit is that you can rush a facility and then pay the 50% switching cost to a unit, and come out ahead (related to what I mentioned before).  Only is true however when not much has been produced towards the current.  Not sure this can be fixed without making unit rush costs linear and it's probably not related to stockpile energy directly anyways. 

It's not related, and there's no real way to fix it.  But it can't be used to bring unit hurry cost below 4 credits/mineral, which is fairly expensive even with multipliers being more prevalent for economy than minerals.  (For facilities, 1 energy "on the map" is actually as helpful as as one mineral "on the map" for much of the game because economy is boosted so much more than minerals.  And it doesn't cause ecodamage, so you can get more of it.)

Quote
Is this assuming multi building or in both cases?

Both cases.

Quote
I assume that if you switch down (i.e. something expensive to cheap) then the carried forward minerals in excess of production would get auto-converted back to energy on the next production turn?

No, they'd be lost; there's no easy way to tell between that and rushing past completion.

Quote
I think if Stockpile energy isn't explicitly selected then they should still go to energy rather than be lost.

The way I'm planning, it will, though not until the next turn.

 

* User

Welcome, Guest. Please login or register.
Did you miss your activation email?


Login with username, password and session length

Select language:

* Community poll

SMAC v.4 SMAX v.2 (or previous versions)
-=-
24 (7%)
XP Compatibility patch
-=-
9 (2%)
Gog version for Windows
-=-
103 (32%)
Scient (unofficial) patch
-=-
40 (12%)
Kyrub's latest patch
-=-
14 (4%)
Yitzi's latest patch
-=-
89 (28%)
AC for Mac
-=-
3 (0%)
AC for Linux
-=-
6 (1%)
Gog version for Mac
-=-
10 (3%)
No patch
-=-
16 (5%)
Total Members Voted: 314
AC2 Wiki Logo
-click pic for wik-

* Random quote

Beware, you who seek first and final principles, for you are trampling the garden of an angry God, and He awaits you just beyond the last theorem.
~Sister Miriam Godwinson 'But for the Grace of God'

* Select your theme

*
Templates: 5: index (default), PortaMx/Mainindex (default), PortaMx/Frames (default), Display (default), GenericControls (default).
Sub templates: 8: init, html_above, body_above, portamx_above, main, portamx_below, body_below, html_below.
Language files: 4: index+Modifications.english (default), TopicRating/.english (default), PortaMx/PortaMx.english (default), OharaYTEmbed.english (default).
Style sheets: 0: .
Files included: 45 - 1228KB. (show)
Queries used: 42.

[Show Queries]