FreeOrion

Forums for the FreeOrion project
It is currently Sat Dec 16, 2017 1:22 am

All times are UTC




Post new topic Reply to topic  [ 40 posts ]  Go to page Previous  1, 2, 3
Author Message
PostPosted: Tue Sep 05, 2017 4:13 pm 
Offline
Programmer

Joined: Sun Feb 14, 2016 12:08 am
Posts: 359
Geoff The Medio wrote:
Is there a difference between when a ship is in range to be resupplied and to be upgraded?

I don't see a need for distinction between ally vs own supply, but outside of both there is a difference, especially if one has some remote refuel capability larger than a ramscoop.

I understand the desire to limit the number of meters, and this particular case is probably only mildly beneficial (given the current default content).
For now I'd recommend the fluff explanation, maybe something along the lines of "storage matrix software update".

Using a check for last turn vs tech sounds like it might have other issues(a tech being complete is not necessarily the only requisite for an upgrade), so unsure how that might play out.

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


Top
 Profile  
 
PostPosted: Tue Sep 05, 2017 5:34 pm 
Offline
AI Lead, Programmer
User avatar

Joined: Sat Sep 22, 2012 6:25 pm
Posts: 4390
dbenage-cx wrote:
Using a check for last turn vs tech sounds like it might have other issues(a tech being complete is not necessarily the only requisite for an upgrade), so unsure how that might play out.
The point of adding FOCS support for turn-tech-acquired and turn-last-supplied was so that all the necessary conditions could be evaluated in FOCS, any other requirements you are contemplating could be as well.

_________________
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 Sep 06, 2017 8:14 am 
Offline
Dyson Forest

Joined: Tue Sep 30, 2014 10:01 am
Posts: 221
A third implementation option would be to know the effect of a stackinggroup in the last turn. You could do something like the following

Code:
// pseudocode antimatter tank technology -
stackinggroup = "ANTIMATTER_TANK_STACK"
activation = And [
   Ship
   DesignHasPart name = "FU_BASIC_TANK"
   // only add to the fuel maximum if not done before
   last-turn stackinggroup ="ANTIMATTER_TANK_STACK" min = 0 max = 0
  [[CONDITION_SUPPLY_CONNECTED]]
]


I dont know if the necessary data gets serialized though (and if that gets lost if you disable effect accounting).

_________________
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 Sep 06, 2017 9:18 am 
Offline
Programming, Design, Admin
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 12042
Location: Munich
Ophiuchus wrote:
A third implementation option would be to know the effect of a stackinggroup in the last turn.
In addition to not being stored, what stackinggroups were previously applied isn't well-defined; it can vary during various effects applications during a turn.


Top
 Profile  
 
PostPosted: Wed Sep 06, 2017 11:20 am 
Offline
Dyson Forest

Joined: Tue Sep 30, 2014 10:01 am
Posts: 221
Geoff the Medio wrote:
Ophiuchus wrote:
A third implementation option would be to know the effect of a stackinggroup in the last turn.
In addition to not being stored, what stackinggroups were previously applied isn't well-defined; it can vary during various effects applications during a turn.

Not sure i understand you. I thought was that effects get only applied between turns and after all effects are applied there is a list of applied stackinggroups. Can you point me to code please, thank you.

_________________
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 Sep 06, 2017 1:15 pm 
Offline
AI Lead, Programmer
User avatar

Joined: Sat Sep 22, 2012 6:25 pm
Posts: 4390
Ophiuchus wrote:
I thought was that effects get only applied between turns and after all effects are applied there is a list of applied stackinggroups. Can you point me to code please, thank you.
My recollection is that stacking groups are taken into consideration as effects are applied. To see more about that, look at the effects code in universe/Universe.cpp. To see more about when effects get applied, I think you'll need to look at server/ServerFSM.cpp and server/ServerApp.cpp

_________________
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 Sep 13, 2017 11:44 am 
Offline
Dyson Forest

Joined: Tue Sep 30, 2014 10:01 am
Posts: 221
Dilvish wrote:
Ophiuchus wrote:
I thought was that effects get only applied between turns and after all effects are applied there is a list of applied stackinggroups. Can you point me to code please, thank you.
My recollection is that stacking groups are taken into consideration as effects are applied. To see more about that, look at the effects code in universe/Universe.cpp. To see more about when effects get applied, I think you'll need to look at server/ServerFSM.cpp and server/ServerApp.cpp

I had a look at the code. Universe::ExecuteEffects calculates a map from stackinggroup names to freeorion object ids. Effects of an effect group are only applied to an object, if it does not have an entry for the current stackinggroup in that map. If it gets applied the object id is added to the current stackinggroup entry.
If we serialize this map after ExecuteEffects and make it accessible the next turn we have the information which stackinggroups were applied to which objects the turn before. Based on this you could prevent applying effects and readd the stackinggroup every turn.

But probably the same could be done by adding a tag or special on the ship when the effect gets applied and checking in the condition for it. Would that be possible with FOCS at the moment?

_________________
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 Sep 29, 2017 8:16 am 
Offline
Programming, Design, Admin
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 12042
Location: Munich
Dilvish wrote:
...tracking the turn of last resupply (along with tracking what turn techs were acquired on)
Done:
https://github.com/freeorion/freeorion/ ... 62f9824f19
https://github.com/freeorion/freeorion/ ... 7f0d1b83bc


Top
 Profile  
 
PostPosted: Fri Sep 29, 2017 7:03 pm 
Offline
AI Lead, Programmer
User avatar

Joined: Sat Sep 22, 2012 6:25 pm
Posts: 4390
Geoff the Medio wrote:
Dilvish wrote:
...tracking the turn of last resupply (along with tracking what turn techs were acquired on)
Done:
https://github.com/freeorion/freeorion/ ... 62f9824f19
https://github.com/freeorion/freeorion/ ... 7f0d1b83bc


Great; did the parser code for TurnTechResearched accidentally get left out of the commit, or am I somehow overlooking it or misunderstanding the need for it?

_________________
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: Fri Sep 29, 2017 9:01 pm 
Offline
Programming, Design, Admin
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 12042
Location: Munich
Dilvish wrote:
...did the parser code for TurnTechResearched accidentally get left out of the commit...
I think so yes; will commit something...


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

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