about summary refs log tree commit diff
path: root/users/grfn/xanthous/pkg.nix
diff options
context:
space:
mode:
authorGriffin Smith <grfn@gws.fyi>2021-06-12T18·41-0400
committergrfn <grfn@gws.fyi>2021-06-12T18·57+0000
commitc19e3dae5f6087c7e446c6be620c370d9957cf7c (patch)
tree29c3c1206c615478cac96da978c96271b05e4f1b /users/grfn/xanthous/pkg.nix
parent80d501d553b4aa5c7f687c69cb473ea2ac299354 (diff)
feat(xanthous): Memoize characterVisiblePositions r/2653
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
Diffstat (limited to 'users/grfn/xanthous/pkg.nix')
-rw-r--r--users/grfn/xanthous/pkg.nix53
1 files changed, 27 insertions, 26 deletions
diff --git a/users/grfn/xanthous/pkg.nix b/users/grfn/xanthous/pkg.nix
index da5a5ba17ed7..ccc0c3fcd451 100644
--- a/users/grfn/xanthous/pkg.nix
+++ b/users/grfn/xanthous/pkg.nix
@@ -2,13 +2,13 @@
 , checkers, classy-prelude, comonad, comonad-extras, constraints
 , containers, criterion, data-default, deepseq, directory, fgl
 , fgl-arbitrary, file-embed, filepath, generic-arbitrary
-, generic-lens, generic-monoid, groups, hgeometry
-, hgeometry-combinatorial, hpack, JuicyPixels, lens
-, lens-properties, lib, lifted-async, linear, megaparsec, mmorph
-, monad-control, MonadRandom, mtl, optparse-applicative, parallel
-, parser-combinators, pointed, QuickCheck, quickcheck-instances
-, quickcheck-text, random, random-extras, random-fu, random-source
-, Rasterific, raw-strings-qq, reflection, semigroupoids, splitmix
+, generic-lens, groups, hgeometry, hgeometry-combinatorial, hpack
+, JuicyPixels, lens, lens-properties, lib, lifted-async, linear
+, megaparsec, mmorph, monad-control, MonadRandom, mtl
+, optparse-applicative, parallel, parser-combinators, pointed
+, QuickCheck, quickcheck-instances, quickcheck-text, random
+, random-extras, random-fu, random-source, Rasterific
+, raw-strings-qq, reflection, semigroupoids, semigroups, splitmix
 , stache, streams, tasty, tasty-hunit, tasty-quickcheck, text
 , text-zipper, tomland, transformers, vector, vty, witherable, yaml
 , zlib
@@ -23,54 +23,55 @@ mkDerivation {
     aeson array async base bifunctors brick checkers classy-prelude
     comonad comonad-extras constraints containers criterion
     data-default deepseq directory fgl fgl-arbitrary file-embed
-    filepath generic-arbitrary generic-lens generic-monoid groups
-    hgeometry hgeometry-combinatorial JuicyPixels lens lifted-async
-    linear megaparsec mmorph monad-control MonadRandom mtl
+    filepath generic-arbitrary generic-lens groups hgeometry
+    hgeometry-combinatorial JuicyPixels lens lifted-async linear
+    megaparsec mmorph monad-control MonadRandom mtl
     optparse-applicative parallel parser-combinators pointed QuickCheck
     quickcheck-instances quickcheck-text random random-extras random-fu
     random-source Rasterific raw-strings-qq reflection semigroupoids
-    splitmix stache streams text text-zipper tomland transformers
-    vector vty witherable yaml zlib
+    semigroups splitmix stache streams text text-zipper tomland
+    transformers vector vty witherable yaml zlib
   ];
   libraryToolDepends = [ hpack ];
   executableHaskellDepends = [
     aeson array async base bifunctors brick checkers classy-prelude
     comonad comonad-extras constraints containers criterion
     data-default deepseq directory fgl fgl-arbitrary file-embed
-    filepath generic-arbitrary generic-lens generic-monoid groups
-    hgeometry hgeometry-combinatorial JuicyPixels lens lifted-async
-    linear megaparsec mmorph monad-control MonadRandom mtl
+    filepath generic-arbitrary generic-lens groups hgeometry
+    hgeometry-combinatorial JuicyPixels lens lifted-async linear
+    megaparsec mmorph monad-control MonadRandom mtl
     optparse-applicative parallel parser-combinators pointed QuickCheck
     quickcheck-instances quickcheck-text random random-extras random-fu
     random-source Rasterific raw-strings-qq reflection semigroupoids
-    splitmix stache streams text text-zipper tomland transformers
-    vector vty witherable yaml zlib
+    semigroups splitmix stache streams text text-zipper tomland
+    transformers vector vty witherable yaml zlib
   ];
   testHaskellDepends = [
     aeson array async base bifunctors brick checkers classy-prelude
     comonad comonad-extras constraints containers criterion
     data-default deepseq directory fgl fgl-arbitrary file-embed
-    filepath generic-arbitrary generic-lens generic-monoid groups
-    hgeometry hgeometry-combinatorial JuicyPixels lens lens-properties
+    filepath generic-arbitrary generic-lens groups hgeometry
+    hgeometry-combinatorial JuicyPixels lens lens-properties
     lifted-async linear megaparsec mmorph monad-control MonadRandom mtl
     optparse-applicative parallel parser-combinators pointed QuickCheck
     quickcheck-instances quickcheck-text random random-extras random-fu
     random-source Rasterific raw-strings-qq reflection semigroupoids
-    splitmix stache streams tasty tasty-hunit tasty-quickcheck text
-    text-zipper tomland transformers vector vty witherable yaml zlib
+    semigroups splitmix stache streams tasty tasty-hunit
+    tasty-quickcheck text text-zipper tomland transformers vector vty
+    witherable yaml zlib
   ];
   benchmarkHaskellDepends = [
     aeson array async base bifunctors brick checkers classy-prelude
     comonad comonad-extras constraints containers criterion
     data-default deepseq directory fgl fgl-arbitrary file-embed
-    filepath generic-arbitrary generic-lens generic-monoid groups
-    hgeometry hgeometry-combinatorial JuicyPixels lens lifted-async
-    linear megaparsec mmorph monad-control MonadRandom mtl
+    filepath generic-arbitrary generic-lens groups hgeometry
+    hgeometry-combinatorial JuicyPixels lens lifted-async linear
+    megaparsec mmorph monad-control MonadRandom mtl
     optparse-applicative parallel parser-combinators pointed QuickCheck
     quickcheck-instances quickcheck-text random random-extras random-fu
     random-source Rasterific raw-strings-qq reflection semigroupoids
-    splitmix stache streams text text-zipper tomland transformers
-    vector vty witherable yaml zlib
+    semigroups splitmix stache streams text text-zipper tomland
+    transformers vector vty witherable yaml zlib
   ];
   prePatch = "hpack";
   homepage = "https://github.com/glittershark/xanthous#readme";