Unknown malus vanishing infrastructure and happiness

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
Raflesia
Space Krill
Posts: 9
Joined: Tue May 03, 2016 4:02 pm

Unknown malus vanishing infrastructure and happiness

#1 Post by Raflesia »

0.4.5+ (build 2016-04-26.81bf313) or FreeOrion_2016-04-26.81bf313_MacOSX_10.7.dmg

I have been playing the game for a few months now, and I tried today the build above for the first time.

I have started a handful of games with this build and in all cases both my infrastructure and my happiness meters are vanquished by an unknown malus that equals all the bonuses. This persists after the first few turns. As soon as I add a new bonus, the malus grows consistently keeping both meters stuck at zero.

Other meters like production, science, etc. are unaffected and appear to show no unknown malus.

I am not familiar with the new supply system, so I might be misunderstanding something.

Thanks for the help,
Elena

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

Re: Unknown malus vanishing infrastructure and happiness

#2 Post by Geoff the Medio »

It would probably be helpful if you attached a save game, of as small a universe / few players / few planets / etc. as possible, that demonstrates the issue. But before that, start up a game that has this problem, play a turn or two, then locate the .log files in this directory, and then attach them to a reply (zipping if necessary).

Raflesia
Space Krill
Posts: 9
Joined: Tue May 03, 2016 4:02 pm

Re: Unknown malus vanishing infrastructure and happiness

#3 Post by Raflesia »

Hello again,

thanks for the fast answer. I started a new game today. I targzipped all the files in that directory that were created today:
FreeOrionLogsRaflesia.tar.gz
(65.49 KiB) Downloaded 55 times
If that is not what you wanted, please let me know.

I noticed that not only happiness and infrastructure, but also detection have unknown malus equal to all the bonuses. But the other meters, like production and science, also have small unknown malus - contrary to what I said previously - not enough to zero the meter. This last bit was also reported elsewhere in the forum, but I add the info here as well in case it can be useful.

Thanks,
Elena

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

Re: Unknown malus vanishing infrastructure and happiness

#4 Post by Geoff the Medio »

Did you actually end turn at least once after loading the save? It doesn't appear so from the log, but a log with that would be much more useful...

Raflesia
Space Krill
Posts: 9
Joined: Tue May 03, 2016 4:02 pm

Re: Unknown malus vanishing infrastructure and happiness

#5 Post by Raflesia »

Sorry I do not understand ... I just played a few tens of turns, then saved, then extied, then collected the files. Do you mean that I should first end turn and then save without doing anything else?

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

Re: Unknown malus vanishing infrastructure and happiness

#6 Post by Geoff the Medio »

Raflesia wrote:Sorry I do not understand ... I just played a few tens of turns, then saved, then extied, then collected the files. Do you mean that I should first end turn and then save without doing anything else?
The logs you attached appear to be from a game where you loaded a saved game then immediately quit, without ending turn at least once. I need a log file from after you've ended turn at least once while the problem is happening.

Raflesia
Space Krill
Posts: 9
Joined: Tue May 03, 2016 4:02 pm

Re: Unknown malus vanishing infrastructure and happiness

#7 Post by Raflesia »

Ah now I see what you mean. I had to create a much smaller game to fit in the uploads limits. Here it is.
Thanks for your patience ...
Attachments
FreeOrionLogRaflesia.tar.gz
(787.16 KiB) Downloaded 54 times

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

Re: Unknown malus vanishing infrastructure and happiness

#8 Post by Geoff the Medio »

I don't know why, but a cast is failing repeatedly in the log you posted. That cast should only be attempted it it would succeed, based on safety checks done right before.

I added some fallback methods to execute in the event of a failed cast, which should hopefully resolve the issue for you, though you won't get the (possible?) slight speedup that this code was intended to achieve.

Raflesia
Space Krill
Posts: 9
Joined: Tue May 03, 2016 4:02 pm

Re: Unknown malus vanishing infrastructure and happiness

#9 Post by Raflesia »

Ok, I do not know what a cast is, but I think I got the idea :D
Thank you for your help.
I would like to try the new version, what test build will it be?

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

Re: Unknown malus vanishing infrastructure and happiness

#10 Post by Geoff the Medio »

Raflesia wrote:Ok, I do not know what a cast is...
I have a memory address stored in a variable, and that memory address points to some information about how to calculate how much to add to a planet's happiness each turn. The variable has a type, which means it knows it's a calculation that can be done, but not exactly what kind of calculation. However one can find out what kind of calculation it is by looking at the pointed-to-memory. In the code, I call a function that looks at the memory and returns true if it's a particular kind of calculation, and false otherwise. If it returns true, I try to store the memory address in another variable that has a different type, which does indicate how the calculation is done. This storing-in-another-type-of-variable is a cast. However, in your log, it says that this storing the memory address in another variable casting step is failing, even though it should only attempt to do the cast after checking that it should work by looking at the pointed-to memory.

The next release, but not the current one, should have the change in it.

Raflesia
Space Krill
Posts: 9
Joined: Tue May 03, 2016 4:02 pm

Re: Unknown malus vanishing infrastructure and happiness

#11 Post by Raflesia »

Very clear explanation, thanks! Ok I'll wait for the next release, I tried the 14th of June release but it's too early.
Thanks again.

Raflesia
Space Krill
Posts: 9
Joined: Tue May 03, 2016 4:02 pm

Re: Unknown malus vanishing infrastructure and happiness

#12 Post by Raflesia »

FreeOrion_2016-06-21.94bf367_MacOSX_10.7.dmg

This is just to let you know that:
1. the problem with the malus has indeed disappeared
2. the performances, compared to the 2015 builds I was using, are much much much much better

Thanks

Post Reply