1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-15 18:19:55 +00:00
openmw-tes3mp/apps/openmw-mp/Script
David Cernat 892d71ce71 [General] Reimplement weather synchronization to allow soft transitions
Although weather sync was added by Koncord to the rewrite in fd721143e2 in a way that used surprisingly few lines of code, it relied on the server requesting weather states every second from authority players and sending them to non-authority players, while also allowing only very sudden weather transitions across regions, i.e. if there was one player in the Ascadian Isles who had stormy weather, and another player with clear weather in the Bitter Coast Region walked across to the Ascadian Isles, that player was instantly made to have stormy weather with no kind of transition at all.

My approach solves both of those problems. It solves the packet spam by only sending weather updates to the server when weather changes happen or when there are new arrivals to a weather authority's region, and it allows for both sudden weather transitions when players teleport to a region and for soft, gradual transitions when players walk across to a region. It is inspired by my previous actor sync, and uses a WorldRegionAuthority packet to set players as region authorities in a similar way to how ActorAuthority sets players as cell AI authorities. Weather changes are created only by the region authority for a given region, and weather packets are also only sent by that authority.

However, it should be noted that gradual weather transitions are used by default in this implementation. To use sudden weather transitions, the serverside Lua scripts need to forward WorldWeather packets with the forceWeather boolean set to true. That is, however, already handled by our default Lua scripts in situations where it makes sense.
2018-07-21 05:20:26 +03:00
..
API Remove Pawn support 2018-07-02 23:00:35 +08:00
Functions [General] Reimplement weather synchronization to allow soft transitions 2018-07-21 05:20:26 +03:00
LangLua [General] Remove Terra support 2018-07-02 23:07:09 +08:00
LangNative [General] Leave one blank line at the end of every tes3mp code file 2017-01-26 06:17:29 +02:00
Language.hpp Fixed types in all GetInterface functions 2016-08-02 18:10:06 +08:00
Platform.hpp Fix include guard 2016-11-17 13:22:34 +08:00
Script.cpp [General] Remove Terra support 2018-07-02 23:07:09 +08:00
Script.hpp Remove Pawn support 2018-07-02 23:00:35 +08:00
ScriptFunction.cpp Remove Pawn support 2018-07-02 23:00:35 +08:00
ScriptFunction.hpp Remove Pawn support 2018-07-02 23:00:35 +08:00
ScriptFunctions.cpp [Server] Turn sendToAttachedPlayer into skipAttachedPlayer 2018-07-07 20:08:59 +03:00
ScriptFunctions.hpp [General] Reimplement weather synchronization to allow soft transitions 2018-07-21 05:20:26 +03:00
SystemInterface.hpp Fixed types in all GetInterface functions 2016-08-02 18:10:06 +08:00
Types.hpp [General] Move Utils from server to components 2017-03-04 13:08:22 +08:00