FreeOrion

Forums for the FreeOrion project
It is currently Sat Dec 16, 2017 7:18 am

All times are UTC




Post new topic Reply to topic  [ 42 posts ]  Go to page Previous  1, 2, 3  Next
Author Message
PostPosted: Sun Oct 23, 2016 5:34 pm 
Offline
Programmer

Joined: Sun Feb 14, 2016 12:08 am
Posts: 359
Quote:
I rebased the code.

Something went wrong, if "git rebase master" does not resolve, it may be easier to cherry-pick to a clean branch (could probably clean it up with reflog, but that may be tricky).
e.g. (what I typically do)
Code:
git branch -m scripting-supply-ships old_supply-ships
git checkout master
git checkout -b scripting-suppy-ships
git cherry-pick 2a63ea2  8195371 8b7f24a ec726d2
git push ---force --set-upstream origin scripting-supply-ships


Quote:
Splitting out the population center change

cherry-pick should do fine, the new branch should base off of master.

Quote:
...where industry is below zero...

The meter clamp for industry on resource centers is a minimum of 0.0f.
I'd say it is a safe assumption that industry will not be negative, without tracking it down further.

Quote:
...not decided on what kind of planets...

To help decide, you might count the existing playable species by planet type (and maybe even weight each species by how often you play them).
Edit: Rough pass on existing species


Top
 Profile  
 
PostPosted: Thu Oct 27, 2016 12:20 am 
Offline
Dyson Forest

Joined: Tue Sep 30, 2014 10:01 am
Posts: 221
dbenage-cx wrote:
Quote:
I rebased the code.

Something went wrong,

So I think I cleaned up the mess:
diff scripting-supply-ships
diff industrious-outposts

dbenage-cx wrote:
Quote:
...where industry is below zero...

The meter clamp for industry on resource centers is a minimum of 0.0f.
I'd say it is a safe assumption that industry will not be negative, without tracking it down further.

Removed the min and max

dbenage-cx wrote:
Quote:
...not decided on what kind of planets...

To help decide, you might count the existing playable species by planet type (and maybe even weight each species by how often you play them).
Edit: Rough pass on existing species

Wow, thats a great document. I shifted to radiated planets as it is a nice niche and it fits the theme of the species as well to hide on undisputed planets (at least as long as there are no exobots).

What is the next step? To send pull requests so others can test?

_________________
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 Oct 27, 2016 5:07 am 
Offline
Programmer

Joined: Sun Feb 14, 2016 12:08 am
Posts: 359
Quote:
What is the next step? To send pull requests so others can test?

Supply ships probably needs some discussion on if it should be included.
Could you provide a proposal (e.g. "how and why the idea improves the game") to help fuel feedback?
The existing implementation will help clarify what is being proposed.

I would go ahead with a PR for industrious-outposts, as no issues have been raised about it so far.


Top
 Profile  
 
PostPosted: Thu Oct 27, 2016 11:54 am 
Offline
Programming, Design, Admin
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 12042
Location: Munich
dbenage-cx wrote:
...for industrious-outposts, as no issues have been raised about it so far.
Except for the reasons, as far as I can recall, why thing were implemented so that outposts had clamped 0 industry output.

I believe it was so that a planet that is depopulated doesn't continue producing industry (or other resources) for several / many turns after losing its population, as the current meter change mechanics have a relatively slow decay (and growth) rate, so that even if the target is 0 due to having no population, it would still take a long time to decay to 0 if it started out relatively high.

After a brief search, I also found this argument:
viewtopic.php?p=49523#p49523
which was that it was partly to avoid the micromanagement of having to put outposts everywhere to get the resulting resource output from them.


Top
 Profile  
 
PostPosted: Thu Oct 27, 2016 6:58 pm 
Offline
Dyson Forest

Joined: Tue Sep 30, 2014 10:01 am
Posts: 221
I wrote in game design to start discussion about the supply ship feature:
viewtopic.php?f=6&t=10308

_________________
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 Oct 27, 2016 7:01 pm 
Offline
Dyson Forest

Joined: Tue Sep 30, 2014 10:01 am
Posts: 221
Hi Geoff,

Geoff the Medio wrote:
dbenage-cx wrote:
...for industrious-outposts, as no issues have been raised about it so far.
Except for the reasons, as far as I can recall, why thing were implemented so that outposts had clamped 0 industry output.

I believe it was so that a planet that is depopulated doesn't continue producing industry (or other resources) for several / many turns after losing its population, as the current meter change mechanics have a relatively slow decay (and growth) rate, so that even if the target is 0 due to having no population, it would still take a long time to decay to 0 if it started out relatively high.

Depopulation still works (I'm pretty sure I tested it), so when a planet gets depopulated all the meters are set zero.

Geoff the Medio wrote:
After a brief search, I also found this argument:
viewtopic.php?p=49523#p49523
which was that it was partly to avoid the micromanagement of having to put outposts everywhere to get the resulting resource output from them.

I didn't see that happening (production on gas giants etc), but I will test for that in my next game.

_________________
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: Sat Oct 29, 2016 12:23 pm 
Offline
Dyson Forest

Joined: Tue Sep 30, 2014 10:01 am
Posts: 221
Hi,

I checked again:

Depopulation works, so when a planet gets depopulated all the meters are set zero.

Geoff the Medio wrote:
After a brief search, I also found this argument:
viewtopic.php?p=49523#p49523
which was that it was partly to avoid the micromanagement of having to put outposts everywhere to get the resulting resource output from them.


Unluckily outposts are affected by e.g. Nascent Artificial Intelligence and Adaptive Automation...
That is definitely not intended. I would like to refactor the freeorion code to change that. Should I close the pull request and start discussing ideas for implementation in this or a new thread?

_________________
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: Sat Oct 29, 2016 11:39 pm 
Offline
Programmer

Joined: Sun Feb 14, 2016 12:08 am
Posts: 359
Would clamping the meters to the current target value during `Planet::Depopulate()`, instead of resetting, work for both cases?
e.g.
Code:
GetMeter(METER_INDUSTRY)->ClampCurrentToRange(Meter::DEFAULT_VALUE, GetMeter(METER_TARGET_INDUSTRY)->Current());


I would keep the PR open if you still intend to work on it.
The c++ discussion probably belongs in programming, unless this becomes a huge discussion (or I get smacked on the back of the head again), I would continue here for now.

_________________
Any content posted should be considered licensed GNU GPL 2.0 and/or CC-BY-SA 3.0 as appropriate.


Top
 Profile  
 
PostPosted: Tue Nov 01, 2016 7:29 am 
Offline
Dyson Forest

Joined: Tue Sep 30, 2014 10:01 am
Posts: 221
dbenage-cx wrote:
Would clamping the meters to the current target value during `Planet::Depopulate()`, instead of resetting, work for both cases?
e.g.
Code:
GetMeter(METER_INDUSTRY)->ClampCurrentToRange(Meter::DEFAULT_VALUE, GetMeter(METER_TARGET_INDUSTRY)->Current());


I am not sure how that would help.

dbenage-cx wrote:
I would keep the PR open if you still intend to work on it.
The c++ discussion probably belongs in programming, unless this becomes a huge discussion (or I get smacked on the back of the head again), I would continue here for now.

By mistake i closed the pull request #1080 (i did some coding and rebasing and couldnt push to the branch, so i deleted and repushed my code with the same name).

I went forward and tried cleaning up the scripts to be more specific whether population is needed in conditions or not. I also tried to unify the usage by using a macro as I found at least six different ways people coded this kind of condition.
I made commits in the branch to group different kind of issues. I guess the branch is in a state that can start the discussion. I will for example have to revisit the ProductionCenter vs PopulationCenter question.

industrious-outposts commits
industrious-outposts diff

_________________
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 Nov 01, 2016 10:25 am 
Offline
Release Manager, Design
User avatar

Joined: Wed Nov 16, 2011 12:56 pm
Posts: 4303
Location: Sol III
Just want to sneak in a thought I had - I wonder if you're making things more complicated than they need to be.

Let me make sure I understand the problem correctly: What you want to achieve is that your supply ship mechanic works with outposts, right? And the problem is, that zero pop, species-less colonies (aka outposts) are hardcoded to reset their resource meters (industry, research) to 0, so your supply ship scripts don't work with outposts.

The obvious solution, to remove these hardcoded limit, doesn't work either, because then suddenly flat, pop-independent boni like Nascent Artificial Intelligence and Adaptive Automation are applied to outposts, which is definitely not what we want.

But wouldn't the most simple way to address the latter problem by just adding a condition to these flat-boni tech effects which ensures only colonies with a pop>0 get them? Then you can just remove the hardcoded limit, extend the activation condition of all the boni we don't want to be applied to outposts accordingly, and we're set.

Or am I missing something obvious here?


Top
 Profile  
 
PostPosted: Tue Nov 01, 2016 10:54 am 
Offline
Programming, Design, Admin
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 12042
Location: Munich
Vezzra wrote:
...zero pop, species-less colonies (aka outposts) are hardcoded to reset their resource meters (industry, research) to 0...
[...]...adding a condition to these flat-boni tech effects which ensures only colonies with a pop>0 get them? Then you can just remove the hardcoded limit...
The point of the resetting the resource meters is that when planets change from having population to not, they shouldn't still have lingering resource output for many turns as it slowly decays to the new target of 0. Just ensuring that the target is 0 by adjusting scope conditions won't prevent this.

I suggest looking into using ships as resource centers. These won't have planet-like target/current meter mechanics to worry about, and should be a lot easier to get to generate the desired resource output than would attempting to manipulate target / current planet resource meters.


Top
 Profile  
 
PostPosted: Tue Nov 01, 2016 3:44 pm 
Offline
Dyson Forest

Joined: Tue Sep 30, 2014 10:01 am
Posts: 221
Vezzra wrote:
Let me make sure I understand the problem correctly: What you want to achieve is that your supply ship mechanic works with outposts, right? And the problem is, that zero pop, species-less colonies (aka outposts) are hardcoded to reset their resource meters (industry, research) to 0, so your supply ship scripts don't work with outposts.

Exactly

Vezzra wrote:
The obvious solution, to remove these hardcoded limit, doesn't work either, because then suddenly flat, pop-independent boni like Nascent Artificial Intelligence and Adaptive Automation are applied to outposts, which is definitely not what we want.

But wouldn't the most simple way to address the latter problem by just adding a condition to these flat-boni tech effects which ensures only colonies with a pop>0 get them? Then you can just remove the hardcoded limit, extend the activation condition of all the boni we don't want to be applied to outposts accordingly, and we're set.

Or am I missing something obvious here?

Nope, that is basically what the branch tries to achieve.

Maybe I should not do the cleanup stuff, I don't know.

_________________
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 Nov 01, 2016 4:06 pm 
Offline
Dyson Forest

Joined: Tue Sep 30, 2014 10:01 am
Posts: 221
Geoff the Medio wrote:
Vezzra wrote:
...zero pop, species-less colonies (aka outposts) are hardcoded to reset their resource meters (industry, research) to 0...
[...]...adding a condition to these flat-boni tech effects which ensures only colonies with a pop>0 get them? Then you can just remove the hardcoded limit...
The point of the resetting the resource meters is that when planets change from having population to not, they shouldn't still have lingering resource output for many turns as it slowly decays to the new target of 0. Just ensuring that the target is 0 by adjusting scope conditions won't prevent this.

No, lingering resource output has no essential connections with outposts. The depopulation method takes care of lingering resource output.
If you call it only for populated population centers, it works fine. But the scripts for some techs don't care if the population center is populated or not. I made an implementation in the mentioned industrious-outposts branch. Deciding for a tech etc if it should work only on populated places probably is good thing regardless of supply ships.

Geoff the Medio wrote:
I suggest looking into using ships as resource centers. These won't have planet-like target/current meter mechanics to worry about, and should be a lot easier to get to generate the desired resource output than would attempting to manipulate target / current planet resource meters.

I will follow your suggestion out of curiosity, but I do not understand your concern about the meters.
The target/current meter mechanics work just fine the way they are coded.

Anyway will have a look at ships as resource centers, though I do not yet see how this will help with hidden disconnected empires and exploration.

_________________
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 Nov 02, 2016 3:24 am 
Offline
Creative Contributor
User avatar

Joined: Fri Jun 28, 2013 11:45 pm
Posts: 3295
Vezzra wrote:
But wouldn't the most simple way to address the latter problem by just adding a condition to these flat-boni tech effects which ensures only colonies with a pop>0 get them? Then you can just remove the hardcoded limit, extend the activation condition of all the boni we don't want to be applied to outposts accordingly, and we're set.

This is actually something we might need to do anyway—if/when we rework the growth/adaptation/terraform techs I want to be able to populate worlds with low population, probably max 1, then terraform upwards, but if you're getting the bonus from adaptive and nascent immediately then that could be a little overpowered.

Of course, it's fairly apparent that both nascent and adaptive are a little overpowered anyway, so gating them to give a max of the planet population or 2/5 might work and then remove this propblem as well (could gate adaptive to be twice population if we wanted).

That or give them Infrastructure based bonuses instead but that's a whole other discussion ;-)

(I haven't contributed much to this discussion, but I'm very much with Geoff on the micromanagement concerns here: if it's an advantage to send a supply ship with an outpost then it's a disadvantage to not do so, which is close to the definition of micromanagement: I can see the appeal for some players to want this sort of feature, different people want to play the game in different ways, but I'm not sold this is a balanced non-micro addition)

_________________
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 Nov 02, 2016 6:24 pm 
Offline
Vacuum Dragon

Joined: Wed Aug 26, 2015 6:15 pm
Posts: 507
MatGB wrote:
Of course, it's fairly apparent that both nascent and adaptive are a little overpowered anyway, so gating them to give a max of the planet population or 2/5 might work and then remove this propblem as well (could gate adaptive to be twice population if we wanted).

That would, of course, be a significant change to game-play.


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


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:  
cron
Powered by phpBB® Forum Software © phpBB Group