Where can I find the piece/s of code or documentation to learn about what is processed when on each turn?
I need answers to stuff like "do all effects apply before or after invasion orders?", "if I order an invasion before pressing 'Turn 100', the invasion happens on turn 100 or turn 101 (LastTurnAttackedByShip gets the value 100 or 101)?", etc.
Turn processing/stages
Moderator: Committer
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13603
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: Turn processing/stages
Mostly look at ServerApp::PreCombatProcessTurns and ServerApp::PostCombatProcessTurns:
https://github.com/freeorion/freeorion/ ... .cpp#L3183
https://github.com/freeorion/freeorion/ ... .cpp#L3405
also incrementing the turn number:
https://github.com/freeorion/freeorion/ ... .cpp#L3552
https://github.com/freeorion/freeorion/ ... .cpp#L3183
https://github.com/freeorion/freeorion/ ... .cpp#L3405
also incrementing the turn number:
https://github.com/freeorion/freeorion/ ... .cpp#L3552
- The Silent One
- Graphics
- Posts: 1129
- Joined: Tue Jul 01, 2003 8:27 pm
Re: Turn processing/stages
There is a tooltip on the turn button that gives you a rough overview what's happening when, too.Oberlus wrote: ↑Sun Oct 18, 2020 9:48 am Where can I find the piece/s of code or documentation to learn about what is processed when on each turn?
I need answers to stuff like "do all effects apply before or after invasion orders?", "if I order an invasion before pressing 'Turn 100', the invasion happens on turn 100 or turn 101 (LastTurnAttackedByShip gets the value 100 or 101)?", etc.
If I provided any images, code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0.
Re: Turn processing/stages
Thanks.
So we have
Order execution
Production, Research and Growth
Why not Effect execution after production of ships and buildings? Maybe so that available PP/RP are the ones reported on previous turn?
So we have
Order execution
- Colonization
- Invasion
- Bombardment
- Gifting
- Scrapping
- Fleet movement
Production, Research and Growth
- Effect execution
- Production of ships and buildings
- Unlocking of new technologies
- Population growth <- Isn't Population growth managed by the effects?
- Supply update
Why not Effect execution after production of ships and buildings? Maybe so that available PP/RP are the ones reported on previous turn?
Re: Turn processing/stages
There is effect execution without effect accounting after processing of queues (which includes production). See https://github.com/freeorion/freeorion/ ... .cpp#L3499
I am just not sure why we have effect execution before processing of queues. Having projected changes to resources and supply actually happen before processing of queue is counterintuitive to me.
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.
Look, ma... four combat bouts!
Look, ma... four combat bouts!
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13603
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: Turn processing/stages
This way, players can issue an order during turns and the resource output / progress on queues will respond to those orders immediately, rather than depending only on orders from the previous turn.