Inspiration

I love the Desmos platform, and I enjoy pushing it to its limits. I had seen games in Desmos that looked fine, but I hadn't really seen anything that I would actually enjoy playing. So, I decided to attempt to make a basic game that one might see as the result of a game jam using Unity or Godot.

What it does

This is a game that runs in Desmos. It aims to offer a proper arcade experience, with settings, and a consistent experience across multiple resolutions. It is a top-down shooter with keyboard input and several enemy types. It has three premade difficulty settings as well as the option to make custom difficulties, as well as two color schemes to choose from. This provides a good set of defaults for most players, but allows them to tweak the experience to their preferences. The game itself has enough of a difficulty range that it can be enjoyed by both new and experienced players, even without changing the difficulty settings. Overall, it is a full arcade game, though it has no way of saving player information due to engine limitations.

How we built it

Desmos has more display options than most people are aware of, with solid objects being able to be displayed through either inequalities or polygons. Desmos also has the option of creating a "global loop" in the form of a ticker, which runs "actions" as often as you want it to. These actions can change the values of variables, and piecewise functions allow for control flow. Though they cannot be nested, lists are also immensely valuable for running calculations. All of these factors come together to create, in around 400 equations, the playable experience.

Challenges we ran into

There were a LOT of performance issues, since this is not really what Desmos is for. In addition to that, there is very little information on how to optimize Desmos graphs, so I had to do external testing for a lot of it. In addition, there are significant engine limitations: variables are updated simultaneously, so only one change can be made to variables each tick, lists cannot be nested, points cannot be appended to empty lists, and far more. All of these required the game to be built around them, some of which I only figured out after planning out the full architecture already.

Accomplishments that we're proud of

It can be hard to point to specific elements of the system which are impressive, since one of the major challenges was getting everything to work together around the limits of Desmos. However, there are a few specific algorithms that I think are technically the best. The first is the list filtering function, which had some existing versions online already, all of which used outdated, slower versions (usually O(n*d), where these are the lengths of the filter list and the list to filter). I managed to get this to linear time for a sorted filter list, as would be expected in a non-Desmos solution, using the new recursion features.

What we learned

I did a lot that I had never done in Desmos before: resolution scaling, recursion, and complex numbers all were features I had never touched before this project. It also required a lot of math (obviously) and some common algorithms (such as filtering from a list) had to be completely reframed to work in a Desmos mindset. I also learned about game design features such as reactive spawning and weighted enemy types.

What's next for XIWII Project: A Desmos Game

I am also submitting this project for the Desmos Art Competiton, so we will see how that goes. Some improvements to run speed are almost certainly possible, and there may be a better way to handle user input than my current setup, but I was unable to find them. Desmos also releases new features, so one of those could potentially unlock more for this project. I could also do a 3D version, which would be very interesting to work with.

Built With

  • desmos
Share this project:

Updates