Skins allow all the bones and animations for a skeleton to be reused with a different set of attachments. This greatly reduces the effort needed for multiple characters that have similar bones and animations. The key to skins is the Skin Placeholder. A skin placeholder is an attachment which goes under a slot in the tree, like any other attachment. Oct 31, 2017 video process of halloween girl animation by spine 2d pro I am selling video process of making it here The video set consists of 3 parts with a total time of. Arman Harutyunyan has a short tutorial showing how you can rig a wing using Spine 2D Animation. There are a few animation tools out there that focus specifically on 2D game animation, and lots of.
In this article, we're going to introduce you to a very powerful tool for creating naturalistic sprites using skeletal animation. The idea behind this is that you create a base skeleton and then move the bones to create poses. These poses can then be turned into animation key-frames, and in turn you interpolate the bone positions between each key-frame to create a smooth and very natural looking animation. This animation can then be skinned (ie: given a texture) and drawn to the screen like a sprite.
GameMaker Studio 2 supports this type of animated sprite, as it can import files created using the program Spine, which is a fantastic tool for creating skeletal animations (you can find out more about Spine here). Note that Spine is a very powerful program with lots of possibilities and there is not nearly enough room in one short article to explain how it all works! We will however give a brief overview of some key points that are related to the way that GameMaker Studio 2 implements skeletal animation sprites.
NOTE: Spine has a Trial version available for download here: http://esotericsoftware.com/spine-download
As mentioned in the introduction, Spine works by having you create a skeleton and then pose it to create animations. The skeleton is composed of bones, which can be attached and moved in relation to one another over a set time-frame, and the final animation can be skinned with character graphics for the final animation. This animation can then be exported either as a bitmap sprite strip, or as a Spine JSON file for adding into your game in the GameMaker Studio 2 sprite editor.
If you are simply exporting a bitmap sprite, then you can stop reading here, as there really isn't much more to say since the method for creating and using 'normal' sprites is well known, however if you export the animation using the Spine JSON format export, it permits you to do far more things with your Spine animation than a simple sprite strip.
Some of the most basic features of skeletal animations are:
being able to have a single sprite and create multiple animations for it - for example a walking, running and jumping animation set
having multiple skins for your sprite, so that a single skeleton can be skinned differently to create multiple characters (all with the same movements, of course) in a single sprite resource
you can give your sprites attachments to change their look further by permitting them to wield different items
All these things (and more!) are available to use in GameMaker Studio 2 too when importing JSON sprites.
NOTE: You can find the full documentation for all Spine features here: Spine Documentation
NOTE: GameMaker Studio 2 requires a specific runtime version of Spine to correctly import and use the skeletal animation sprites that it creates. Please see the YoYo Games helpdesk article on Required SDKs for GameMaker Studio 2 to find out the current runtime required.
Before getting into GameMaker Studio 2 side of things, it's worth going over a few key concepts when using Spine. The first of these is that you need to name your bones and a few other things, and that these names will be what you use as your 'handle' into the animations when working with them in GMS2. We recommend that you try and keep any names memorable, short and consistent.
You will also want to pay attention to where the root is in your animation. The root is where your Spine animation would be anchored within the Spine world space, and when you import your sprite into GameMaker Studio 2, this will be translated as the x/y origin for the sprite resource, and this is not editable for this kind of sprite in the GMS2 sprite editor. Most of your calculations for moving parts of the skeleton will also depend on this root point.
When creating your animations, you set a pose and then create a key frame from the pose. After that you would advance the timeline for the animation and create another key frame. After doing this Spine will interpolate the bone data between the key frames to give a smooth animation, which can then be named and saved. You can create multiple animation sets for one sprite, and give each one a separate name which can then be used in GameMaker Studio 2 to set the skeletal animation pose for your imported sprite.
There are also attachment slots available for your Spine sprite, and these are points where you can have your sprite draw a separate image that doesn't have a bone. It will then be moved along with the parent bone, permitting you to give your animation multiple sub-images for attaching within a single sprite. These attachment slots should be named appropriately, as should the images that they use, since these names will be used within GameMaker Studio 2 to change attachments at run-time.
Once you have your Spine sprite ready, you can then export it for use with GameMaker Studio 2. When exporting your sprite, please ensure that you have selected the Texture Atlas: Pack option from the export options, as GameMaker requires the generated -atlas file, and this isn't created without this option being checked.
When you export a skeletal animation sprite from Spine as JSON, you will actually be creating three separate files: the base .json file which contains all the bone data and animations, the .atlas file which has the data about how the textures are packed, and a .png file which contains the texture itself. The important thing to note here is that these files must always be in the same folder and all together for the sprite to be correctly imported into GMS2.
The way to import them into the GameMaker Studio 2 is almost identical to that for adding a normal bitmap image - you need to create a new sprite and then click the Import button, which will bring up the standard OS file selector dialogue, and then make sure that you have selected *.json from the file filter at the bottom, before browsing to where you have saved the Spine files and selecting the one you wish to import.
Once you have imported the animation, you can set the collision properties, but note that you are limited here to simply using precise collisions or bounding box collisions, and that the collision data for a skeletal animation is explicitly taken from the data provided. GameMaker Studio 2 does not generate any collision mask if the data is missing from imported file, meaning you simply won't get working collisions if the masks are not set correctly in Spine. Also note that - unlike bitmap sprites - the imported skeletal animation sprite cannot be modified in the image editor in any way, meaning any changes that need to be made should be done in Spine and then re-imported into your game.
NOTE: Due to the complexity of skeletal animations, the preview image shown in the sprite editor is not intended to accurately represent your animation, but rather give you a simple image that represents the animation for visualising in the room editor.
Once the sprite has been loaded into GameMaker Studio 2, you can use it as you would any other sprite. You can assign them to an object, or set them to an instance in code, and they will respond to most of the sprite instance variables too - so they can be scaled, rotated, coloured and have alpha values changed - all in-game. They can also be drawn using most of the different sprite_*()
functions as you would any other sprite, with the exception of draw_sprite_pos()
, and draw_sprite_part()
which won't work with this kind of sprite.
However, the point of using Spine is to create a skeletal animation sprite with multiple poses and skins, which that is most definitely not like a normal bitmap sprite. Therefor GameMaker Studio 2 has a host specific skeleton_*()
functions, as well as an Animation Update Event to deal with these types of sprite. The rest of this article will give a brief overview of the most commonly used functions and what they do, but you can find a full explanation of each one in the manual.
These functions will get the name (a string) of the currently set animation for a Spine sprite, or set the sprite to use the named animation. So, say you have a 'run' and a 'walk' animation, then you would change between them using these functions when the player presses a key (or whatever).
These functions are similar to the above ones for animations, but slightly more complex in how they work. Spine permits you to define bone animations for only a part of a skeleton, and you can then create separate animation sets for those parts and have them play together. Each animation is assigned to a track, with track0 always being the base, default animation. In this way you may have - for example - a figure with a 'walk' animation assigned to it, and this animation only affects the legs. You could then have various other animations where only the arms, or the head, or the upper torso, etc... are moved and assign one of them to track 1 using these functions. GameMaker Studio 2 would then play both animations together.
This little function is possibly one of the most important ones when it comes to the final look of your imported sprite. You can change animations at any time using the above mentioned skeleton_animation_set()
function, but on doing so the imageindex will be reset to 0, which may make the transition 'jumpy' as it goes from one pose to the other. Now, with bitmap sprites this is expected and may even be desirable, but with skeletal animation sprites it looks odd and buggy. However you can remedy this by using the ```skeletonanimation_mix()``` function which will interpolate the given animation sets so that they flow into each other in a natural way. For example, you can set a mix for your 'run' animation into your 'jump' animation, then set another mix for the 'jump' animation to change into the 'run' animation and your sprite will now animate seamlessly between the two sets.
A single skeletal sprite animation can have one or more skins, and these can be switched using the functions above. This means that you can have multiple characters in your game, and all of them can have a different visual look but using the same base sprite animation. GameMaker Studio 2 permits you to use multiple skins for each single sprite in this way, and you can even use multiple texture pages per sprite (this is covered in detail in the helpdesk article Spine: Using Multiple Texture Pages). Note that when you set up your Spine sprite, you should have a target platform in mind and set the texture page size when exporting your sprites to a size appropriate for that target. For example, if you are targeting mobile devices, you might want to have your Spine texture page set for 1024x1024, but for desktop you may want 2048x2048 or larger.
As mentioned previously, you can attach images to the skeletal animation sprite and they will behave as if they were part of the bone structure of the animation. These functions are used to set this, with you simply selecting the slot name (as defined in Spine) to hold the attachment and the attachment to assign. However, you also have the ability to use any one of the sprite resources that are included in your game - either as part of the base resources or as an included file - which makes these sprites an even more flexible option for games.
While you would normally use the draw_sprite_*()
functions to draw the skeletal animation sprite, there are times when you may want to draw extra data or a single sub-image of a single animation (for a pause screen, or a special effect, etc...). That's why these functions have been added, with the first of them simply flagging the collision data for drawing or not. If the flag is set to true then you will see the bounding box and the precise mask drawn over the sprite on the screen (this data is created when you create your sprite in Spine), while the second function permits you to draw the collision data for an individual frame of any animation.
The final function is a bit different, in that it permits you to draw any frame of any animation with any skin, making it a powerful tool for testing things in-game. Note that although you can use this in-game for drawing a frame of a Spine sprite animation, it has a tremendous overhead due to the fact that GameMaker Studio 2 will have to do multiple calculations to correctly position the bones for the given frame, so it should only really be used as rarely as possible.
As you can imagine from the outline given above, skeletal animation is an incredibly powerful tool. It permits naturalistic animations with a minimum of effort, and (thanks to the mix function) these animations can flow into each other to create a very smooth user experience in your games. The skin and attachment functions available in GameMaker Studio 2 also mean that you can simplify the generation of multiple sprites from a single source, and even permit the player to customise them at run-time. Obviously, this is not a system that will be applicable to all games, but if you check out the Spine web site and the demo linked below, you will find that it is surprisingly versatile and well worth the time and effort required in making a sprite and importing it into GameMaker Studio 2.
The above demo was created using Spine and shows some of the functions mentioned above in action.
GameMaker Studio is a powerful 2D engine developed by YoYo Games. With its drag-and-drop interface and a host of features, GameMaker simply makes game development easy.
Hit titles like Hotline Miami and Hyper Light Drifter have helped popularize GameMaker. It’s now supported by a sizable community of 2D game developers with new devs joining all the time.
With cross-platform support this program can deploy to every major platform, saving developers time by giving them access to several markets simultaneously. It also has its own scripting language—Game Maker Language—that can be used to create almost anything.
To get started learning this incredible program we have this list of tutorials on GameMaker so you can dive right into creating your dream game as soon as possible.
We’ve provided a variety of tutorials that cover several game genres so there’s guaranteed to be something in here for everyone.
This tutorial created from the folks at GameMaker studios will walk you through the basics for a top-down action game.
You’ll start with player movement and work your way into more advanced topics.
You’ll learn how to navigate the GameMaker interface and add your own scripts. With only a few lines of code, you’ll be able to move your character around the screen with only a keyboard.
Using a system of Events and Actions, GameMaker makes it easy to program advanced logic too.
Shaun Spalding covers everything you need to get started making your own platformer in GameMaker Studio 2.
In this series Shaun makes use of the newest methods that get beginners up to speed quickly. Aimed at beginners and intermediate users alike, this series will have you leaping over pipes and jumping on Goombas in no time.
You start by setting up your game environment and then move on to player movement. You’ll learn how to create gravity and collisions in fewer than 40 lines of code.
Here’s a handy learning tool from HeartBeast that teaches beginners how to make a 2D Hack-n-Slash game in GameMaker Studio 2.
You’ll learn everything from how to animate characters to coding in GameMaker.
With step-by-step instructions you’ll learn the basics of GameMaker while working toward a playable game that you can use in your portfolio.
Over the course of this series you’ll learn many techniques that are applicable to almost any game style too.
And if you like this tutorial check out the instructor’s full pixel art course from Udemy.
Here we have another video from HeartBeast (AKA Benjamin) who covers the basics of building a Role Playing Game.
This is aimed at total beginners who are itching to build their very own classic RPG.
Using retro RPGs like Final Fantasy and Chrono Trigger as a guide, Benjamin will show you how to use tiles to build a room and add collision events.
Next you’ll work on movement and getting your character to respond to input. As you progress through the series you’ll learn how to add custom behaviors and animations via GML.
This two-part guide by Shaun Spalding takes an in-depth look at melee combat in GameMaker.
The example used is a 2D platformer, but these techniques will work for any game.
Part 1 covers a state-machine to create a basic attack. In part 2 you’ll learn about making combo-chains and linking multiple attacks.
This is a code-heavy tutorial that focuses on the concepts behind creating a melee system. By the end you’ll have a strong understanding of using hit boxes for melee combat along with scripting for your own games.
Shaders are one of the most powerful and versatile tools in a game developer’s toolbox.
They can be used to create a range of effects and are present in most games.
It’s true that shaders are an advanced topic, but the rewards for using them are well worth the trouble of learning how.
In this video HeartBeast will guide you through shaders in GameMaker. He’ll show you how to use the shader editor to add some incredible visual effects to your games.
This tutorial starts with some simple demonstrations and concludes with making a custom greyscale shader in GameMaker.
Most game engines provide some type of physics engine and Game Maker is no exception.
Using physics it’s possible to create a variety of realistic animations and mechanics for your games.
This video, also from Shaun Spalding, concentrates on creating bodies of water for a 2D platformer. Using his own game PokeyPoke as a reference, Shaun will teach you how to implement a complex water effect.
Just note that in the introduction Shaun mentions this video is more focused on concepts rather than implementation.
This point is to get your imagination working and gain more insight into game development.
This tutorial walks you through building an RPG farming sim game. This is aimed at beginners just starting out with GameMaker so it’s pretty easy to get into.
In the early sections you’ll learn all about objects, sprites, and how to set up your project in GameMaker.
FriendlyCosmonaut will first walk you through the fundamentals of using GameMaker Studio before introducing you to opengameart.org, a website where you can find free assets for your games and prototypes.
By the end of this video you’ll learn to code your own animated characters, create a night and day cycle, and grow crops in your game.
Ever since the first RPGs came out on the original NES, turn-based RPGs have been a fan favorite.
They remain a popular goal for beginning 2D developers to this day.
Crafting a turn-based game can be challenging for sure. Luckily you have YouTube and sea of content much like this video by Aidan where you’ll learn how to build a simple 2D RPG.
Starting with movement and collision, you’ll eventually move onto combat, scene transitions, crafting a user interface, and plenty more.
There’s a lot to learn in this series so be prepared to invest some time and keep the coffee pot burning.
In this more advanced tutorial by GameMaker guru Shaun Spalding, you’ll see first-hand how to create a ghost playback effect.
While Shaun uses a platformer for this demo, the techniques will work universally.
For instance, you could use it to create time trials for a racing game.
Shaun creates this effect by first recording the player’s input via the state of the character and saving it to a JSON file. By retrieving the file we can play back the player’s movements.
Check out the description below the video for the source files if you want to use the same sprites and code. This basically holds a pack of pixel art that makes a great learning resource.
Have you ever wanted to create your shooter game in the style of the original Doom or Duke Nukem?
Well now you can thanks to GameMaker and this short video by HeartBeast.
You’ll learn how to design and navigate a 3D maze complete with pixel art and atmospheric effects using textures and sprites provided in the description.
While this isn’t a true 3D environment, it’s a great stylistic choice.
Some players will enjoy the retro look of this kind of game which keeps them popular among game devs.
In this 3-part series by createindiegames you’ll learn how to design a simple puzzle game using GameMaker Studio 2.
This video covers fundamental topics like movement, collision, and animation.
You’ll learn how to use a TileMap and create box objects that the player can push around.
After setting up the player, the instructor will show you how to handle moving the boxes and creating the win scenario.
By the end of the tutorial you’ll have a playable puzzle game ready to go. What’s more, you’ll have all the pieces you need to create additional puzzles and expand your game.
Spine is a 2D animation package that aims to make the animation workflow easier.
It pairs nicely with GameMaker and can greatly boost your productivity when it comes to animation.
Spine packs a variety of tools and you’ll learn many of them here. When you’re done, you can export your work it and use it in GameMaker.
This video by developer Tainted Lost will show you how to use Spine and GameMaker to build a basic equipment system. Using Spine with GameMaker will make building new, exciting features far less painful.
Text is a feature of most games and for some, like RPG’s, it’s a core part of the gameplay.
Story-driven games allow you to express more complex ideas and create characters that your players will learn to love.
In this video by Shawn Spalding you’ll learn how to make custom text dialogue in GameMaker Studio 2. Use it to build an epic world and full of emotion and depth.
Some developers may find that writing stories for their game worlds is just as fun as coding them. Adding prose to your game will help the players form a connection with your characters.
This video from Benjamin is a gentle introduction to networking with GameMaker. Use it to explore the fundamentals of developing online multiplayer games.
You won’t actually be making a game in this tutorial; you’ll just be setting up a connection between two computers and sending some data back and forth.
This is, however, the bare minimum needed to build an online game. Once you understand the basics of sending data over this connection, you can expand to more advanced topics like shooting a gun or sending an instant message.
The Legend of Zelda is still one of the most popular games of all time.
In this video by Synthetic Pixel Games you’ll learn how to implement a Zelda-style health system all on your own.
Using only three sprites you’ll follow the process of how to add and remove hearts using increments in half-hearts. The graphics are implemented as part of the UI so they’ll follow the player around the map.
Add some style to your 2D adventure game with these Zelda-style hearts, or create some basic pixel graphics to change those hearts into anything of your choosing.
Flappy Bird is a remarkably easy game to recreate. You’ll learn that firsthand in this tutorial by Overnight Gamemaker.
Targeted at beginners, this video will go step-by-step through building a Flappy clone. Follow along as the developer builds this simple game on the fly using GameMaker Studio 2.
This project covers a lot of ground from animation to scrolling backgrounds and a few other areas. When you’re finished you’ll have a deployable game ready to add to your portfolio.
This tutorial is an excellent starting point for those looking to learn GameMaker Studio and create their own arcade games.
This time you’ll be reconstructing the Atari classic Asteroids.
Follow along with the instructor from Ask Gamedev to learn the ins and outs of GameMaker including how to use sprites, objects, events, and action blocks.
By the end you’ll have a fully playable Asteroids game that you can share with friends or goof around with by yourself.
You’ll also have a solid foundation to start building your future with GameMaker.