Тёмный

Avoid BUGS and Work FASTER - 10 Godot Engine Tricks 

PlayWithFurcifer
Подписаться 43 тыс.
Просмотров 52 тыс.
50% 1

We collected more Godot tricks we want to show you! This time we have hidden things you can do with timers, signal connections, shader parameters and much more.
Playlist with all our Godot tricks videos: • Things About Godot You...
--
Wishlist our action roguelite Furcifer's Fungeon: store.steampow...
Join our discord server: / discord
Follow us on twitter to stay updated on Furcifer news and tutorials:
/ tweetfurcifer

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

 

17 окт 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 103   
@PlayWithFurcifer
@PlayWithFurcifer 2 года назад
Share your Godot tricks (or else I'll call your grandma)!
@sslaxx
@sslaxx 2 года назад
With what, a Ouija board?
@PlayWithFurcifer
@PlayWithFurcifer 2 года назад
@@sslaxx If necessary!
@mvolkankarakas
@mvolkankarakas 2 года назад
Prefer Police officer :)
@李亦淇Marisa
@李亦淇Marisa 2 года назад
press ctrl+k to comment a bunch of code
@AgnisNeZvers
@AgnisNeZvers Год назад
@@sslaxx I prefer the Luigi board.
@lyingpancake95
@lyingpancake95 2 года назад
That shatter particle effect is exactly what I've been looking for. Thank you!
@PlayWithFurcifer
@PlayWithFurcifer 2 года назад
Amazing! :)
@Theraot
@Theraot 2 года назад
I have some trickery for you: You know that Godot does not have static variables? That means that your static func don't have where to store anything. Well, I have a solution: make a custom Resource, and a resource file, preload it in your static func and store your static variables there. But wait, there is more… You know that the scene tree is not available from a Resource? That is because - unlike nodes - resources are not in the scene tree. So what if you want - for example - to access an autoload from your custom Resource? Well, use the get_main_loop method from the Engine singleton. That will give you a reference to the MainLoop instance, which - by default - is your - main - SceneTree. Oh, and by similar means you can access the SceneTree form your static func. So if you have been passing a reference around to be able to access these form your static func or Resources, you can refactor that.
@Relivino
@Relivino 2 года назад
Why would you use static vars/funcs tho?
@Theraot
@Theraot 2 года назад
@@Relivino Mostly helper methods. In particular for operations that the Godot API does not have. They would logically belong to a built-in class. Which I can't modify without making a custom build of the engine. And remember that we can't make extension methods in GDScript. So I make a class called along the lines of WhateverHelper where I put static methods which take whatever they need to operate on as parameters. And why an static method might need variables? For cache, memoization or lazy initialization. In other words: the static method needs to compute or instantiate something to work, and not having to do it every time is a reasonable optimization. Anyway, I'm NOT saying we should make everything like this. Not at all. But if somebody is in a situation when they do, perhaps they can find useful what I posted.
@Theraot
@Theraot 2 года назад
@Gary Oh good. And that would cover most cases, actually. So using a resource would be strictly for baking data form a tool script, I think.
@Theraot
@Theraot 2 года назад
@Gary After trying to put that in practice, I have couple notes: - I lose type safety. - I can export vars from the resource for easy configuration.
@dreamhive3d
@dreamhive3d Год назад
I was having this exact problem with a timer continuing during the game being paused, and it was causing a situation where if a player died, then quickly paused, a player object would respawn even while paused. Thank you so much for this.
@hamoom
@hamoom 2 года назад
that exploding sprite thing is very cool. wouldn't have thought of that
@PlayWithFurcifer
@PlayWithFurcifer 2 года назад
Glad you like it. It's one of these fun little hacks that can come in handy sometime :)
@L4Vo5
@L4Vo5 2 года назад
I wish scene tree timers also had a parameter to run on physics process. that would be so useful. That modulate stuff is really clever!
@Theraot
@Theraot 2 года назад
I had not considered using modulate like that. Now I can rewrite my hue rotation shader to use modulate.
@DjPerception91
@DjPerception91 2 года назад
Some really great stuff guys, constanly getting some juicy info here! Thanks! Any chance there is a Video on a good way of making top down trails on water?
@PlayWithFurcifer
@PlayWithFurcifer 2 года назад
Thank you! What do you mean exactly? Maybe you can just use a particle system that you turn on when the player is in water? (particles in global space so they make a trail)
@DjPerception91
@DjPerception91 2 года назад
@@PlayWithFurcifer I was thinking of some sort of a simple wave function. A shader, but i think i have another solution. The actual problem i have is, as funny as it sounds, the z index. I have a whole lot of layers for the background/floor and usually my complex water objects land on top, not behind them. So the particles cant be cast between the floor and the water layer, ending up on top of water borders from time to time. So i thought about an additional layer/s with some sort of wave function shader for a trail. I will test another solution soon and might inform you on how it worked out if you wish.
@AudioBoi1
@AudioBoi1 11 месяцев назад
the tests show awesome results, thank you for this ❤
@JosephCatrambone
@JosephCatrambone 2 года назад
This is one of the most useful videos you lot have made. (For me, at least.)
@PlayWithFurcifer
@PlayWithFurcifer 2 года назад
Great to hear that! :)
@dsfdsdiaz9952
@dsfdsdiaz9952 2 года назад
Thank you guys for this video! I was using an algorithm to break my sprite into many objects. The issue is that it can get laggy... I´ll use this method instead. Though I did not understand why you added an animation at the end. ( I am noob and I would just emit the particles once). Regards!
@PlayWithFurcifer
@PlayWithFurcifer 2 года назад
There are many ways to achieve a break/dissolve effect, maybe this one works for you! I made an animation to quickly fade out the underlying sprite, but you can also just switch it to invisible and emit the particles.
@Gazaze
@Gazaze 2 года назад
The modulate trick is gonna solve my shaders problem! thank you!
@PlayWithFurcifer
@PlayWithFurcifer 2 года назад
Amazing! :)
@Siberiius
@Siberiius Год назад
You save me so much time. Great videos!
@RaveYoda
@RaveYoda 2 года назад
Very nice! I love getting these tips!
@PlayWithFurcifer
@PlayWithFurcifer 2 года назад
:)
@ghaydn
@ghaydn 2 года назад
I love your sense of humor.
@PlayWithFurcifer
@PlayWithFurcifer 2 года назад
Thank you! :D
@sandsandwich
@sandsandwich 2 года назад
these videos are exactly what I need thank you!
@PlayWithFurcifer
@PlayWithFurcifer 2 года назад
:)
@andreamassa2176
@andreamassa2176 2 года назад
Thank you very interesting and useful trick!
@thenapoleonlover113
@thenapoleonlover113 2 года назад
More videos like this please! :)
@PlayWithFurcifer
@PlayWithFurcifer 2 года назад
Oooh, for sure :D For the meantime: Have you seen all our other tricks videos already?
@Phlip45
@Phlip45 Год назад
I just found out if you change the icon.svg file in your project, that icon will be the one that shows in the project manager. Fun stuff
@rocket007
@rocket007 Год назад
i always laugh when you say "like animals". =D
@digitalman2112
@digitalman2112 2 года назад
Awesome! Great Stuff!
@PlayWithFurcifer
@PlayWithFurcifer 2 года назад
Thanks!
@Galomortalbr
@Galomortalbr 2 года назад
yield(get_tree().create_timer()) is a safety hazard and honestly should never be used. for any poor fella who try to use this thing on your project, the likely hood of this causing headache is massive, please just generates regular timer nodes.
@SmeddyTooBestChannel
@SmeddyTooBestChannel 2 года назад
oh my god that create_timer thing makes me feel like an idiot. i always kinda felt that cluttering a node with timers was kind of an ugly looking thing so to know that there's been a code-based workaround for that is both relieving and irritating.
@hilfazer
@hilfazer 2 года назад
And i thought you guys were going to talk about the perils of yielding from _ready() :D
@PlayWithFurcifer
@PlayWithFurcifer 2 года назад
Which one exactly? :D It deservs its own video honestly
@hilfazer
@hilfazer 2 года назад
@@PlayWithFurcifer 'ready' signal is emitted either with return or... with the first yield. If something connects to that 'ready' and relies on _ready() function having done all of its work... well, it won't go well. Creating a custom signal and emitting it at the end of _ready() is an option but one needs to remember to connect to that signal instead of 'ready'. Not ideal.
@realMenta
@realMenta 2 года назад
Thanks for the useful tips!
@PlayWithFurcifer
@PlayWithFurcifer 2 года назад
:)
@Tenraiden
@Tenraiden 8 месяцев назад
That girl grabbing the money flying out of the bag, where is that clip from? 0:09
@PlayWithFurcifer
@PlayWithFurcifer 8 месяцев назад
Probably pexels if it looks like stock footage
@paulosullivan3472
@paulosullivan3472 2 года назад
Okay that call_group command is great how did I not know that before?
@PlayWithFurcifer
@PlayWithFurcifer 2 года назад
We also just found it, i wonder when it will come in handy :)
@paulosullivan3472
@paulosullivan3472 2 года назад
@@PlayWithFurcifer I have already found a way to use it in the game I am making! It helped me solve a problem with communicating between groups!
@AdamsAGD
@AdamsAGD Год назад
how did u guys make your coins bounce in your demo? ive only been coding for a month and cant even find a place to start. Did you do it with code or a shader or something else?
@PlayWithFurcifer
@PlayWithFurcifer Год назад
More or less just an animation player :)
@AdamsAGD
@AdamsAGD Год назад
@@PlayWithFurcifer yea but i see them bounce off in different directions... you must add some kind of code or perhaps have a bunch of animations for all those directions? anyways tnk for the respond.
@josecarlosbermudezcastro2617
@josecarlosbermudezcastro2617 2 года назад
Amazin vídeo, is really helpfull, tnx
@PlayWithFurcifer
@PlayWithFurcifer 2 года назад
Thank you :)
@miserablepile
@miserablepile 2 года назад
I love these videos
@PlayWithFurcifer
@PlayWithFurcifer 2 года назад
@beidero
@beidero 2 года назад
For unique input to the same shader through uniform why do you need to make multiple shaders? Can't you just check "Local to scene" (under resource) in the inspector for the shader. I created a tilemap shader that I dynamically instance copies of and send different parts of the map this way. Or did I misunderstand something?
@PlayWithFurcifer
@PlayWithFurcifer 2 года назад
We said that you can make it unique. So yes, making it local to scene works BUT this internally makes multiple materials which prevents batching.
@diegomultimidia
@diegomultimidia 2 года назад
haha i will love to watch this video but the thumbnail is something i have discovered for myself because sometimes the object is not there after the timeout.
@PlayWithFurcifer
@PlayWithFurcifer 2 года назад
Haha yup, we also rarely use yields in general. A typical function connect (with CONNECT_ONESHOT if needed) is safer.
@badunius_code
@badunius_code Год назад
Never had to use a scene tree timer, for me it's either signals when I need to wait for an animation or tween to complete. Or a variable that I update in _process when I need to do something periodically. It also allows me to randomize periods, make them dependent on circumstances or reset them prematurely.
@KyleLuce
@KyleLuce 2 года назад
Lol @ photo cuts to Juan in Barcelona. I hope he watches these.
@PlayWithFurcifer
@PlayWithFurcifer 2 года назад
Haha, I don't think so but it would be hilarious
@mgomezmunoz92
@mgomezmunoz92 Год назад
So the thumbnail says do not create a get_tree(). create_timer() but on 0:26 so say the opposite?
@Galomortalbr
@Galomortalbr 2 года назад
i had no idea about call_group, this seems so useful.
@Relivino
@Relivino 2 года назад
For particle explosions, is there a way to randomize the shape of the pieces as well? In many cases, the "all-square-pieces" don't produce a very appealing result.
@quinndepatten4442
@quinndepatten4442 2 года назад
That spunds like theres a little particle shader wizardry involved.
@PlayWithFurcifer
@PlayWithFurcifer 2 года назад
You can mask it with another texture using a fragment shader
@Relivino
@Relivino 2 года назад
@@PlayWithFurcifer Like here? ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-eT9ztkG2PTU.html
@hamoom
@hamoom 2 года назад
@@PlayWithFurcifer Can you describe a little more on how to do this? I cant apply a second pass shader.. Do I need to convert the particle to a shader and work from there? I'm trying it out but particle shaders dont have UVs so cant figure out how to use a sampler2D to mask them.
@ivailoburov1295
@ivailoburov1295 2 года назад
If you use in your code any non defined actions in project settings your FPS will drop to several FPS per minute. :D There are not any error messages as far as I remember. This occurs often when transferring parts of the code from one project to another. Do not use this trick. :D
@PlayWithFurcifer
@PlayWithFurcifer 2 года назад
Huh, thats weird
@InarusLynx
@InarusLynx Год назад
Does anyone know how to add auto-complete for functions I write? I made some global functions and put them into autoload, but I have to always look up how I spelled them. It never suggests the functions I wrote inside of the global script.
@SaiponathGames
@SaiponathGames 2 года назад
Nice!
@PlayWithFurcifer
@PlayWithFurcifer 2 года назад
Thanks!
@shanefoster5305
@shanefoster5305 7 месяцев назад
OK OK I'll Like! PLEASE DON'T CALL MY MOM!!!
@covenautadev7260
@covenautadev7260 2 года назад
I don't know if this is already in a video, but probably I have invented it, STOP using get_node("Path"), I hate it because when you change the path on files/tree or the object is deleted in-game it gets errors, instead, I create a var for example "Player" on the main global script "GS" then on node's ready call I set var to itself. extends KinematicBody func ready(): >>> GS.Player = self In that way, the path doesn't matter and if the player is deleted on death it is replaced automatically when you instance another because it is on ready(), note: if you want to use "Player" but the node hasn't called to ready you need to yield a frame.
@PlayWithFurcifer
@PlayWithFurcifer 2 года назад
Interesting, thank you! :)
@UsernameDoesntCare
@UsernameDoesntCare 2 года назад
Ive been having a bug with SceneTree Timers where if I change a scene in the middle of one, the game will produce an error but still run in debug mode. To fix this, I had to make my own timer nodes.
@Willior47
@Willior47 2 года назад
same here. i swore off SceneTree timers forever after this.
@netyimeni169
@netyimeni169 2 года назад
Oh the timer
@danieltudor94
@danieltudor94 2 года назад
one thing im curious about is who has the 1060 and who has the 3080 ?
@gines6234
@gines6234 2 года назад
First comment! :D I love you guys!
@PlayWithFurcifer
@PlayWithFurcifer 2 года назад
@yell9140
@yell9140 2 года назад
👍👏
@muerasangre
@muerasangre 2 года назад
👍
@SYLegendOP
@SYLegendOP Год назад
vulkan errorororoororororororoororororororo😢😢😢
@Shiromaru.
@Shiromaru. Год назад
I really liked your content but i unsubscribed because of flag
@PlayWithFurcifer
@PlayWithFurcifer Год назад
That's one of the advantages of that avatar :D Your need to let me know confirms that you are quite the asshole.
@duducorvao
@duducorvao 2 года назад
I have a problem for you guys to solve, since I tryied the Godot Discord channel and even the subreddit but could not solve it: My game is ready do be published on Google Play Store, but I can't upload it because, since the beggining of this year, Google only accepts .AAB files no larger than 150mb, but my game has lot of big textures and Godot exports it as a 600mb .AAb file. Reading in the Android's documentation, I see they have a new way to upload those big apps called Play Asset Delivery which has 3 types of "upload": install-time (this is like it was before with apk, but being .aab files. Just one 150mb file), on-demand (your game downloads all the heavy assets after installing the game) and fast-follow (this got me a little confused, but I think is when you split your app in several 150mb .aab files and upload eachone to the store). I don't know if I'm understanding this right, but seems like Godot right now only has support for the install-time method, which is a bummer, cause this limits a game to only 150mb :( This is my first commercial game, and me and my really small team worked 18 months on it. We know it's not the greatest game, but we would like to publish it. Thanks for reading this.
@DileepNow
@DileepNow 2 года назад
Maybe this is common knowledge but I found out a godot thing today. Say you have an area and monitoring was set to false for some reason. Now if you set monitoring to true to detect something, it will not emit 'area entered' signal for monitorable areas that are already intersecting the monitoring area. But if you want to get that signal, just give a zero translate to the monitoring or monitorable area right after you set the monitoring to true. Like $monitorArea.monitoring = true, followed by a $monitorArea.translate(Vector3(0,0,0)). Edit: This is in Godot 3.4
@MikeOlaoye
@MikeOlaoye 2 года назад
GODOT is hard but y'all make it look easy 👍 Love the video, don't call my mum 🥲
@PlayWithFurcifer
@PlayWithFurcifer 2 года назад
Ok, we wont :)
@nickhatboecker
@nickhatboecker 2 года назад
CONNECT_ONESHOT was a game changer for me!! Thank you very much
Далее
Why you Draw Bad Assets || 2D Game Art
13:00
Просмотров 74 тыс.
Programming a tactical strategy game in Godot 4
14:50
How Games Make VFX (Demonstrated in Godot 4)
5:46
Просмотров 351 тыс.
We made Vampire Survivors BUT in 10 Lines of Code
7:08
Godot Scripts I add to Every Game
12:34
Просмотров 27 тыс.
Optimizing my Game so it Runs on a Potato
19:02
Просмотров 624 тыс.
I Made the Same Game in 8 Engines
12:34
Просмотров 4,1 млн
Do THIS Before You Publish Your Godot Game
3:33
Просмотров 178 тыс.
Can I Remake Super Mario World in Godot? (Part 1)
18:44
How to use Classes in Godot! - Intermediate Tutorial
8:46