Game Juice! Making guns fun (Gamemaker Studio 2 intermediate tips)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
i've been a hobbyist game dev for the past three years and in my games guns are the primary way of interacting with the world so they gotta be fun to use the main way i try to do this is by cranking up the juice juice otherwise known as game feel is how good the feedback of an action feels for example if i click this button the feedback i get from it is pretty weak it doesn't feel like anything special so by adding more layers of visual feedback this button is now so much more fun to press even if it doesn't actually do anything now let's apply this idea to weapons so we have this gun and the goal is to make it fun to shoot in a nearly empty room step one is adding stretch to the bullets it's super easy to do just set the x scale to the speed divided by the sprite width make sure to use the function max so that the sprite doesn't end up being smaller than its default scale of one doing all this not only conveys a lot of speed but it also helps with collision detection since the bullet's collision box is stretched to fill the gaps between frames step 2 recoil there are a few ways to create recoil one way is quite simple just move the gun opposite to where it's pointing and then slowly move it back into place it looks all right enough but we can get juicier how i do recoil is by using gamemaker's animation curves to have more complex movement firstly we're going to create a new animation curve inside it make an x and an angle curve here you can move these lines around to get your desired movement then we'll go to the gun object and initialize some variables including new variables for the x and image angle in the step event where the gun fires set the curve position to the start and set the speed of the animation next set the curve position to increase by the curve speed set our new image angle and x variables to follow what we animated and then reset the animation curve when it's all done now because we're not using the built-in x and image angle functions for the gun anymore we need to draw the gun in the draw event manually like this and there we go to me this way of doing recoil is much more interesting looking step three is impact effects complicated particles can be extremely time consuming to make so i'll just cheat and show you how to make simple particles that are pretty customizable still we're going to be using this concrete block as our target so for our particle i made a short animation of a shrinking circle where the first frame is a small white shape all you need for your particle object is a step event with a couple of things in it friction to slow the particle down over time and to destroy the particle when the animation is all done now where the bullet hits something we put this the reason i didn't make a create event for this particle is because we're going to be doing all that right here look at that nice and simple since it's so simple i can make a spark type of particle super easily and just by changing a couple things we now have sparks since juice is all about feedback i want the player to really know that they shot a wall so i think it could use some chunks of debris flying out and by using game maker's surface system we can have infinite debris lying around with no performance cost at all first thing is establishing the surface itself we can do this in some game manager type object but because i'm lazy we're just going to do it in the camera's create event make sure to delete and recreate the surface in a room start event so old services don't appear in other levels in your game in the draw event we want to check to see if the surface exists and if it does draw it if it doesn't make a new one alright now that we got all that set up we can make our debris particle we're going to still use the particle object we already made because this makes things a little more compact to start we need to differentiate between our debris and our dust and sparks to do that we'll have a variable that if true will behave like debris and if false will behave like a particle this is easy to do with a switch statement if the particle is a piece of debris we'll draw it to the surface and then destroy it that way it stays on the ground permanently without causing any performance loss because we did all this let's go back to where we create our particles and mark them as not debris now we can create our debris by doing the same thing as the others but setting debris to true instead of false as well as having it pick a random chunk from the image strip and disabling the animation with all these things combined it feels heaps better than before i hope that some of this has helped you make your games a little juicier if you want to check out my games have a peek in the description maybe even wishlist rogue north on steam thanks for watching
Info
Channel: Mack
Views: 31,582
Rating: undefined out of 5
Keywords: gaming, gamedev, gamemaker, gamemaker studio 2, tutorial, mack, Rogue North, Gamemaker 2, Unity, UE4, Godot
Id: 9vgH3y1Te6k
Channel Id: undefined
Length: 5min 26sec (326 seconds)
Published: Fri Feb 04 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.