Perspective: Daily Puzzle
2022 March 07 18:40 stuartscott 42709¤ 893377¤
Perspective: Daily Puzzle is the latest in a series of casual puzzle games released by Aletheia Ware in which players navigate a 3-dimensional maze by swiping to rotate the puzzle and tapping to enable gravity.
A new puzzle is released everyday, getting more difficult throughout the week, can you solve it in the shortest time?
-
2022 March 07 18:45 stuartscott 1759640¤ 27115¤
Platforms
Web
Perspective: Daily Puzzle can be played right in your browser; no installs, no ads, no accounts. Just a fun puzzle to start your day!
The web player was written in Go and compiled with tinygo to reduce the binary from 2.6MB to 836KB, however the
embed
package is not currently supported by tinygo so game assets couldn't be bundled into the binary and instead are automatically fetched from the server separately.Native
Perspective: Daily Puzzle can also be played locally on your computer;
$ go install aletheiaware.com/perspectivefungo/cmd/glfwplayer $ glfwplayer -daily
The native player was written in Go using Go-GL.
-
2022 March 07 18:47 stuartscott 53110¤ 1121¤
Puzzle Generation
I spent a while trying to design an algorithm to generate puzzles with given characteristics such as the number of blocks, portals, and moves required to solve. But none of these algorithms were very good, and the generated puzzles did not feel natural or organic.
One day I was having lunch with a friend who specializes in Machine Learning and he was explaining how Generative Adversarial Networks (GANs) work - essentially one algorithm generates data, and another scores the generated data. This separation made it easy to test each part in isolation. While I wasn't using Machine Learning, the idea of a two part algorithm could be applied to puzzle generation. One algorithm could generate random puzzles and the second could use pathfinding to figure out a) whether the puzzle is solvable, b) how many moves are required to solve it, and c) how much of the puzzle was visitable.
The generator would take some information (size, elements, etc.) and generate a random puzzle which may or may not be solvable. The scorer would accept a puzzle and return an integer score (more moves = higher score, unused elements = penalty so all elements are visitable ie. false paths). I just had to wait a few days while it iterated through billions of permutations until the first set of puzzles was complete.
A few times the scorer would end up in an infinite loop and not make any progress, it turned out that portals could end up stacked and result in a portal infinite loop - something I had previously enjoyed in Valve's game series Portal.
The execution was parallelized so each of the 8 cores was used and the tasks were re-niced to -20 but a lot of time was still spent task/context switching, obviously the scheduler is trying to be fair to all processes and maintain a responsive system but the computer was not being used for anything else so fairness and responsiveness did not matter. Furthermore, when a task running on one core is swapped out to a different core, the higher-level caches are invalidated and the task needs to fetch from the lower-level cache or worse: main memory.
Taskset is very useful in this scenario as it can set a process's affinity, meaning the process will always be scheduled on the same core, this meant the scheduler did not spend so much CPU time context switching and ensured the tasks could make best use of the fastest cache levels. The graph comparison below shows the difference between not using taskset (top) where the CPU usage oscillates just below the max, and using taskset (bottom) where the CPU usage is anchored at 100%.
There are still many optimizations than can be made to improve the efficiency, as always the code is open source, feel free to take a look, suggest improvements, or send a pull request!
-
2022 March 07 18:47 stuartscott 2186¤ 56¤
Perspective Series
The Perspective series is inspired by the desire for minimalist puzzle games to enjoy while traveling, bored, or just generally waiting and needing to kill time - they don't require a huge time, effort, or cognitive commitment.
Perspective: Daily Puzzle is the sixth incarnation with little-to-no code copied between iterations.
The first was a prototype to test the mechanics, with hand written puzzles - tedious.
The second featured an in-app puzzle editor, but creating puzzles on a mobile phone was a challenge in itself and then required copying the result back to the development machine.
The third had a Java codebase shared between the Android app and a JVM-based application with a UI written in Swing and JoGL bindings that could edit and play puzzles. This made it easier to create and evaluate the puzzles but it was still difficult to come up with the designs and time consuming to implement them.
The fourth implementation defined the puzzles in Protobufs allowing the generation of puzzles to be completely detached from the game. This was the first iteration of the game to be published on the Google Play Store
For the fifth implementation I teamed up with Waldyn Joseph Benbenek III - who developed the storyline, characters, and created most of the models and textures - and Matthew Anthony Benbenek - who composed the soundtrack, sound effects, and trailer - to create Perspective: Perils of the Void which was also published on the Google Play Store
One of the major barriers to entry is needing the app to be downloaded and installed. Which is why this sixth implementation was built for the Web, written in Go and using WebGL to render the game right in the player's browser without needing to install anything. Inspired by Wordle, each day a new puzzle is released and once solved players can share their score on Twitter.
For more information visit https://perspective.fun. There is much room for improvement - suggestions are welcome!
-
2022 March 07 18:49 stuartscott 113¤
If you enjoy these types of games, you may also enjoy QB by Stefan Wagner
-
-
-
Convey is made available by Aletheia Ware under the Terms of Service and Privacy Policy.
Convey is an open-source project released under the Apache 2.0 License and hosted on Github.
© 2021 Aletheia Ware LLC. All rights reserved.