Page MenuHomeFeedback Tracker

Weather System having negative values.
New, NormalPublic

Description

Weather system behaves strange on set: if you want to set a target weather variable, the actual values jump down below 0 occasionally (I had as much as -10), this seems to even be transmitted on occasion to the client, as it can turn into the "all screen is a shadow" graphics error, especially if you want to change a value too fast (e.g. call set with target 0.0 when value is 0.9, however it can also happen the other way around, which results in strange jumping weather effects)

For fog it has the nice upside, that while this persists, the rendering of the world is extremely clear, something you cannot even get at the value being 0; However you cannot set it on purpose on negative values, so using this "feature" is out of the question anyway.

I figured this out when I started writing my own Weather controller, and looked at the values in onUpdate loop, and tried to nail down where the strange bugs came from I experienced from time to time.

Details

Severity
Major
Resolution
Open
Reproducibility
Sometimes
Operating System
Windows 10 x64
Operating System Version
2016 server
Category
Server
Steps To Reproduce

Example to reproduce:
one might need to set up a periodic printout to reproduce this behaviour.

Weather weather = GetGame().GetWeather();
Overcast ocast = weather.GetOvercast();
ocast.Set( 0.0, 0, 1 );
Print(ocast.GetActual());

Workaround: using .Set to set the value several times seems to fix the issue, can however introduce yet other bugs.

Generally the weather system is quite quite buggy, hard to read, and very badly designed; it kinda is a shame, that much of it seems hardcoded as well, besides not really working well in sync, but you already know that i think (client not syncing with server weather, which is more predominant on alt+tabbed game)

I already figured out that I have to use this in init.c

Weather weather = g_Game.GetWeather();
weather.MissionWeather(true);    // false = use weather controller from Weather.c

_after_ hive creation, otherwise any changes wont work at all (contrary to the comment in the file)
I have used both, mission weather and normal weather to get this effect.

calling GetWeather before initializing the hive does not allow any changes to weather whatsoever further on, so I might add, that is a prerequisite to reproduce this bug.

Additional Information

I think the main issue is transmitting the value wrong to the client (it should trim below 0 to 0), as it does less havoc on server side. However, it would also be nice if the algorithm actually does what it is supposed to do, and there might be some error in the internal Weather logic.

My current controller script works fine, and just sets the value twice, while lerping the value manually and tries to avoid 0.0 for overcast.

Event Timeline

g4borg created this task.Feb 4 2019, 4:22 PM