Jumping to Variable Conclusions
Overview
Spent majority of my time working this week on getting rooms to a solid rough draft state and adding features that I felt were absolutely necessary for shipping a demo: variable jumps and drop through capable platforms. I found these to be important because at times the player would attempt a jump and end up jumping too high, bouncing off the ceiling, and failing to reach the platform on the other side. The variable jump allows the player to do a short hop instead of a maximum height jump. The drop through platforms could be utilized at the top of a ladder to allow the player to climb up/through the platform, then land on the platform so they can jump. Players cannot currently jump while climbing. Apologies for lack of visuals this devlog, most of the work has been through code this week and not a lot of visuals could be added.
Room Rough Drafting
As of writing this, I have created rough drafts for all but two rooms in the first zone (I still need to build puzzles for select rooms), but for now they have have hidden items, platforms, and entities inside them so they are not entirely empty. These rough drafts will continuously be updated especially as I start to switch gears into developing puzzles.
Drop Through Platform Coding
Drop through platforming did not exist on the engine I am currently using so I had to code some interesting layer play in the game to create the illusion on true drop through platforming. The very short version: I coded in special walls that wait for specific conditions to be met (i.e., player pressing both down and the jump button) then change from the special walls layers to the enemy projectiles layer. This was done because the enemy projectiles layer gets updated each tick and has collision calculations with the player (important for determining when to change back to the special wall layer) but does not prevent the player from passing through. Once another set of conditions are met, the platform reverts back to the special wall layer. I was working on getting this to work right for a long while and came across a few buggy instances (e.g, walls never changing, not changing back, causing errors rooms without, causing errors in rooms with enemies specifically). The current iteration is a little hefty, but it is functional. I will definitely be working to clean it and reduce it's bulk but it does not appear to have an effect on performance.
Variable Jumping
Last bit of code I worked on was the variable jumps. I ended up finding an older article explaining how to do this with the Arcade module so I thought to myself that all the work was already done for me and all I would have to do was make adjustments. However, this article was severely out of date and a lot of the information no longer applied to the Arcade module/my physics engine. So I now needed to coded this functionality in myself. I stole the core concept of the code from the article and used that as a baseline: when the player presses the jump button the players jump power begins to increase either until a max jump power is reached or until the button is released. The way I ended up implementing it takes the physics engine gravity into account. When the jump button is pressed, the player jumps at a minimum power level (the shortest possible jump height) which is immediately effected by gravity, slowing the player's upward velocity. While the button is pressed, the player's upward velocity is increased (an amount that counters the effects on gravity) in order to increase the amount of time that the player has an upward velocity. Originally, I used the player's y-axis velocity as the measure for when the jump height was reached, but this had the problem of enabling the player to float along the ceiling if they were able to hit it when jumping (hitting the ceiling drops that y-axis velocity to 0 which is indeed less than the max velocity number I set). So I had to code in an additional check for if the player was "jumping" and if the player's y-axis velocity became 0, then the player was no longer jumping and therefore would no longer upward velocity, beginning their experience of the full effect of gravity. Right now, the code for it is a little buggy, but it is functional enough for the time. I will continue cleaning it up and fine tweaking the jump to make it feel good and predictable to use.
If you want to stay up to date with the game you can follow the game to get updates, join our Discord server, or subscribe to the devlog RSS feed:
Athenaeum Lost
A spellcasting and puzzle-filled metroidvania
Status | In development |
Author | Sleepy Geese Studios |
Genre | Platformer |
Tags | Magic, Metroidvania, Singleplayer |
Languages | English |
More posts
- Boss Fight and Bug FixesDec 12, 2023
- Zone 1 Work and Player FeedbackNov 26, 2023
- Optimizing and Zone 1 Boss DesignNov 17, 2023
- Code MagicNov 06, 2023
- Codex Devlog 2: Athenaeum Lost Devlog 0?Oct 27, 2023
- Devlog 1: Menus, Music, and MoreOct 15, 2023
- Devlog 0: Saving and Spell MenusOct 06, 2023
Leave a comment
Log in with itch.io to leave a comment.