FreeOrion

Forums for the FreeOrion project
It is currently Sun Dec 17, 2017 3:54 pm

All times are UTC




Post new topic Reply to topic  [ 19 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Tue May 30, 2017 6:00 pm 
Offline
AI Lead, Programmer
User avatar

Joined: Sat Sep 22, 2012 6:25 pm
Posts: 4390
Hi, so in this thread I had volunteered to work out compatibility issues between the current handling of ProductionQueue completion time projections (since I had done the latest big restructuring of it a few years back) and the implementation of an Imperial Stockpile, the current design thoughts for which I believe is mostly discussed in this thread. Ophiuchus has already implemented a fair amount regarding the Imperial Stockpile, but was having particular trouble getting the projections to work out reasonably well. While working through those issues I decided I needed to confirm my understanding of the consensus design points as well as propose a bit more. I'll also mention a bit of related programming concerns here as well, but the focus is on design.

The three biggest points that appear to be confirmed are that the efficiency of unused PP transfer into the Imperial Stockpile, and the max level of the Imperial Stockpile, would be determined by Empire meters, so that any relevant scripting could just deal with the meters and the actual transfer would be handled by backend C++ code that needs only refer to the Empire meters instead of itself getting into further Effects processing, and that individual queue items would only draw on the Imperial Stockpile if explicitly enabled to do so.

That sounds great to me so far, from both a design and implementability point of view. It is looking to me like many/most of the assumptions I had been able to rely on to so substantially improve the completion-time-projections efficiency in that previous restructuring are voided by the Imperial Stockpile, but I believe that restricting the draw-down on the stockpile will mean that I can still use that previous approach for all elements being built within resource groups that that do not have any items enabled to draw on the imperial stockpile. It will be much more CPU costly to deal with elements within a stockpile-drawing resource group, and I suspect that lower powered machines would not be able to handle the full 500 turns of potential advance projections that are currently possible with the regular projections code. (As a reminder, between the human player and the AI players this code gets invoked many times per turn, and had previously caused significant game slowdown.) So as one related design proposal I suggest we add a new projections turn limit for items within a stockpile enabled resource group (one that has the stockpile enabled for any queued item), and that both of these be easily customizable by the player via common_user_customizations.txt. Our default limit for stockpile-enabled resource groups might be simply 100 turns (anything more than that is mostly cosmetic anyways due to the uncertainty involved). But if that caused too slow of a game on anyone's machine they could reduce it to 10 or 20 turns and get nearly all of the practical value of projections still. Also keep in mind, when this is first implemented the AI will likely not quite yet be using the stockpile and so the effects of any slowdown won't be nearly so apparent as when the AI does start using it (and I expect that the first AI implementation, after never-use-stockpile, will be to always enable use of the stockpile, so it will come to matter fairly soon).

It looks like there was previously some small bit of discussion that stockpiles should not be location-dependent, in order to avoid stockpile-shifting micromanagement via some separately discussed supply ships. It seems to me though that would only be applicable to an idea of having stockpiles for *every* resource group, and is not applicable to an Imperial Stockpile located at the empire Capital. Considering the Imperial Stockpile to at least be generally associated with the empire Capital allows for some nice design considerations as I see it, relating to the transfer efficiency issue and to the possibility of Capital conquest/change, and is also most compatible with the small bit of existing stockpile code.

So far it seems to me that the transfer efficiency has only been contemplated/discussed as a constraint on inbound stockpile contributions. I would propose that we think about it as a smuggling efficiency kind of thing. If there were any unused PP within the resource group containing the empire's Capital, then it could be transferred in without a transfer penalty, and likewise, within that resource group draw-downs from the Imperial Stockpile could be made without transfer penalty (and just to be extra clear, those two things could inherently never happen on the same turn) (further note, even within the resource group containing the Imperial Stockpile, drawn-downs on the stockpile would still only be possible for elements explicitly designated to be able to draw on it). The transfer penalty would apply to transfers both into and out of the stockpile if the resource group was not the one for the empire Capital.

Regarding change or conquest of the empire Capital, I would probably leave the initial implementation be that the previous stockpile is simply lost. Whatever further provisions we might want to apply for either voluntary change in capital (building a new palace) or involuntary via conquest could probably be handled fine via scripting the Imperial Palace (in conjunction either with one or more related new specials or via new Effects specifically for handling such changes to the Imperial Stockpile). In any event I think that the initial Imperial Stockpile implementation can proceed while we are still figuring out whatever design details we'd want for those additional provisions.

Have I missed anything that was already agreed upon? What do you all think of my suggestions here?

Ophiuchus, I am hoping that I'll be able to cherry pick many of your implementation commits without change (or at least hopefully little change); I'm sure that in the process of that implementation you've thought through many issues I haven't touched on here, and we don't necessarily need to even get into those details, but if they interact with any of the points I raise above then it probably would be helpful to go ahead and start talking about them.

_________________
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0


Top
 Profile  
 
PostPosted: Wed May 31, 2017 11:41 am 
Offline
Creative Contributor
User avatar

Joined: Fri Jun 28, 2013 11:45 pm
Posts: 3295
Oooh, smugglers, I hadn't thought of it in that way.

OK, that takes me from ambivalent but can see the point to cautiously in favour but unsure of how to implement. I have zero doubts that once there is something to test I'll have strong opinions on how it works but I'm not as good at this sort of planning.

Are we still doing/linking in stealthy supply because I liked that idea quite a lot.

_________________
Mat Bowles

Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.


Top
 Profile  
 
PostPosted: Wed May 31, 2017 12:07 pm 
Offline
Vacuum Dragon
User avatar

Joined: Sun Sep 25, 2011 2:51 pm
Posts: 500
Alternatively, there could be two meters - one to be used for in-capital-resource-group stockpile gathering, which would abstract the logistic difficulties, and a second for out-of-capital-resource-group stockpile gathering, which would include smuggling, long distance logistics and maybe even trade.

_________________
[...] for Man has earned his right to hold this planet against all comers, by virtue of occasionally producing someone totally batshit insane. - Randall Munroe, title text to xkcd #556


Top
 Profile  
 
PostPosted: Wed May 31, 2017 5:20 pm 
Offline
Dyson Forest

Joined: Tue Sep 30, 2014 10:01 am
Posts: 227
Dilvish wrote:
Have I missed anything that was already agreed upon? What do you all think of my suggestions here?

Ophiuchus, I am hoping that I'll be able to cherry pick many of your implementation commits without change (or at least hopefully little change); I'm sure that in the process of that implementation you've thought through many issues I haven't touched on here, and we don't necessarily need to even get into those details, but if they interact with any of the points I raise above then it probably would be helpful to go ahead and start talking about them.

Hi Dilvish,

:o great you put so much thought in effort in that post. (YFYI I updated the implementation thread)

On consensus - there was a strong opinion that stockpiling should be penalized - I'm not sure if that only applied to remote supply groups.

I think adding a difference between the capital-supply-group and other supply groups will make the code slightly more complicated though. (Having to figure out if you are in the capital supply group and using different code depending on that). If you go that way, maybe add another meter for transfer inside that capital-supply-group (which could be set to 100% as default via a ?starting technology?), also for experimentation purposes.

I personally don't mind having the stockpile located at ones imperial palace. There was some discussion about it. Also there was the opinion that the old mechanism was not worth saving and could be done away.

What I would also like to have is a configuration/command line parameter for a starting stockpile (0 PP would be default). Probably scripting this would also suffice. Having starting PP helps in testing and user-vs-user games (its really fun to start with 500PP in the pile and having to decide when to use these), probably that would be also nice for testing what AI would do with PP.

On the combination of capital-supply-group and stealthy supply: I guess stealthy supply would extend the supply group. So if the stealthy supply extends the capital-supply-group to a planet, that planet should get the benefit of being in that capital-supply-group.

I see stealthy supply as an issue mostly orthogonal to imperial stockpile (i.e. I think it can be coded independently of each other), but probably we need to advance the discussion if we want to get it into the coming release.

_________________
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.


Top
 Profile  
 
PostPosted: Wed May 31, 2017 5:29 pm 
Offline
Dyson Forest

Joined: Tue Sep 30, 2014 10:01 am
Posts: 227
Dilvish wrote:
So far it seems to me that the transfer efficiency has only been contemplated/discussed as a constraint on inbound stockpile contributions. I would propose that we think about it as a smuggling efficiency kind of thing. ... The transfer penalty would apply to transfers both into and out of the stockpile if the resource group was not the one for the empire Capital.

I framed it more as the economic problem of knowing when which goods will be needed in future. (I'm pretty sure there is a technical term for it).

Smugglers are fun as well ;)

So if we will have two meters, one could be the future-demand meter (stockpile input penalty) and the other one the smuggler meter (transfer penalty). :lol:

_________________
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.


Top
 Profile  
 
PostPosted: Fri Jun 09, 2017 8:32 am 
Offline
Dyson Forest

Joined: Tue Sep 30, 2014 10:01 am
Posts: 227
Some relevant links:

Imperial stockpile & production queue refactoring thread

Feature for imperial stockpile - Indicate how much PP is wasted (percentage)

_________________
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.


Top
 Profile  
 
PostPosted: Thu Jun 15, 2017 1:05 am 
Offline
Programming, Design, Admin
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 12045
Location: Munich
Dilvish wrote:
If there were any unused PP within the resource group containing the empire's Capital, then it could be transferred in without a transfer penalty, and likewise, within that resource group draw-downs from the Imperial Stockpile could be made without transfer penalty...
The transfer penalty would apply to transfers both into and out of the stockpile if the resource group was not the one for the empire Capital.
Ugh, no, for various reasons. Most importantly, the indicator of how much is in the stockpile should indicate how much is in the stockpile, not some abstract amount of PP that gets modified through complicated mechanics by location to determine what is actually usable.
Quote:
Regarding change or conquest of the empire Capital, I would probably leave the initial implementation be that the previous stockpile is simply lost.
For the initial implementation, have the capital be irrelevant, and the mechanics simple. The stockpile is located nowhere and everywhere, and cannot be captured, and can be used anywhere by the empire, and with no additional limits.

Additional complications/limitations can be added later, including various species traits or buildings scattered around the empire that give stockpile-related boosts (eg. increase capacity) and buildings or species that grant access to put PP in or take PP from the stockpile at supply-connected planets. Such buildings can later be made vulnerable to espionage that affect stockpiles. Alternatively, if necessary for balance, the amount of PP usable from the stockpile within a resource-sharing group can be limited in various ways, such as proportional to the PP output in that group.


Top
 Profile  
 
PostPosted: Thu Jun 15, 2017 1:34 am 
Offline
AI Lead, Programmer
User avatar

Joined: Sat Sep 22, 2012 6:25 pm
Posts: 4390
Geoff the Medio wrote:
Ugh, no, for various reasons...
Ah, it looks like you just posted these comments as I was putting up the 3 PRs related to this, of which the final one is for the main Imperial Stockpile implementation, so I haven't had any time to consider your comments in depth and the initial version of the Imperial Stockpile posted is more along the lines of what I discussed above. I tried to make the code pretty flexible in this respect, though-- changing when there is a penalty on contributions, and whether or not there is any penalty on drawdowns, will be very easy to adjust at this point.

As far as the location of the stockpile goes, it is currently somewhat associated with the capital (at least with regards to contributing and drawdowns) but I haven't yet done anything to implement any loss of stockpile upon loss or change of capital.

_________________
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0


Top
 Profile  
 
PostPosted: Sun Aug 13, 2017 7:11 pm 
Offline
Dyson Forest

Joined: Tue Sep 30, 2014 10:01 am
Posts: 227
List of things to do:
  • (done)fix the info in the map window (waste icon tooltip) on the amount wasted. At the moment, PP going into stockpile is counted as waste - got information how much is wasted and how much goes to the stockpile
  • (done)info for the player about the PP-to-stockpile-transfer ratio (if its supply group dependent it needs to go to the production window, else the map window is a good place) - implemented in map window
  • (TODO - need help)info about the effects which change the stockpile limit, stockpile transfer rate etc (not sure how to do code this)
  • (done) check the production window if changes are necessary to reflect the imperial stockpile - have a basic implementation
  • (done) add techs - basics done
  • (later)(optional) add two different waste icons in the map window, so you see if you are filling up the stockpile or wasting resources. If nothing goes to waste or stockpile: hide it; a yellow rectangular if PP go to stockpile, but no excess waste; a red triangle: there is waste exceeding the stockpile. If we allow conversion rate to be 100%, the rectangular should be green.
  • (done)(optional) I would like to re-add the imperial extraction limit and up the maximum stockpile. This allows you to stockpile in advance, but the extraction limit ensures you cant
  • (optional) make the AI use the stockpile
  • (optional) rule support for imperial stockpile - also possibility to add starting PP there
As about the idea to make the capital supply group special - after looking at the implementation I think it complicates things. It makes it harder for the player to understand what happens and UI needs to more complicated. Also if we keep it like it is now (transfer from capital supply group to stockpile is lossless), AI needs to be able to use it because it gives a pretty unfair advantage to the human player.

Also making the extraction from the stockpile location dependent is a no-go I think. How would I communicate this in the UI?

The idea of this imperial stockpile is to help expansion outside of the supply group (it originated from the supply ship discussion).

Making the capital supply group special is not adding anything to this idea.
I'd like to hear compelling use cases for that special treatment, else i would kick it out for the moment.

edit: changed icon indication idea from showing percentage of waste to indicate if the stockpile gets exceeded

_________________
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.


Last edited by Ophiuchus on Tue Aug 22, 2017 8:49 am, edited 2 times in total.

Top
 Profile  
 
PostPosted: Sun Aug 13, 2017 9:04 pm 
Offline
Programming, Design, Admin
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 12045
Location: Munich
Ophiuchus wrote:
Also making the extraction from the stockpile location dependent is a no-go I think. How would I communicate this in the UI?
In the production screen, show a line of text or an icon that indicates that the selected location can or can't access the stockpile.

That said, as I wrote above, any such extra complications can be added later. The first implementation should be simple and not treat any location different from any other.


Top
 Profile  
 
PostPosted: Tue Aug 22, 2017 8:45 am 
Offline
Dyson Forest

Joined: Tue Sep 30, 2014 10:01 am
Posts: 227
Making some progress with the implementation.
Added extraction limit.
Added techs and interspecies academy.
Giving helpful info about stockpile in production and map.

Actually playing a game with the imperial stockpile showed that having a stockpile limit leads to micromanagement.
I was juggling projects with pause/unpause as i needed to fill up the stockpile but not exceed the maximum. That pretty much sucks.

There are multiple ways i could go and id like to get the community feedback:

* remove stockpile limit altogether (KISS, limit the extraction takes care of making stockpiling too powerful)
* make the stockpile limit large enough so the issue doesnt occur so often (if it is big enough to hold PP for a single project you can fill it up once and dont need to juggle)

I have a strong preference for to throw away the stockpile limit because I dont see the benefit of it.

Just more notes on the game:
  • i used laenfa, like 40 systems per player, low planets, high starlines, aggressive AI, mediumeverything else
  • lead to situation where hidden expansion made sense (because you can go for the great planets far away instead of the mediocre ones closeby).
  • got juggernaut nest, was really helpful in defending my non-laenfa natives (i didnt have military and military tech in the early game)
  • in midgame i got ahead of the detection game to rely on stealth defend my non-laenfa planets, then amassed my military to strike against a single enemy (around turn 75 i think, maybe a bit later)
  • AI was too careful which hindered its expansion - it should probably know about distances to enemies?
  • there were mostly two situations where the stockpile was actually the logical choice to use
  • 1) after getting the +5 flat bonus a disconnected system contributed to the stockpile
  • 2) building a exobot colony on a sneaky outpost in an enemy system (which took ages as a could only use 5PP per turn to build it)
  • Although with phototrophic species there are less great planets than for others (you need the combination of a bright star plus a good planet type), there were still too many planets where colonization was good (removing the pressure to look further away). This could be countered by e.g. a really-low-planets galaxy setting, making low-population planets less useful (NAI, auto-factories), or changing the habitable planet limits

_________________
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.


Top
 Profile  
 
PostPosted: Tue Aug 22, 2017 10:04 am 
Offline
Programming, Design, Admin
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 12045
Location: Munich
Ophiuchus wrote:
remove stockpile limit altogether (KISS, limit the extraction takes care of making stockpiling too powerful)
Sounds reasonable to me...


Top
 Profile  
 
PostPosted: Thu Aug 24, 2017 7:51 am 
Offline
Release Manager, Design
User avatar

Joined: Wed Nov 16, 2011 12:56 pm
Posts: 4305
Location: Sol III
Ophiuchus wrote:
I have a strong preference for to throw away the stockpile limit because I dont see the benefit of it.
I agree with that. Lets try the simpler approach (without this limit) first and see if the extraction limit is sufficient to prevent the stockpile mechanic from becoming too powerful. If it doesn't work out, we can still add that later (or try to come up with other tweaks).


Top
 Profile  
 
PostPosted: Thu Dec 07, 2017 1:41 pm 
Offline
Dyson Forest

Joined: Tue Sep 30, 2014 10:01 am
Posts: 227
Any objections to making the stockpile value into an empire meter so also scripting has its chance?

The occasion is I want to script the DISP, the BLD_DEEP_IMPERIAL_SPACE_PROGRAMME which is like a AUTO_HISTORY_ANALYSER but for imperial stockpile PP and only-once-per-empire.

_________________
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.


Top
 Profile  
 
PostPosted: Thu Dec 07, 2017 6:12 pm 
Offline
Programming, Design, Admin
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 12045
Location: Munich
Ophiuchus wrote:
Any objections to making the stockpile value into an empire meter...
What do you mean by "the stockpile value" ?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 19 posts ]  Go to page 1, 2  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group