Bannerlord-Coop-Team / BannerlordCoop

MIT License
265 stars 51 forks source link

Convert Movement packets from per second to send on change #468

Open garrettluskey opened 1 year ago

garrettluskey commented 1 year ago

For New Contributors

How to contribute

Description

Right now the movement is being sent at a set rate.

In the Agent service create MovementEvents and handles sending and receiving of movement packets.

A MovementEvent is when an Agent controlled by the client any of the following are changed:

On a MovementEvent

For any new events, use the already existing MessageBroker.

Intended Design

N/A

Location

Create a branch based from arena-vertical-slice In the Agent service under the Missions project Services folder

Related Issues

Blocked by #467

Requirements

Additional information

N/A

Definition of Done

Ciel1996 commented 1 year ago

I assume that MovementEvent is currently called MovementPacket. Searching for MovementEvent on the branch does not find anything.

garrettluskey commented 1 year ago

MovementEvent currently does not exist. I updated the description to be more helpful

Ciel1996 commented 1 year ago

I'm currently replacing the polling mechanism of MovementHandler by an event-based mechanism. Should only movement related packets be rate-limited or all packets? If all, I would implement the rate-limit at MessageBrokerlevel. Otherwise I would implement it in the MovementHandler.

Ciel1996 commented 1 year ago

Come to think of it, implementing it inside the MovementHandler is probably best and the only viable solution.

Ciel1996 commented 1 year ago

So I have made some further progress and I noticed that theoretically the Agent Equipment could also change during a battle. Should I also respect this or is this handled somewhere else? In my opinion it could be sent with the rest of the movement deltas

garrettluskey commented 1 year ago

All of the respective data in this scope is sent via a movement packet and is not necessarily reliable. For reliable events we plan on using INetworkEvents such as Agent Equipment changing