Hey, pope. I really appreciate you making awesome videos about the most efficient way of doing things. This subject in particular is something I was worried about taking on, but now I can't wait to get started.
Genius. I was just in the need for something like this for an animated water tile i just managed to make that looked decent... Not only genius but simple as well, a winning combination any day :) Hope you keep the videos coming, the parallax series are excellent, and the pixel detective is also a good concept with great execution. Often when you are new, i feel you are in just as big of a need to know where things are usually going wrong, as opposed to only being told the way to do things right... But it's rare to see that kind of tutorial :)
Flashing? Strange. If you want some help with it, you can PM a link to your project GMZ or you can hit me up on reddit or in the /r/gamemaker official discord channel.
I got the following error after downloading the .gmz file for this project: In script animated_tile_init line 6 pos 7: Assignment operator expected. Keep in mind that I didn't edit anything yet. I'm using GMS 1.4. Is this only compatible with a different version or something?
I just opened it in 1.4.9999 and ran it with no problems. Try downloading it again? Join my Discord if you have further issues and we'll try to help you get it up and running: discord.gg/By6u9pC
So, on your channel I've found videos for parallax background scrolling, and tile animation. What about animated backgrounds? I would really like to figure out how to do something like Green Hill's background in Sonic the Hedgehog. It would need parallax scrolling for the water at various distances as well as the landscape in the far distance, but the water itself has a couple frames of animation. (No, I'm not wanting to copy Green Hill, but I figured it made a good example) Is there any way that you could do a video on how to animate backgrounds in a way that's compatible with your parallax scrolling tutorial?
This system will work for backgrounds already! Anywhere you are using the "base" background will be animated. Whether it's a tile, a background set in the room, or using draw_background()! No extra videos needed!
Not a dumb question at all. You can use the "depth swapper" feature of pal swapper to swap a specific depth or range of depths, including tiles using this system.
@@PixelatedPope Just tried it... works like a charm. Thanks P. I was trying to turn the whole screen "gray-ish" for a split second, back to normal, and then split second again for when I bomb an area for my Zelda remake. I used your palette swapper for the objects and when you mentioned it I saw "pal_swap_set_tiles." You're the bomb dot com.
@@PixelatedPope You seem to be THE Guru when it comes to GameMaker. Is there a way to use draw_text_ext, but convert the text drawn to a tile layer? I've been racking my brains with this one.
@@BrotherBearBarras I'd be very interested to know why you need to do that. In GMS1 there isn't much of a difference from a tile and just drawing something. But UA-cam comments aren't the best way to discuss this sort of thing. I recommend joining the GM Discord server. Hundreds of amazing, helpful people that you can discuss GM with, and as a member you'll be able to directly message me. discordapp.com/invite/By6u9pC
@@PixelatedPope With my textbox engine, I'd like to retain what is being written to the screen when transitioning. For some reason, with objects, it won't move correctly, but when I replace an object with a tile and then move the tile layer, it's perfect. I'll see if I can find you on the discord channel... ua-cam.com/video/WjJhQ8sD6p4/v-deo.html That's my textbox example.
Yup, as long as you use the argument array there is no limit. So don't do this: return argument0 instead do this: return argument[0] And you won't be limited.
The way I've always done it is to create an alarm system in a control obj like that with background_assign. Are there any reasons that my method might be worse in some way?
If it works, probably not. I mean, you'd have to use a different alarm for each sets of tiles that are animating on different timers... but you aren't likely to have THAT many different ones, so the number of available alarms isn't likely to be an issue. Your method is probably just fine. It's the background_assign that's the big time saver here.
great tutorial Pope :) I was curious how this could apply to a health bar using animated tiles. Does gml have a way to mask out parts of the animated tile to fit inside a health bar?
Better to do that with a sprite. Here's a crude example file that messes with the idea: dl.dropboxusercontent.com/u/78249311/SpriteMaskingTest.gmz You should also be doing your health bar in your GUI event, and you can't really draw tiles in the gui event. So another reason to go sprites/surfaces. But maybe I'm misunderstanding what you wanted to accomplish. If that example doens't help you out, let me know and we'll find a solution for ya.
Thanks for the video! I have a question: In GameMaker Studio 2, would it be possible to modify the visible animated tiles in real-time? For example selected animated water tiles in the screen changes to a different animated tile as it is affected by a nearby weather system like a storm. The animation of the affected water tiles becomes more wavy and violent as the storm passes over it.
What you would probably want to do is have two layers of animated tiles, one for "calm" and one for "storm" and turn the layers on and off based on your weather logic. I haven't actually done anything like this, but I imagine layer_set_visible() would be how you would do this. If you want to "gradually" fade between the two layers, you'd need to employ a shader to get alpha blending on a tile layer.
Good to know it is possible. Yes, it should gradually fade from calm to stormy animated tiles... but they should still remain seamless somehow. I'm new to GameMaker Studio 2 and I'm just researching whether I should use it for a 2D game project I have in mind instead of Unity. Thank you sir!
Sure! If you want some further help in your gamedev journey, you can join my discord server. Great place to talk to other aspiring game developers and get help when you get stuck. discord.gg/EWq57U
Nice video, and nice system you've developed -- but what about explaining what's going on inside those scripts? That's where the real interesting stuff is going on.
Honestly... inside the scripts is the real BORING stuff. All it's doing is pulling data out of the data grid. The only interesting scripts are the one that initializes the system (builds the data grid) and the one that adds a new set of tiles. All the other scripts inside of the update script could be replaced with ds_grid accessors.
@@chrismulholland6202 Well, if you get stuck, you can always join my Discord and ask for help there. Someone will be able to step you through getting it set up. discord.gg/By6u9pC
When I try to launch the project files in either Game Maker Studio 2, Game Maker Studio 1.4 they both tell me to run GameMaker:Studio from inside Steam. Any idea's how to get around this? Need to look at those scripts lol
This solution will not work in GMS2. GMS2 has built in animated tiles, which are going to be WAY faster than my solution anyway. For GMS1, you need to run GMS1 and then instead of creating a new project or whatever, say "import project" and open the GMZ file.
Oh ok thanks!! ive just been trying to open the gmz files as is. Do you possibly have any links to animated tiles in GMS2? I hate to ask but all I can find is GMS1 or auto tiles for GMS2 unless auto tiles are the same thing as animate tiles but it doesnt seem that way.
Nope. They are just... built in. It's super easy. Open up your tile sheet and in the left "properties panel" you'll see 3 buttons: Brush Builder, Tile Animation, and Auto Tiling. Click on Tile Animation. This will open a new panel. Click the little + symbol that says "Add Animation" in the middle panel. Set the number of frames. Then click on the tiles you want to represent the individual frames of your animation in order. Set the desired FPS for the animation and you are good to go. From then on, if you "paint" tiles with any of the frames you selected to be part of the animation, they will be animated in game. It's a bit more restrictive than my system (number of frames has to be power of 2, I don't know of any way to pause them, etc), but it'll be MUCH faster performance wise. Almost not comparable on the performance side.
I imported the scripts into GMS but the compile error comes up with script missing, for all of the scripts. :( For example: Compile error in around line 0 : script missing "scripts\animated_tile_cleanup.gml" In Object obj_tile_animator, in Event DestroyEvent action number 1 at line 1 : unknown function or script animated_tile_cleanup Any clues?
Unfortunately NONE of my guides and tutorials are designed to work for GM8. If any of them do, it is purely coincidental. I highly recommend you switch over to GMS (keep an eye on Humble Bundle, you never know when it will be on sale).
Thanks for replying. I tried it on GM8 and unforunately some functions did not work.Oh well. I have other reasons for staying with Gamemaker 8. Could you do a series on this amazing engine.(it may not work on GM:S) www.mediafire.com/file/65nhod7dyvbavaw/Most_Current_Engine.zip It is quite good and I would really apreciate you making a ame from it. great work
hacks software tutorials? LOL LOL LOL u must not be in the USA or just trolling this ... I could sell you a legit key or 20 USD GSM 1.4.. I have an unused license. You can either use it on the PC and then get a key for steam.
Lol... ive cheated it, ive used 2 diferente draws in the main tile sheet and only 2 animations... this way i have a 4 frames animation of the same draw. thanks very usefull tutorial
I'm sure they were already thinking about this feature for GMS2 before my tutorial, but Nocturne did respond to the thread on the GMC with some nice words that made me feel all tingly. forum.yoyogames.com/index.php?threads/animated-tiles.10793/#post-71694
Nice. I've not upgraded to S2 yet so I'm unaware of the features. Are they still using the X/Y previous method for solid objects? I always found that to be a pain.
Yeah. The core of GML really didn't change much. A few things got renamed, but the big changes are to the room editor layer/tile system and the UI as a whole, obviously. It takes some getting used to (and I need to update my collision system to get it working again), but I wouldn't want to go back to GMS1 at this point. It's a clear upgrade after initial hurdles.
Man, you should have seen my first pass at this back in GM8. I was using background edit to draw the frame backgrounds over the base backgrounds and it was SUPER slow, especially if the backgrounds were of any significant size. Your channel is really slick, dude! You obviously put a lot of effort into it. Subscribed.
seriously saved my life here, I was about to go down the dark and dangerous path of "objects everywhere for every animated tile"
Hey, pope. I really appreciate you making awesome videos about the most efficient way of doing things. This subject in particular is something I was worried about taking on, but now I can't wait to get started.
Genius. I was just in the need for something like this for an animated water tile i just managed to make that looked decent... Not only genius but simple as well, a winning combination any day :) Hope you keep the videos coming, the parallax series are excellent, and the pixel detective is also a good concept with great execution. Often when you are new, i feel you are in just as big of a need to know where things are usually going wrong, as opposed to only being told the way to do things right... But it's rare to see that kind of tutorial :)
Wow. Thanks for the kind words! And thanks for watching, I'm glad you are enjoying the vids.
Very useful system. Thanks for sharing!
This is also compatible with external map editors like Tiled if you set up your tilesets correctly. Thanks for the scripts, this was very helpful.
THANK YOU
YOU HAVE SAVED MY LIFE
I AM ETERNALLY GRATEFUL
that was 2 years ago?
Very Usefull! How can I to reference your work for acknowledgements? Can I to use directly your librarys in a game?
Holy smokes Pope, your tuts are awesome!!
Thanks! Glad you enjoy them.
Good tut, but for some reason my tiles are just flashing! :(
Flashing? Strange. If you want some help with it, you can PM a link to your project GMZ or you can hit me up on reddit or in the /r/gamemaker official discord channel.
PixelatedPope Thanks for the reply! I restarted gamemaker, and it fixed the issue. No idea what was going on! :)
Very cool :D cheers for helping us out on this!.
fantastic tutorial, thanks!
I got the following error after downloading the .gmz file for this project: In script animated_tile_init line 6 pos 7: Assignment operator expected. Keep in mind that I didn't edit anything yet. I'm using GMS 1.4. Is this only compatible with a different version or something?
I just opened it in 1.4.9999 and ran it with no problems. Try downloading it again? Join my Discord if you have further issues and we'll try to help you get it up and running: discord.gg/By6u9pC
So, on your channel I've found videos for parallax background scrolling, and tile animation. What about animated backgrounds? I would really like to figure out how to do something like Green Hill's background in Sonic the Hedgehog. It would need parallax scrolling for the water at various distances as well as the landscape in the far distance, but the water itself has a couple frames of animation. (No, I'm not wanting to copy Green Hill, but I figured it made a good example)
Is there any way that you could do a video on how to animate backgrounds in a way that's compatible with your parallax scrolling tutorial?
This system will work for backgrounds already! Anywhere you are using the "base" background will be animated. Whether it's a tile, a background set in the room, or using draw_background()! No extra videos needed!
thanks handy. can gms have swf or svg tiles yet? or is it all still only pixel tiles
As far as I know, still just raster tiles. Maybe GMS2?
It may be a dumb question, but... how would I combine this with your palette swapper?
Not a dumb question at all. You can use the "depth swapper" feature of pal swapper to swap a specific depth or range of depths, including tiles using this system.
@@PixelatedPope Just tried it... works like a charm. Thanks P. I was trying to turn the whole screen "gray-ish" for a split second, back to normal, and then split second again for when I bomb an area for my Zelda remake. I used your palette swapper for the objects and when you mentioned it I saw "pal_swap_set_tiles." You're the bomb dot com.
@@PixelatedPope You seem to be THE Guru when it comes to GameMaker. Is there a way to use draw_text_ext, but convert the text drawn to a tile layer? I've been racking my brains with this one.
@@BrotherBearBarras I'd be very interested to know why you need to do that. In GMS1 there isn't much of a difference from a tile and just drawing something. But UA-cam comments aren't the best way to discuss this sort of thing. I recommend joining the GM Discord server. Hundreds of amazing, helpful people that you can discuss GM with, and as a member you'll be able to directly message me.
discordapp.com/invite/By6u9pC
@@PixelatedPope With my textbox engine, I'd like to retain what is being written to the screen when transitioning. For some reason, with objects, it won't move correctly, but when I replace an object with a tile and then move the tile layer, it's perfect. I'll see if I can find you on the discord channel... ua-cam.com/video/WjJhQ8sD6p4/v-deo.html
That's my textbox example.
Really nice system you have there! Is it possible to add more frames to an animation than a script argument limit?
The script argument limit has been removed in GMS1.4.
Wait.... WAS IT!?
It is still on the documentation though.
Yup, as long as you use the argument array there is no limit.
So don't do this: return argument0
instead do this: return argument[0]
And you won't be limited.
Got it, thanks mate!
The way I've always done it is to create an alarm system in a control obj like that with background_assign. Are there any reasons that my method might be worse in some way?
If it works, probably not. I mean, you'd have to use a different alarm for each sets of tiles that are animating on different timers... but you aren't likely to have THAT many different ones, so the number of available alarms isn't likely to be an issue. Your method is probably just fine. It's the background_assign that's the big time saver here.
This is amazing. Thanks.
thank you for gamemaker video
great tutorial Pope :) I was curious how this could apply to a health bar using animated tiles. Does gml have a way to mask out parts of the animated tile to fit inside a health bar?
Better to do that with a sprite. Here's a crude example file that messes with the idea: dl.dropboxusercontent.com/u/78249311/SpriteMaskingTest.gmz
You should also be doing your health bar in your GUI event, and you can't really draw tiles in the gui event. So another reason to go sprites/surfaces. But maybe I'm misunderstanding what you wanted to accomplish. If that example doens't help you out, let me know and we'll find a solution for ya.
this helped a lot :) beginning to see why surfaces are popular with advanced gml devs.
Thanks for the video! I have a question: In GameMaker Studio 2, would it be possible to modify the visible animated tiles in real-time? For example selected animated water tiles in the screen changes to a different animated tile as it is affected by a nearby weather system like a storm. The animation of the affected water tiles becomes more wavy and violent as the storm passes over it.
What you would probably want to do is have two layers of animated tiles, one for "calm" and one for "storm" and turn the layers on and off based on your weather logic. I haven't actually done anything like this, but I imagine layer_set_visible() would be how you would do this. If you want to "gradually" fade between the two layers, you'd need to employ a shader to get alpha blending on a tile layer.
Good to know it is possible. Yes, it should gradually fade from calm to stormy animated tiles... but they should still remain seamless somehow. I'm new to GameMaker Studio 2 and I'm just researching whether I should use it for a 2D game project I have in mind instead of Unity. Thank you sir!
Sure! If you want some further help in your gamedev journey, you can join my discord server. Great place to talk to other aspiring game developers and get help when you get stuck. discord.gg/EWq57U
Ok, thank you very much! :-)
OMAGAWD! THANK YOU!!!
YOU'RE WELCOME! THANKS FOR WATCHING!
Nice video, and nice system you've developed -- but what about explaining what's going on inside those scripts? That's where the real interesting stuff is going on.
Honestly... inside the scripts is the real BORING stuff. All it's doing is pulling data out of the data grid. The only interesting scripts are the one that initializes the system (builds the data grid) and the one that adds a new set of tiles. All the other scripts inside of the update script could be replaced with ds_grid accessors.
Thank you very much Pope
wow thank you excelent !!!!
Hey, I'm getting an error that says unknown function or script background_assign. Any ideas how to fix that?
Are you in GMS2?
@@PixelatedPope Yes I am
@@chrismulholland6202 GMS2 supports animated tiles natively. So you don't need this weird work around 😄
@@PixelatedPope What! I tried that and it didn't seem to work. Thanks for the speedy response though I'm sure I'm doing some small thing wrong.
@@chrismulholland6202 Well, if you get stuck, you can always join my Discord and ask for help there. Someone will be able to step you through getting it set up.
discord.gg/By6u9pC
how do i use this with saving my game to an ini file?
This has nothing to do with save data.
This is so feakin' good to know. :O
When I try to launch the project files in either Game Maker Studio 2, Game Maker Studio 1.4 they both tell me to run GameMaker:Studio from inside Steam. Any idea's how to get around this? Need to look at those scripts lol
This solution will not work in GMS2. GMS2 has built in animated tiles, which are going to be WAY faster than my solution anyway.
For GMS1, you need to run GMS1 and then instead of creating a new project or whatever, say "import project" and open the GMZ file.
Oh ok thanks!! ive just been trying to open the gmz files as is. Do you possibly have any links to animated tiles in GMS2? I hate to ask but all I can find is GMS1 or auto tiles for GMS2 unless auto tiles are the same thing as animate tiles but it doesnt seem that way.
Nope. They are just... built in. It's super easy.
Open up your tile sheet and in the left "properties panel" you'll see 3 buttons: Brush Builder, Tile Animation, and Auto Tiling.
Click on Tile Animation. This will open a new panel. Click the little + symbol that says "Add Animation" in the middle panel. Set the number of frames. Then click on the tiles you want to represent the individual frames of your animation in order. Set the desired FPS for the animation and you are good to go.
From then on, if you "paint" tiles with any of the frames you selected to be part of the animation, they will be animated in game.
It's a bit more restrictive than my system (number of frames has to be power of 2, I don't know of any way to pause them, etc), but it'll be MUCH faster performance wise. Almost not comparable on the performance side.
Thanks so much!! You have helped me learn so much its amazing, keep up the awesome work!
not enough information can i just download script and do the exact same
downloaded script don't show up when putting into the folder GMS2
This only works for GMS1. GMS2 has support for animated tiles built in...
i found out
Awesome!
I imported the scripts into GMS but the compile error comes up with script missing, for all of the scripts. :(
For example:
Compile error in around line 0 : script missing "scripts\animated_tile_cleanup.gml"
In Object obj_tile_animator, in Event DestroyEvent action number 1 at line 1 : unknown function or script animated_tile_cleanup
Any clues?
Ok, I did 'Save all' instead of 'Save'. But now the tiles don't animate. :p
Helps if I use the right scripts and not the example scripts. Excellent Video, keep it up!
Thanks. So you're good? You got it all workin'?
shame ok thanks i cant wait to see what yoyogames have been upto building gms2 thanks
how can i get this version of gms?
I don't think you can anymore. But GMS2 natively supports animated tiles making this entire video unnecessary.
You are God
Does it Work in Gamemaker 8
Unfortunately NONE of my guides and tutorials are designed to work for GM8. If any of them do, it is purely coincidental. I highly recommend you switch over to GMS (keep an eye on Humble Bundle, you never know when it will be on sale).
Thanks for replying. I tried it on GM8 and unforunately some functions did not work.Oh well. I have other reasons for staying with Gamemaker 8. Could you do a series on this amazing engine.(it may not work on GM:S) www.mediafire.com/file/65nhod7dyvbavaw/Most_Current_Engine.zip
It is quite good and I would really apreciate you making a ame from it.
great work
what is GM8? i jsut know GMS 1.x and GMS 2.x... :(
hacks software tutorials? LOL LOL LOL u must not be in the USA or just trolling this ... I could sell you a legit key or 20 USD GSM 1.4.. I have an unused license. You can either use it on the PC and then get a key for steam.
Before GMS Game Maker had several versions until it reached 8.1
How to set animation speed?
Second argument of the animated tile add script.
Thanks!! This is a great add to GM.
Lol... ive cheated it, ive used 2 diferente draws in the main tile sheet and only 2 animations... this way i have a 4 frames animation of the same draw. thanks very usefull tutorial
im not entirely sure why but im getting compile errors ..... anyone else get this problem?
What errors specifically? Are you on the latest version of GMS1?
youre exactly right about the problem .. twas the version thanks!
The link is broken :/
Yeah. Dropbox broke everything. Sorry. I'm fixing it.
ok ok interesting
I wonder if YOYO games watches these videos and goes "Shit, we'd better implement that feature".
I'm guessing not.
I'm sure they were already thinking about this feature for GMS2 before my tutorial, but Nocturne did respond to the thread on the GMC with some nice words that made me feel all tingly. forum.yoyogames.com/index.php?threads/animated-tiles.10793/#post-71694
Nice. I've not upgraded to S2 yet so I'm unaware of the features. Are they still using the X/Y previous method for solid objects? I always found that to be a pain.
Yeah. The core of GML really didn't change much. A few things got renamed, but the big changes are to the room editor layer/tile system and the UI as a whole, obviously. It takes some getting used to (and I need to update my collision system to get it working again), but I wouldn't want to go back to GMS1 at this point. It's a clear upgrade after initial hurdles.
Also, if you ever just wanna chat GM, get help, or chill with other GameMaker users, you should check out my discord channel. discord.gg/FrJ5Sr
I thought my way of doing it was pretty efficient.. Guess not :/
Man, you should have seen my first pass at this back in GM8. I was using background edit to draw the frame backgrounds over the base backgrounds and it was SUPER slow, especially if the backgrounds were of any significant size.
Your channel is really slick, dude! You obviously put a lot of effort into it. Subscribed.
PixelatedPope Wow man thanks a lot! Really appreciate it! Been sneaking peaks at your channel for a while, really nice indepth stuff :) sub4sub bro ;)
hey guys check out indieberg. he has a couple of cool projects on UA-cam. covers creating gml shaders in one project.
You could always use game maker studio 2