1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-16 02:19:55 +00:00
openmw-tes3mp/apps/openmw/mwmp/processors
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
..
actor [Client] Add ActorList methods for sending ActorAI packets 2018-07-12 20:48:47 +03:00
object [General] Implement ObjectActivate packet & associated script functions 2018-07-15 03:16:04 +03:00
player [General] Turn PlayerRegionAuthority into WorldRegionAuthority 2018-07-17 09:21:13 +03:00
worldstate [General] Reimplement weather synchronization to allow soft transitions 2018-07-21 05:20:26 +03:00
ActorProcessor.cpp [Client] Use the correct guid for a received WorldEvent or ActorList 2018-03-21 06:08:04 +02:00
ActorProcessor.hpp [General] Rename Event into ObjectList & WorldObject into BaseObject 2018-05-13 00:42:24 +03:00
BaseClientPacketProcessor.cpp [Client] Reorder files 2017-06-07 00:06:10 +08:00
BaseClientPacketProcessor.hpp [General] Move AddProcessor to BasePacketProcessor 2017-06-30 20:09:05 +08:00
ObjectProcessor.cpp [General] Turn GameTime into a Worldstate packet 2018-05-21 07:14:08 +03:00
ObjectProcessor.hpp [General] Fix remaining references to world packets/events 2018-05-17 00:08:37 +03:00
PlayerProcessor.cpp [General] Move AddProcessor to BasePacketProcessor 2017-06-30 20:09:05 +08:00
PlayerProcessor.hpp [General] Move AddProcessor to BasePacketProcessor 2017-06-30 20:09:05 +08:00
ProcessorInitializer.cpp [General] Turn PlayerRegionAuthority into WorldRegionAuthority 2018-07-17 09:21:13 +03:00
ProcessorInitializer.hpp [Client] Reorder files 2017-06-07 00:06:10 +08:00
WorldstateProcessor.cpp [General] Turn PlayerMap into WorldMap, now a Worldstate packet 2018-06-07 12:51:45 +03:00
WorldstateProcessor.hpp [General] Turn PlayerMap into WorldMap, now a Worldstate packet 2018-06-07 12:51:45 +03:00