ArkhamHorror icon indicating copy to clipboard operation
ArkhamHorror copied to clipboard

Add game log

Open halogenandtoast opened this issue 4 years ago • 0 comments

We would like to display human readable messages for what has occurred in the game. I would sort of like a way for the game log to encode the cards into the message so you could mouse over the name and see the card and/or click to jump to the ArkhamDB page. Currently we have a good idea of what has happened via the Message queue but there are two issues that prevent using it in this way:

  1. The message queue is not human readable as it lacks names for things and instead passes around UUIDs. Some messages in the queue are entirely for handling value passing between entities and won't make sense in the log. And the final issue here is entities don't know about other entities (aside from their IDs) so it would be difficult to conjure the correct log entry from a given message (especially since multiple entities may process a message).
  2. The message queue is ephemeral. We add/remove/modify messages freely and since we need the log to persist between game loads we can't rely on the queue alone. We'll need at least one other field used for managing the log.

Some ideas on how best to handle this.

  1. We could treat the game log in the same manner we treat the existing message queue and allow any entity to add to it. This means we'd likely need some typeclass that lets us get entity names, but that could be fairly difficult, I remember running into an issue when I tried to do this before but can't remember what now.
  2. We could treat the game log as it's own entity (just like Enemy, Investigator, Location, etc.) at which point it can receive messages and decide which ones (and how) to log them. This will prevent the issue of multiple entities handling the same message in some cases and provide a concise place to capture logging. We can even extend the message system to have a log specific message so we can add logs from anywhere in the app. I have a feeling this will be the easiest and most flexible approach.

halogenandtoast avatar Sep 25 '20 14:09 halogenandtoast