TurnsSincePolicyAdopted

Programmers discuss here anything related to FreeOrion programming. Primarily for the developers to discuss.

Moderator: Committer

Post Reply
Message
Author
User avatar
Grummel7
Space Dragon
Posts: 339
Joined: Mon Oct 09, 2017 3:44 pm

TurnsSincePolicyAdopted

#1 Post by Grummel7 »

I found that Bureaucracy stopped working a turn later than expected. When I looked into it, I found that TurnsSincePolicyAdopted returns a lower value than expected:
When I adopt a policy in turn N and use TurnsSincePolicyAdopted in an effect in turn N+1, I get 0!

Well, maybe it is intended, after all I only issued the order to adopt it in turn N, while N+1 is the first turn that it actually in effect. But querying when it has been adopted, I get N.

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

Re: TurnsSincePolicyAdopted

#2 Post by Geoff the Medio »

When do you consider turn N to end and turn N+1 to start, and when does the server consider that increment to happen?

User avatar
Grummel7
Space Dragon
Posts: 339
Joined: Mon Oct 09, 2017 3:44 pm

Re: TurnsSincePolicyAdopted

#3 Post by Grummel7 »

Well, that's a good question...

Fact is that when i adopt a policy in turn 1, then finish my turn, the game shows the following values:
  • current turn = 2
  • adopted in = 1
  • turns since adopted = 0
Somehow this feels wrong, doesn't it?

Actually, I am pretty sure last time I used Indoctrination, it gave 0.25 in the first round after being adopted, now it give 0. So it seems it hasn't always been like that.

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

Re: TurnsSincePolicyAdopted

#4 Post by Geoff the Medio »


User avatar
Grummel7
Space Dragon
Posts: 339
Joined: Mon Oct 09, 2017 3:44 pm

Re: TurnsSincePolicyAdopted

#5 Post by Grummel7 »

That fixes it!

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

Re: TurnsSincePolicyAdopted

#6 Post by Geoff the Medio »

Any other related issues? I'd check for additional (or less?) "Unknown" meter modifications in the effect accounting due to client-server inconsistencies.

User avatar
Grummel7
Space Dragon
Posts: 339
Joined: Mon Oct 09, 2017 3:44 pm

Re: TurnsSincePolicyAdopted

#7 Post by Grummel7 »

I haven't noticed any other issues and I guess I would have spotted unknown meter modifications. Strangely enough it did not even affect all TurnsSince-functions. E.g. Bootstrapping (TurnsSinceColonized) works with or without your fix.

User avatar
Grummel7
Space Dragon
Posts: 339
Joined: Mon Oct 09, 2017 3:44 pm

Re: TurnsSincePolicyAdopted

#8 Post by Grummel7 »

Btw, I found another issue, maybe somehow related:
The Situation Report window now always displays "Initial turn", no matter which turn's messages it shows.

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

Re: TurnsSincePolicyAdopted

#9 Post by Geoff the Medio »

Grummel7 wrote: Mon May 02, 2022 9:49 pmThe Situation Report window now always displays "Initial turn", no matter which turn's messages it shows.
Hopefully fixed by https://github.com/freeorion/freeorion/ ... 1830b7b6d0

Post Reply