Lighthouse Speed Bonus not working as expected

Describe your experience with the latest version of FreeOrion to help us improve it.

Moderator: Oberlus

Forum rules
Always mention the exact version of FreeOrion you are testing.

When reporting an issue regarding the AI, if possible provide the relevant AI log file and a save game file that demonstrates the issue.
Post Reply
Message
Author
Hihoo
Space Kraken
Posts: 142
Joined: Wed Oct 23, 2013 8:50 am

Lighthouse Speed Bonus not working as expected

#1 Post by Hihoo »

Small bug actually: Newly built ships in a system with a lighthouse have to wait for one turn to get the mixed-blessing-speed bonus.

User avatar
MatGB
Creative Contributor
Posts: 3310
Joined: Fri Jun 28, 2013 11:45 pm

Re: Lighthouse Speed Bonus not working as expected

#2 Post by MatGB »

Yeah, when I reported this Geoff said it was basically as intended, you have to start the turn within the distance to get the boost, and shipbuilding happens after the start of turn. Same for Infrastructure Ecology.
Mat Bowles

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

User avatar
Dilvish
AI Lead and Programmer Emeritus
Posts: 4768
Joined: Sat Sep 22, 2012 6:25 pm

Re: Lighthouse Speed Bonus not working as expected

#3 Post by Dilvish »

I think that's been considered not really a bug, but simply a consequence of the order of Effects processing relative to creation of ships. There's nothing inherently buggy about it taking a turn for certain additional effects to apply. A little more nuisancesome has been the situation with certain hulls such as BioAdaptive hulls that can cause ships to spend their first turn with stats not compliant with purely internally generated effects.

On thinking about it all a bit more just now, it seems we ought to be able to have a mini-round of effects processing specifically updating newly created ships from within Empire::CheckProductionProgress(), using a call to Universe::UpdateMeterEstimates(const std::vector<int>& objects_vec) -- Geoff, what say Ye?
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

Hihoo
Space Kraken
Posts: 142
Joined: Wed Oct 23, 2013 8:50 am

Re: Lighthouse Speed Bonus not working as expected

#4 Post by Hihoo »

I think that's been considered not really a bug
I agree it could be called a feature of sorts.
It's just a little cumbersome with speed for I have to do a little calculation every time which way to get somewhere faster cause the bonus won't snap in while travelling!

User avatar
MatGB
Creative Contributor
Posts: 3310
Joined: Fri Jun 28, 2013 11:45 pm

Re: Lighthouse Speed Bonus not working as expected

#5 Post by MatGB »

Bonus applies at the start of each turn you're in raange, even when travelling. And wears off if you go out of range.

Which can be annoying, and is one of the reasons I'd love to see some wort of waypoint system at some point.
Mat Bowles

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

Hihoo
Space Kraken
Posts: 142
Joined: Wed Oct 23, 2013 8:50 am

Re: Lighthouse Speed Bonus not working as expected

#6 Post by Hihoo »

to be more precise, I have to consider whether to wait for one turn to get the bonus, or to travel immediately without bonus (after constructing a direly needed battleship)

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13603
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Lighthouse Speed Bonus not working as expected

#7 Post by Geoff the Medio »

Dilvish wrote:On thinking about it all a bit more just now, it seems we ought to be able to have a mini-round of effects processing specifically updating newly created ships from within Empire::CheckProductionProgress(), using a call to Universe::UpdateMeterEstimates(const std::vector<int>& objects_vec)
Meter estimates don't matter on the server. That is only needed on the clients. However, there already is a call to m_universe.ApplyMeterEffectsAndUpdateMeters() after the production queue checking in ServerApp::PostCombatProcessTurns, without which all ships would start off with zero max fuel, structure, starlane speed, etc. However, starlane speed is itself a meter, and the lighthouse effect depends on its value, but it doesn't have a nonzero value yet at the time of the scope tests because the effects that give it a nonzero value are being tested at that time, so haven't yet executed.

It's possible to keep adding more and more iterations of meter updates, including after incrementing the turn number to avoid off-by-one issues with client-side vs. server estimates that are explicitly turn-dependent, but it adds more time to turn processing each turn to do so.

User avatar
Dilvish
AI Lead and Programmer Emeritus
Posts: 4768
Joined: Sat Sep 22, 2012 6:25 pm

Re: Lighthouse Speed Bonus not working as expected

#8 Post by Dilvish »

Geoff the Medio wrote:However, starlane speed is itself a meter, and the lighthouse effect depends on its value, but it doesn't have a nonzero value yet at the time of the scope tests because the effects that give it a nonzero value are being tested at that time, so haven't yet executed.
Ah, so that's the issue here, the check to prevent immobile fleets from being given the speed boost is causing this delay in the boost for other fleets; I had forgotten about that.
It's possible to keep adding more and more iterations of meter updates, including after incrementing the turn number to avoid off-by-one issues with client-side vs. server estimates that are explicitly turn-dependent, but it adds more time to turn processing each turn to do so.
Can't help but point out, giving EffectsGroups priorities would also solve the problem at hand.
Last edited by Dilvish on Sun Nov 17, 2013 10:31 pm, edited 1 time in total.
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

User avatar
MatGB
Creative Contributor
Posts: 3310
Joined: Fri Jun 28, 2013 11:45 pm

Re: Lighthouse Speed Bonus not working as expected

#9 Post by MatGB »

Hihoo wrote:to be more precise, I have to consider whether to wait for one turn to get the bonus, or to travel immediately without bonus (after constructing a direly needed battleship)
"A" direly needed battleship? Surely you build in batches and laucnh fleets o'doom? ;-)

Anyway, it is rarely going to help launching then waiting. Assume ship built near edge of controlled territory moving to assault enemy.

Give it orders now, it moves 75 uu (your favourite hulltype afterall). Next turn it moves another 75 uu. Total moved, 150uu.

Alternatively, wait for a turn, it gets the lighthouse and infastructure bonus, it now moves 105 uu. Next turn it moves another 75 as it's out of range of bonus generators, so by turn three it can have either move 180uu by waiting, or 225 uu by staying still.

The only, edge case, scenario where it would make a difference waiting is if you have another lighthouse approx 120uu away, meaning the bonus is applied if you move 105 but not if you move 75, but that is going to be fairly unusual.
Mat Bowles

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

User avatar
OllyG
Space Kraken
Posts: 151
Joined: Wed Jul 20, 2011 12:03 pm

Re: Lighthouse Speed Bonus not working as expected

#10 Post by OllyG »

I seems to me that in general the things that work by UU range are not as easy or intuitive for players to understand. The lighthouse might be better working for ships on starlanes directly connected to the lighthouse, or a jump or two away (to stop it being built too much)
Of course this wouldn't do anything to solve the first turn bonus. Other things like increased supply range from techs also need a turn to activate, but with a newly constructed ship it seems odd. Might be better to give ships zero fuel on the turn they are constructed and only let them move next turn. (Please don't shout at me but in the real world ships don't work right away, they need sea trials and so on)

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13603
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Lighthouse Speed Bonus not working as expected

#11 Post by Geoff the Medio »

OllyG wrote:Might be better to give ships zero fuel on the turn they are constructed and only let them move next turn. (Please don't shout at me but in the real world ships don't work right away, they need sea trials and so on)
FreeOrion is not a simulation. And even if it was, that would be annoying and unnecessary, IMO.

Post Reply