My requirement is to make a small online game where each game lasts an hour or so, and has to log what happens during the game for a report.
The game clock can be paused and skipped back/forward, and players roles can change during the game.


All this may be needed for reporting at the end. For example, what role was a player at a certain time when they did X. How long did they take to do Y.
I thought maybe making everything an event and building the current game state up from these stored events.
Is this a good idea? Is this an overly complex solution for my problem? Any alternatives?
Thanks!
Sounds like a good idea to me and a perfect application for it. I’m sure there would be others but if the shoe fits.
Thanks! Do you know any good GitHub/online event sourcing implementations I can look at to review how it’s best done?
Event sourcing should be good for that purposes, however keep in mind the overheads it brings, some kind of latency issues e.g. getting the last state of an entity requires to fetch and apply all the events.
*or use snapshots
Looks like the perfect fit. Your game will be deterministic ( aka time debbugable ) . CQRS will also be the perfect follow-up
Did anyone try event sourcing using C# 9 records? Is it a perfect fit?
What makes records specifically better for event sourcing?
C# devs
null reference exceptions

source