Skip to content
This repository has been archived by the owner on Oct 5, 2023. It is now read-only.

[Q/A] Why does the subscriptions websocket returns the entire story text every time? Why not just the diff? #260

Open
bironran opened this issue Jul 9, 2020 · 1 comment
Labels
question Further information is requested

Comments

@bironran
Copy link

bironran commented Jul 9, 2020

🤓 Question

I was playing the same story for a while and it got big. Over 8k lines and 400kb. My last inputs and remember are sane size (remember is below 2kb). I was starting to get plagued with "AI is busy" messages so I decided to debug.

I found out that subscription websocket (wss://api.aidungeon.io/subscriptions) returns the entire story after every command and during every KA. In my case, over 1MB of text send every 10 seconds (for KA) and after every action. No wonder I was getting timeouts.

Why was it planned this way, especially for single player adventures? Why not return just the modified text? Alter / revert commands work on the history anyway, so they apply locally after an ack from the server. Additions are easy and the client and server can verify integrity using a checksum after applying the last command then request the entire text on failure.

@bironran bironran added the question Further information is requested label Jul 9, 2020
@aawalton
Copy link

We'll likely update the subscription to send a diff at some point. Right now the game is really in an alpha phase, so we're prioritizing speed of iteration and modification over performance. As the game itself stabilizes, performance will increase in priority.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants