Last month I participated in a game development competition called the GMTK game jam. This is one of the largest annual jams with over 32,000 people signing up and 7,500 games submitted this year!
The theme was “Built To Scale” so I made a game about building tools to summit a mountain.
I wanted use this forum post to do more of a technical deep dive on the project here since this was my first time doing a few things including:
- Controller Support
- Wall climbing
- Crafting
If you’d rather see a more entertainment focused recap, check out the YouTube video I made on it: https://www.youtube.com/watch?v=RXnqBqgbV_Q
Controls and Control Rebinding
While working on the project I realized I had a lot of controls (Move, Jump, Climb / Hang / Get Material, Scroll through inventory, Open Menus, quick buy, and more).
This resulted in the (in hindsight) awkward choice of using left-shift as the climb / collect materials button. Hitting it several times opens the sticky keys menu and it can be a bit odd to hold during long climbs. I realized that with the amount of controls it might be worth while to try adding controller support. For the post-competition version, I decided to do just that.
I didn’t want to change any of the base movement code, so I instead decided to overhaul the input system.
I created a CONTROLS table that held all of the different selected keys then used a function to check for input. This allowed me to have a set table to rebind controls on and reuse all of my existing movement code:
The most time consuming part for me was setting up controller support within the menus. Previously the menus were only set up for mouse so I had to write a lot of new code.
The approach I took (and I would be very curious to know how others do this) was to create a 2d array of all of the menu options then programmatically find the next available one.
I had some difficulty when menus weren’t symmetrical since the code would try to jump to buttons that didn’t exist. I ended up having some pretty ugly code checking all spaces until a max limit is reached.
In the future I’ll likely need to add controller support to my project template to avoid a lot of the work I encountered here.
Wall climbing
Wall climbing / wall jumping was something I had never added to a game before (intentionally that is). The solution I ended up using was send out a raycast to both sides when the player is near a wall. It detects if a player has a wall on either side then begins to climb it.
It works mostly well but most players feel a need to hold a button towards the direction of a wall (which isn’t needed). I also had some issues exclusively on the HTML 5 build. Thankfully I was able to catch them early on and wasn’t trying to fix it right before the deadline.
Crafting
Crafting is something I’ve prototyped for a few abandoned projects in the past. It never felt right for those games, this felt like a good opportunity to finally add one in.
I created 2 arrays in a singleton, one for items the player had and another for ore the player could collect. When trying to create a new tool, I check and subtract from the Ore and provide an item in the inventory.
I used a singleton specifically so I could add in a “full game speedrun” mode where ore and items don’t reset between levels.
Conclusion
I had a great time making this game! I learned a lot and was able to try some new things out.
While there is more I’d love to do with this game, it was more of a break from a major game I’ve been working on. I hope to share more details on that with you all soon
Here is a link to the game if you’d like to try it out!