issues
search
wraithlight
/
wraithlight-mono
My beloved MMORPG Game. And a whole platform.
GNU General Public License v3.0
1
stars
0
forks
source link
ARC: CQRS in GAME BE
#758
Open
kfarkasHU
opened
7 months ago
kfarkasHU
commented
7 months ago
Basically it should be:
once we receive anything from RTFW (through an API call or direct RTFW payload)
we should update the global state - if it makes sense like an animation change
we should the dispatch the state updates
for longer operations (such as a spellcast) we should do a CB - once it is being called it behaves like a brand new message
EG:
as a character playing the game i'd like to cast a polymorph spell on a wolf so i press the related shortcut
my client sends a message to be through RTFW
BE receives the given message so it updates the state with my new animation model/character state (casting state of my model)
BE adds a callback that will be triggered once the casting is done (lets use 5 sec for now)
BE dispatches my model update to all clients who see me (like i'm in their visible radius) -
how do we handle invis characters casting a spell?
when my client receives the update it updates the game with the casting bar (model animation is already done) -
laggging?
when the CB is being triggered by BE, it updates the state on BE and sends another message on RTFW
the message contains information about the cast result (succeeded, length of polymorphed state of the wolf)
my model is being updated to normal state (non-casting)
sidenotes:
model deltas should be always presented on client side (like sit down, stand up, casting, jumping) without broadcasting
state deltas should not be presented on client side (chat messages, casting bars, buff/debuffs) - only when the message is received on RTFW
Basically it should be:
EG:
sidenotes: