Create an account


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
News - Blog: Tips for improving your GameMaker platformer

#1
Blog: Tips for improving your GameMaker platformer

<div style="margin: 5px 5% 10px 5%;"><img src="https://www.sickgamedev.win/wp-content/uploads/2017/10/blog-tips-for-improving-your-gamemaker-platformer.gif" width="611" height="390" title="" alt="" /></div><div><p><strong><em><small>The following blog post, unless otherwise noted, was written by a member of Gamasutra’s community.<br />The thoughts and opinions expressed are those of the writer and not Gamasutra or its parent company.</small></em></strong></p>
<hr />
<p><em><a href="https://www.patreon.com/posts/14531948">Originally posted on my Patreon</a></em></p>
<p>I want to tackle some game-feel issues with jumping that I often see in beginner GameMaker platformers. If you are a student learning about game development, or a hobbyist learning GameMaker to prepare for your first game jam, this article is for you!  </p>
<p>When I noticed that I was giving the same feedback to student games over and over, I dug into the tutorials they used. Many GameMaker students referenced Shaun Spalding’s excellent platformer tutorials for their first game. I like these tutorials because they are simple and straightforward in a way that won’t overwhelm a beginner, even one with no coding experience. </p>
<p><a href="https://www.youtube.com/watch?v=IysShLIaosk">The original tutorial for Gamemaker Studio</a></p>
<p><a href="https://www.youtube.com/watch?v=izNXbMdu348">And an updated one for Gamemaker Studio 2</a></p>
<p>The trade-off for this simple approach, however, are a couple of game-feel issues that pop up as a result of the jump code. I’m going to focus on two small ways that beginners can modify the tutorial to make their jumping feel better:  <strong>Ledge Assistance and Jump Input Buffering </strong></p>
<p>These are common platformer implementation techniques, so the good news is that a lot of excellent stuff has already been written in depth about these concepts. But if you’re a beginner just building your very first platformer, this sort of stuff probably isn’t on the forefront of your mind. It’s already a big task to create all the pieces of a platformer from scratch, down to just getting your character moving at a basic level, so something like “jump input buffering” isn’t going to be a thing a beginner considers researching.</p>
<p>My hope is to connect these concepts to the base tutorial to help ease students into thinking about this sort of stuff with their games. Let us begin!</p>
<p><strong>1. Ledge Assistance</strong></p>
<p>Also known as ledge forgiveness, grace period jumping, coyote time, or a number of other terms, this is a fix for the following issue you may run into when setting up your jump code: You try and jump off a ledge at the last possible moment in order to clear a really big gap, but your jump input doesn’t register and you fall off the ledge instead.</p>
<p>The fix for this is allowing a few frames where the player can be not-on-the-ground but will still register a jump input – a grace period for jumping off of a ledge.</p>
<p>For an in-depth and  illustrated look at this concept, I highly recommend <a href="http://kpulv.com/123/Platforming_Ledge_Forgiveness/">Kyle Pulver’s article on this topic.</a></p>
<p>Since this concept is so closely tied to input and feel, it can be difficult to fully understand by visualizations alone. So I made a simple demo to help people understand how the grace period changes the feel of jumping.</p>
<p><strong><a href="http://storage.wertle.com/patreon/platformerFeel/Ledge%20Assistance/">Try the Ledge Assistance Demo (keyboard required)</a></strong></p>
<p>This is a very simple platformer setup based on the code in Spalding’s tutorials, but one where you can adjust the number of frames in the ledge assistance grace period.</p>
<p>The default is the grace frames set to 0, which is what it feels like in the default tutorial version. As you may be able to feel as you try to make the long jump from one ledge to the other, you can get into a situation where you try and jump at the last possible minute, but fall lifelessly to your death instead.</p>
<p><img alt="" src="https://www.sickgamedev.win/wp-content/uploads/2017/10/blog-tips-for-improving-your-gamemaker-platformer.gif" /></p>
<p>This feels terrible because there’s a disconnect between your input and what you expected to happen as a result. <a href="http://kpulv.com/123/Platforming_Ledge_Forgiveness/">Kyle’s article</a> goes more in depth into why this happens and provides an alternative implementation to avoid the issue, which is what I used to make the grace period.</p>
<p>By adjusting the grace frames (by clicking the up and down arrows), you are controlling the number of frames the player can simultaneously be “in the air” and press the jump button and still have that jump register. This is the “grace timer” that Kyle mentions in his article. <a href="http://storage.wertle.com/patreon/platformerFeel/Ledge%20Assistance/">Play around with this number</a> and feel the difference it makes in the jump. Check the “show feedback” button to get a visual cue to illustrate when the grace period is active.</p>
<p><img alt="" src="https://www.sickgamedev.win/wp-content/uploads/2017/10/blog-tips-for-improving-your-gamemaker-platformer-1.gif" /></p>
<p><strong>But Lisa, what is the right number of frames to use for a grace period?</strong></p>
<p>Well, this depends entirely on your game and what player feeling you’re going for. If you are making a very tight, precise action platformer, then you’ll probably want to make the frame window as small as possible while still compensating for human reaction time (if you want to get all mathy, consider your target frames per second, and the fact that average human reaction time is somewhere in the realm of ~215ms, or you can just do it by feel. I recommend starting with 6 frames and adjusting from there).</p>
<p>However, let’s say you’re making a game about the laziest bat who “jumps” by flapping her wings a single time, in which case it may make sense to have a super floaty jump and really long grace period, so the bat could amble off the edge and start visibly falling before “jumping.” I dunno, I just made that up off the top of my head.</p>
<p>My point is that there’s no universal right answer here, you’re going to have to tune it with the feel you’re going for in your game, in which you have to consider many things: level of challenge, experience of audience, reaction time factors for your audience, input device, the fantasy of your movement, etc.</p>
<p>You will find the script example at the end of this article.</p>
<h3> </h3>
<p><strong>2. Jump Input Buffering</strong></p>
<p>Another issue I see in a lot of student platformers is no input buffering on jumping, which is something that can feel bad if you’re making a game that requires a lot of repeated, precise jumping. Once again, <a href="http://kpulv.com/106/Jump_Input_Buffering/">Kyle Pulver has written about this and illustrated it at length</a>, and I recommend reading his article</p>
<p>The solution to this issue is in a way the opposite of the ledge assistance issue: you still want a grace period in which a jump input will register as true, but in this case you want it *after* you hit the jump button instead of before.</p>
<p><strong><a href="http://storage.wertle.com/patreon/platformerFeel/Jump%20Buffering/">Try the Jump Input Buffering Demo (keyboard required)</a></strong></p>
<p>Similar to the other demo, when the jump input buffer frames is set to 0, this is what you get with the base tutorial version. If you happen to hit the jump button just slightly *before* the character collides with the ground, it will not register, and so the character will sit there on the ground and you will feel grumpy about it. This happens more often when you are trying to do a series of jumps one after the other, jumping as soon as the character hits the ground.</p>
<p><img alt="" src="https://www.sickgamedev.win/wp-content/uploads/2017/10/blog-tips-for-improving-your-gamemaker-platformer-2.gif" /></p>
<p>Increasing the buffer frames is basically saying “if the player hits the ground within this number of frames after I press the jump button, just execute the jump as soon as they touch the ground”</p>
<p><img alt="" src="https://www.sickgamedev.win/wp-content/uploads/2017/10/blog-tips-for-improving-your-gamemaker-platformer-3.gif" /></p>
<p>Again, there’s no universal answer for how big of a buffer to use. <strong><a href="http://storage.wertle.com/patreon/platformerFeel/Jump%20Buffering/">Play around with different frame amounts</a></strong> and try to feel the difference it makes in the jumping. You’re trying to find a balance between compensating for player reaction time and still having the movement look and feel grounded and believable.</p>
<p>And think about what player feeling you are fulfilling with your game. Would it ever make sense to have a really really high input buffer? What would that game look like?? What would the fantasy be for that input to make sense and feel good? Maybe you should try and make that game!</p>
<p>Read on for a script sample.</p>
<p><strong>The Point</strong></p>
<p>When it comes to the wide world of game feel, these are but two small tweaks, and one can really dig in and get really deep into shaping player input to feel amazing. There are many others to explore: tuning variable jump height, nudge assistance, the idea of programming jumping in terms of max time to peak as a number to tune around, and so on.</p>
<p>But when you are just getting started with your first platformer and are feeling like you have a handling on the basics, I think these are good places to introduce yourself to tuning player input. It’s easy to get overwhelmed, especially if you aren’t an experienced coder, when you take on too much right off the bat.</p>
<p>And you can see when looking at the script itself below, even these two tweaks get quite a bit more complicated than the original tutorial script for player movement.</p>
<p>But I think it’s a good place to start, and a great way to add a little extra polish to your first platformer, be it for a class project or a game jam or just for fun.</p>
<h3> </h3>
<p><strong>Script Samples</strong></p>
<p>If you are following Spalding’s GameMaker tutorial, you should be able to copy and paste these scripts into the player object’s Create event and Step events, respectively. Set grace_jump_time and jump_buffer to whatever number felt good to you when playing with the two demos. I tried to comment thoroughly. Or you can just look at the whole GameMaker project attached below. Good luck!</p>
<p><a href="http://storage.wertle.com/patreon/platformerFeel/ModifiedPlayerCreateEvent.txt">Modified Player Create Event</a></p>
<p><a href="http://storage.wertle.com/patreon/platformerFeel/ModifiedPlayerStepEvent.txt">Modified Player Step Event</a></p>
<h3> </h3>
<p><strong>All the Links in One Place</strong></p>
</div>
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum software by © MyBB Theme © iAndrew 2016