Home Artists Posts Import Register

Content

Here is the revised Platformer tutorial. I ultimately decided to abandon the very new collision method as after a lot of reflection I felt that its goals were flawed and even though it brings some very real advantages, needed some ugly and unintuitive fixes to make it work elegantly for most and especially newer developers, rendering it a poor option for a tutorial like this one.

So instead I have worked to refine my original approach to platformer collision, while not going quite as far as a true binary search which would be closer to truly "optimal" we've gone for a much more efficient while loop that takes floating point positions into account.

The main lesson I have learned through this process and want to pass on to the rest of you, is that true precision is not your goal when writing a collision system. We don't want to be truly flush with a wall especially now that our bounding boxes are inclusive in nature. At some point, the engine will not know what to do when your position contains too many decimal places and unpredictable results can arise. And given we're not in control of our engine, the problem is even worse for us. 

So if you have a wall with a top edge at a y of 140.0000, do not aim to put your player's feet at 140.0000, aim to put it at roughly 139.95. That's the approach we take in this video and I think generally the safest and smartest way going forwards.

I may make a separate video exploring the journey I went on making this video as a few people have asked for an explanation of "what went wrong" with the first video. There's a lot to say! So more on that soon.

This releases to the public on Friday. Hopefully if I've made some other critical error one of you might spot it by then! Haha. I laugh so that I do not cry.

-S

Files

GameMaker v2022+: Platformer Tutorial

▶ Source code: (coming soon). ▶ Support my work: https://www.patreon.com/shaunjs This video is focused on how to make a solid framework for a platform game in the latest version of GameMaker Studio 2 (v2022.1+). If you want to make a platform game while being given a more gentle introduction to GML and coding, and learn various other techniques I recommend my Complete Platformer Series instead: https://www.youtube.com/watch?v=izNXbMdu348

Comments

Anonymous

Thank you so much for taking not only the time to be really thorough with this, but also a refinement on something that is needed and often overlooked. After working hard on this game jam over the past month (My first, MV15)... It seems it's a fantastic time to revisit. I have run into a few edge case scenarios while doing this and have found sometime necessary to use different collision methods; though admittedly, I could be doing that wrong. Would that be of interest to you or anyone else to advise on that or maybe make a video showing different methods and ideas of combining? It's highly interesting to me - Tile based collisions seem great on massive levels, and seems a lot more efficient, but then sometimes it gets weird to collide with solids and I haven't found a great way of addressing using tiles in a similar manner - example would be I used autotiles to build the level, but doors get really tricky tilemap_clear seems right, but destroys all the tiles matching, I couldn't really figure out in the time constraint how to make that happen. Maybe it will make more sense after sleep ;) Anyway, thanks again! You rock ♥

Anonymous

Great video! Looking forward to seeing where this series goes.