tvl-depot/users/grfn/xanthous/src/Xanthous
Griffin Smith c19e3dae5f feat(xanthous): Memoize characterVisiblePositions
Memoize the return value of characterVisiblePositions to a new,
semi-abstracted "memo" field on the GameState, recalcuclated if the
character position ever changes. I'm 90% sure that the perf issues we
were encountering were actually caused by characterVisiblePositions
getting called once for *every tile* on draw, but this slightly larger
change also makes the game perform relatively-usably again.

Since this is only recalculated if the character position changes, if we
ever get non-transparent entities moving around without the characters
influence (maybe something building or knocking down walls?) we'll have
an issue there where the vision won't be updated as a result of those
changes if they happen while the character is taking a non-moving action
- but we can cross that bridge when we come to it.

Change-Id: I3fc745ddf0014d6f164f735ad7e5080da779b92a
Reviewed-on: https://cl.tvl.fyi/c/depot/+/3185
Reviewed-by: grfn <grfn@gws.fyi>
Tested-by: BuildkiteCI
2021-06-12 18:57:52 +00:00
..
AI refactor(users/glittershark): Rename to grfn 2021-04-12 14:45:51 +00:00
App refactor(users/glittershark): Rename to grfn 2021-04-12 14:45:51 +00:00
Data feat(xanthous): Memoize characterVisiblePositions 2021-06-12 18:57:52 +00:00
Entities refactor(users/glittershark): Rename to grfn 2021-04-12 14:45:51 +00:00
Game feat(xanthous): Memoize characterVisiblePositions 2021-06-12 18:57:52 +00:00
Generators refactor(users/glittershark): Rename to grfn 2021-04-12 14:45:51 +00:00
Messages refactor(users/glittershark): Rename to grfn 2021-04-12 14:45:51 +00:00
Util refactor(users/glittershark): Rename to grfn 2021-04-12 14:45:51 +00:00
App.hs feat(xanthous): Memoize characterVisiblePositions 2021-06-12 18:57:52 +00:00
Command.hs refactor(users/glittershark): Rename to grfn 2021-04-12 14:45:51 +00:00
Data.hs refactor(users/glittershark): Rename to grfn 2021-04-12 14:45:51 +00:00
Game.hs refactor(users/glittershark): Rename to grfn 2021-04-12 14:45:51 +00:00
Generators.hs refactor(users/glittershark): Rename to grfn 2021-04-12 14:45:51 +00:00
Messages.hs refactor(users/glittershark): Rename to grfn 2021-04-12 14:45:51 +00:00
messages.yaml refactor(users/glittershark): Rename to grfn 2021-04-12 14:45:51 +00:00
Monad.hs refactor(users/glittershark): Rename to grfn 2021-04-12 14:45:51 +00:00
Orphans.hs refactor(users/glittershark): Rename to grfn 2021-04-12 14:45:51 +00:00
Prelude.hs feat(xanthous): Memoize characterVisiblePositions 2021-06-12 18:57:52 +00:00
Random.hs refactor(users/glittershark): Rename to grfn 2021-04-12 14:45:51 +00:00
Util.hs refactor(users/glittershark): Rename to grfn 2021-04-12 14:45:51 +00:00