Тёмный

How to create a Turn-based Combat System in Godot 

Jon Topielski
Подписаться 4,1 тыс.
Просмотров 75 тыс.
50% 1

Learn how to create a Turn-based Combat system in Godot.
Source code: github.com/jontopielski/Turn-...
Art Assets - limezu.itch.io/fantasy-battlers
Background - opengameart.org/content/backg...
Fonts - www.pentacom.jp/pentacom/bitfo... and www.pentacom.jp/pentacom/bitfo...
00:00 - Intro
00:15 - Scene Setup
00:44 - Health Bar
03:13 - Panels
04:59 - Actions
07:34 - Text Box
09:05 - Script
09:44 - Display Text
11:46 - Run
13:05 - Player Health
14:05 - set_health()
16:15 - Enemy Resource
19:22 - Attack
20:37 - AnimationPlayer
22:38 - Enemy Turn
23:33 - Screenshake
24:39 - Defend
28:38 - Enemy Death
29:50 - End Result
30:07 - Changing Enemies

Опубликовано:

 

2 авг 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 92   
@rhos-gfx
@rhos-gfx 3 месяца назад
This is such a nice intermediate tutorial. no waffle or overexplaining, just "here's what i did". I'd love to see more like this.
@RegentStatue745
@RegentStatue745 7 месяцев назад
Godot 4 doesn't use yield anymore so be sure to use "await". Here is how I used it for closing the textbox: "await textbox_closed" . And here's how I implemented the timer he creates as well: "await get_tree().create_timer(.25).timeout"
@redbul17
@redbul17 4 месяца назад
very helpful, thank you
@jessg0
@jessg0 11 дней назад
sweet, thx!
@user-nf1hp2dm5l
@user-nf1hp2dm5l 6 дней назад
You're so sweet,thanks for help
@slundal
@slundal Год назад
I learned more about the UI nodes in 8 minutes from this guy than I have from any other tutorial.
@hiiambarney4489
@hiiambarney4489 9 месяцев назад
Same! And the worst part is, they changed them afterwards, so now I don't understand it anymore.
@user-nf1hp2dm5l
@user-nf1hp2dm5l 6 дней назад
@@hiiambarney4489 So true,there are too many changes between 3.x & 4.x
@zebwest8152
@zebwest8152 Год назад
If anyone is following this in Godot 4, the format for setting up export variables has changed a bit. It looks like this: extends Resource @export var name: String = "Enemy" @export var texture: Texture = null @export var health: int = 30 @export var damage: int = 20
@sableeyedscholar2135
@sableeyedscholar2135 Год назад
Big thanks, was looking for this comment exactly!
@ChuRu386
@ChuRu386 Год назад
understood the assignment
@Kamu34474
@Kamu34474 9 месяцев назад
Thanks! It helped
@Beibai
@Beibai 9 месяцев назад
Does anyone know how to fix the breaking point after I put set_health($EnemyContainer/ProgressBar, enemy.health, enemy.health)
@documentcamera8807
@documentcamera8807 8 месяцев назад
You're a god send
@PostFrontier
@PostFrontier 2 года назад
This was, by far, the best tutorial that I've seen for turn based combat in Godot. I'm so happy that I found this tutorial. Great job!!!
@ScarlettTheViewer
@ScarlettTheViewer 26 дней назад
This is the most informative and concise video I have ever seen demonstrating specific gameplay with godot. I have spent (admittedly not a ton of time) probably 10 or so hours trying to learn, and hardly got anywhere with it. I know a good bit of python and was honestly considering just using pygame before seeing this. Thank you.
@owletstree9523
@owletstree9523 2 месяца назад
Omg I actually managed to re-create everything you did, even 2 years later(with some minor tweaks ofc). Thank you so much!
@Abel-fu1xq
@Abel-fu1xq 2 месяца назад
Hi, can you please let me know how you were able to create the line for the character attack: "set_health($Background/EnemyHealth/ProgressBar, current_enemy_health)" It gives me an error message saying: "Too few arguments for "set_health()" call. Expected at least 3 but received 2." Edit: Nevermind, I completely missed the next argument somehow lol
@Animosity00
@Animosity00 2 года назад
I'm watching this trying to self teach myself to make a classic turn-based RPG as an old man with about 12 hours of experience with Godot. Still seems like magic. Great knowledge here to be gained!
@thoof7589
@thoof7589 2 года назад
Great tutorial. I didn't know you could yield to signals in that way, very helpful!
@azaratowcanica2639
@azaratowcanica2639 2 года назад
The view count does not do justice to the insanely good informative content! Learnt a lot, Thank you! Hope your channel blows up!
@rungeon83
@rungeon83 2 года назад
This is fantastic, I'm so glad you hit on resources, there is a lot to learn here! Congrats on an amazing tutorial! I'm still finding controls so tricky so your tutorials have been fantastic for helping me get over the fiddlyness :)
@jackiewatkins1830
@jackiewatkins1830 7 месяцев назад
Im pretty new at this, so i had to slow my man down to like .5 to catch everything he was doing...hes moving fast but excellent showcase of the basic functions that he is covering.
@maranr
@maranr 2 года назад
Really great. I learned a lot about the use of yield and creating resources. Thanks!
@rockerhelgeson
@rockerhelgeson Год назад
Without a doubt, the best turn based tutorial. Please make more content like this, it has been so helpful!
@filippobegna3512
@filippobegna3512 2 года назад
Great job, really liked how you made the video: super clear, fast and efficient
@gustavoalmeidadaribeira1740
This video is helped me a TON with my project.I wish you all the best!
@RegentStatue745
@RegentStatue745 7 месяцев назад
The new export format for the "enemy" resource variable looks like this: "@export var enemy: Resource = null"
@KEKEISYOU
@KEKEISYOU 2 года назад
This is great! Thank you so much! On a side note i had to watch it at half speed cause you go through everything so fast it's hard to keep up but thank you for this video!
@andersonmaia5767
@andersonmaia5767 2 года назад
Thank you a lot! Using resources to create different enemies is a very handy solution.
@Blackmamba136
@Blackmamba136 Год назад
One of the best tutorials I saw! Thank you
@teo2805
@teo2805 2 года назад
Saved for Sunday when I'm done with my exams season... TYSM!
@lukasmorrow8255
@lukasmorrow8255 2 года назад
This was an excellent starting point for me! I'm working on a much meatier combat system, but this really helped with the basics of using my stats resources and getting organized!
@wisiel3861
@wisiel3861 5 месяцев назад
Ja pierdole zajebisty poradnik koleś, wielkie dzięki, doceniam!
@aneerudh1712
@aneerudh1712 2 года назад
I'm convinced you are the fastest typer on the planet
@musicdudem6673
@musicdudem6673 Год назад
this is amazing thank you! if you ever want to expand this video into a series, that would be amazing!
@mythology100
@mythology100 2 года назад
Greatly appreciated. Glad I subscribed.
@SodaFountainJoy
@SodaFountainJoy 2 года назад
Thank you! Very helpful concepts.
@arttopix7224
@arttopix7224 Год назад
Thank you, a lot! This video teaches me more than another tutorial.
@theleeyawnshow2554
@theleeyawnshow2554 2 года назад
I like the tutorial. It's basically all I need for my current project. Also I'm planning on making a tutorial series similar to this one in my own language. I hope it works out fine.
@RicardoFAlves-mp3cb
@RicardoFAlves-mp3cb 2 года назад
This was VERY informative. Thank you! Got the notifications activated so I won't miss your next video. No pressures tho
@anton.s6882
@anton.s6882 2 года назад
Thanks man for this tutorial
@ropepores4688
@ropepores4688 Год назад
Thank you! Great tutorial!
@keriganknowles2818
@keriganknowles2818 5 месяцев назад
Does anyone know how to change the enemy through code instead of dragging in the editor.
@broyal_gamers1237
@broyal_gamers1237 9 месяцев назад
You are a hero thank you!!!
@sdalfbg
@sdalfbg 8 месяцев назад
ty, very nice tutorial u helped me a lot
@javleds
@javleds Месяц назад
¡Gracias!
@suthamonhengrasmee8182
@suthamonhengrasmee8182 2 года назад
Thank you very much
@cartian8039
@cartian8039 6 месяцев назад
Thank you so much
@shadow-jc3vp
@shadow-jc3vp 7 месяцев назад
Great quick video. However, I do wish there was more explanation for certain options you chose or things you did in the video. Otherwise, very straight forward. Thanks!
@rvn4
@rvn4 2 года назад
Nice video
@MH-lr6ue
@MH-lr6ue Год назад
im following your exact instructions but my player's health bar will not expand i can edit the x value but when i play the scene the health bar is just a sliver.
@MassiveBreaker
@MassiveBreaker 2 года назад
I know that this video is quite old, but is there a way to do screen shake with a shader instead? I don't like the practice of just making the background bigger, say I want to make an fps shake, would I use a shader for that instead?
@sanagunx3345
@sanagunx3345 Год назад
This tutorial is so dam good, I learn a lot from this. thank you for making this great tutorial for us.
@DomZaddy
@DomZaddy 2 года назад
I know this is an older video by now but what do I do if when the enemy attacks my player it subtracts less than my enemies damage on the first attack?
@lutherbrown8873
@lutherbrown8873 8 месяцев назад
to get timer to work in godot 4+ (I'm using 4.2): await(get_tree().create_timer(0.25).timeout)
@entityunknown2
@entityunknown2 Год назад
Speed run
@ForgottenLight15
@ForgottenLight15 2 года назад
You know, you're using _input(event) incorrectly. You're accessing the Input singleton in the _input callback, instead of using the _input callback's event.
@justarandomgamer5648
@justarandomgamer5648 3 месяца назад
Ok how would you go about making like, a magic option or something? Like how would you make it so you could have a menu then pick a spell
@EthernalOynuyor
@EthernalOynuyor 8 месяцев назад
How can i do this if some enemies have 2 actions per turn ? the enemies are spawned as instanced scenes. i gave the enemies a property called "ActionsPerTurn", and "for n in ActionsPerTurn:" but how would i make it wait until the first action is complete ? there are several attacks the enemies can do and i have a "match" that finds and executes the current action the monster is suppoesed to do. Since i can't do it with signals... i'm lost.
@PotatoisDry
@PotatoisDry 2 года назад
how can i replace the rectTexture with animated sprite in the code?
@agriasoaks6721
@agriasoaks6721 4 месяца назад
How do you handle multiple enemies? How will the targetting system be like?
@ZDitohyt
@ZDitohyt Год назад
When I try to attack again the health bar stays the same, pls some help
@Abel-fu1xq
@Abel-fu1xq 2 месяца назад
Hi, I got up to the point where he was defining the "func set_health(progress_bar, health, max_health):", but I got stuck on the line "progress_bar.get_node("Label").text = "HP: %d/&d" %[health, max_health]". The progress bar doesn't change at all. what should I do? Edit: Nevermind, I just had to chnage it to "HP: %s/&s" %[health, max_health]"
@MrTrumpetrocks
@MrTrumpetrocks 7 месяцев назад
How would you do this if both players are attacking each other at the same time? Like an Auto-battler.
@nerbles7472
@nerbles7472 10 месяцев назад
is it possible to change what the enemy is? like lets say i kill the dragon and want a different enemy for the next level. would i have to make a completely new scene for that or can change the enemy resource in the script
@ghostradiodelete
@ghostradiodelete 5 месяцев назад
I haven't gone through this whole tutorial yet, but the way I load enemies in my game is (it's a turn-based, 1st person dungeon crawler), for each step, I roll an encounter against a player's stat, if it fails it encounters an enemy. Then I roll a random bit with player's luck added in right, and it pulls from a list of enemies stored for that floor. Not to get too complicated but basically that list is made up of packed scenes. So how I would do it is make a scene and just change out the enemy in that scene - code the enemy AI and stick that as a child on that scene. Then when you load whatever enemy it picked, everything you need is right there. Any other questions, happy to answer them. Cheers!
@irrelevantjoshwaa6156
@irrelevantjoshwaa6156 Год назад
where was the function enemy turn first written in the project
@ThatGuyYesHim
@ThatGuyYesHim 4 дня назад
How would i take this and trsition a 3d world into this scene?
@anton.s6882
@anton.s6882 2 года назад
When I followed your tutorial, the damage stops at 20 Hp, and 15Hp when the enemy attack, why?
@jontopielski6227
@jontopielski6227 2 года назад
Double check your logic for when you are reducing the current_player_health or current_enemy_health. You can reference the source code directly here: github.com/jontopielski/Turn-Based-Combat/blob/master/src/Battle.gd
@anton.s6882
@anton.s6882 2 года назад
@@jontopielski6227 Done, I just need to change -= to =
@HitoriSanzo
@HitoriSanzo Месяц назад
didn't underrstand anything, 10/10, thanks bro
@muziklol69
@muziklol69 2 года назад
make a part 2
@HProductionsish
@HProductionsish 3 месяца назад
I keep getting an error that says the indentifier "State" isn't declared in the current scope" when trying to access the State.gd script. How do I fix this?
@yahirfuentes4713
@yahirfuentes4713 25 дней назад
did you figure it out? edit: nvm i just did. the name on the autoload wasnt the same so just make sure it matches with your code
@seedofstun
@seedofstun 8 месяцев назад
my sprite keeps disappearing whenever i put it into a vbox container :/
@Ashiira
@Ashiira Год назад
This is so difficult to watch as a beginner. I have to pause incredibly often and with great precision, because when he writes something, he'll only display it for a couple of frames and then quickly jump somewhere else, implying that whatever he's done is so obvious that viewers shouldn't even need to see it.
@marcelroman6639
@marcelroman6639 2 месяца назад
Hello! I hope this doesn't come off as rude, but you could watch this video at a slower playback speed
@gofastutos
@gofastutos 2 года назад
Nive video tutorial but a bit long no ? 😁
@justarandomgamer5648
@justarandomgamer5648 5 месяцев назад
small issue I have, on the line: progress_bar.get_node("Label").text = "HP:%d/%d" % [health, max_health] when I run it in game it tells me: Invalid set index 'text' (on base: 'null instance') with value of type 'String'. can someone help? figured it out, had to make the Label a unique name
@Beibai
@Beibai 9 месяцев назад
Does anyone know how to fix the breaking point after I put set_health($EnemyContainer/ProgressBar, enemy.health, enemy.health)
Далее
How Do You Improve Turn Based Combat?
17:43
Просмотров 768 тыс.
How to make a tactics game in only two weeks
19:00
Просмотров 72 тыс.
Бмв сгорела , это нормально?
01:01
The Genre Indies Avoid
6:39
Просмотров 390 тыс.
Dear Game Developers, Stop Messing This Up!
22:19
Просмотров 699 тыс.
Every 2D Node Explained in 9 Minutes !
9:19
Просмотров 297 тыс.
Creating SMART enemies from scratch! | Devlog
5:40
Просмотров 299 тыс.
choosing a game engine is easy, actually
15:08
Просмотров 384 тыс.
A new way to generate worlds (stitched WFC)
10:51
Просмотров 520 тыс.