Avoid BUGS and Work FASTER - 10 Godot Engine Tricks

  Рет қаралды 53,373

PlayWithFurcifer

PlayWithFurcifer

Күн бұрын

Пікірлер: 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 2 жыл бұрын
@@sslaxx I prefer the Luigi board.
@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.
@lyingpancake95
@lyingpancake95 2 жыл бұрын
That shatter particle effect is exactly what I've been looking for. Thank you!
@PlayWithFurcifer
@PlayWithFurcifer 2 жыл бұрын
Amazing! :)
@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.
@Theraot
@Theraot 2 жыл бұрын
I had not considered using modulate like that. Now I can rewrite my hue rotation shader to use modulate.
@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!
@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! :)
@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 :)
@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.
@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
@Siberiius
@Siberiius 2 жыл бұрын
You save me so much time. Great videos!
@sandsandwich
@sandsandwich 2 жыл бұрын
these videos are exactly what I need thank you!
@PlayWithFurcifer
@PlayWithFurcifer 2 жыл бұрын
:)
@Tenraiden
@Tenraiden 11 ай бұрын
That girl grabbing the money flying out of the bag, where is that clip from? 0:09
@PlayWithFurcifer
@PlayWithFurcifer 11 ай бұрын
Probably pexels if it looks like stock footage
@AudioBoi1
@AudioBoi1 Жыл бұрын
the tests show awesome results, thank you for this ❤
@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.
@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?
@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.
@digitalman2112
@digitalman2112 2 жыл бұрын
Awesome! Great Stuff!
@PlayWithFurcifer
@PlayWithFurcifer 2 жыл бұрын
Thanks!
@Gazaze
@Gazaze 2 жыл бұрын
The modulate trick is gonna solve my shaders problem! thank you!
@PlayWithFurcifer
@PlayWithFurcifer 2 жыл бұрын
Amazing! :)
@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
@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.
@realMenta
@realMenta 2 жыл бұрын
Thanks for the useful tips!
@PlayWithFurcifer
@PlayWithFurcifer 2 жыл бұрын
:)
@mgomezmunoz92
@mgomezmunoz92 Жыл бұрын
So the thumbnail says do not create a get_tree(). create_timer() but on 0:26 so say the opposite?
@andreamassa2176
@andreamassa2176 2 жыл бұрын
Thank you very interesting and useful trick!
@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.
@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
@rocket007
@rocket007 2 жыл бұрын
i always laugh when you say "like animals". =D
@miserablepile
@miserablepile 2 жыл бұрын
I love these videos
@PlayWithFurcifer
@PlayWithFurcifer 2 жыл бұрын
@josecarlosbermudezcastro2617
@josecarlosbermudezcastro2617 2 жыл бұрын
Amazin vídeo, is really helpfull, tnx
@PlayWithFurcifer
@PlayWithFurcifer 2 жыл бұрын
Thank you :)
@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? kzbin.info/www/bejne/m4Wcq6ehfJeDirc
@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.
@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.
@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.
@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!
@shanefoster5305
@shanefoster5305 10 ай бұрын
OK OK I'll Like! PLEASE DON'T CALL MY MOM!!!
@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.
@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.
@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.
@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! :)
@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
@SaiponathGames
@SaiponathGames 2 жыл бұрын
Nice!
@PlayWithFurcifer
@PlayWithFurcifer 2 жыл бұрын
Thanks!
@danieltudor94
@danieltudor94 2 жыл бұрын
one thing im curious about is who has the 1060 and who has the 3080 ?
@Galomortalbr
@Galomortalbr 2 жыл бұрын
i had no idea about call_group, this seems so useful.
@netyimeni169
@netyimeni169 2 жыл бұрын
Oh the timer
@gines6234
@gines6234 2 жыл бұрын
First comment! :D I love you guys!
@PlayWithFurcifer
@PlayWithFurcifer 2 жыл бұрын
@yell9140
@yell9140 2 жыл бұрын
👍👏
@SYLegendOP
@SYLegendOP Жыл бұрын
vulkan errorororoororororororoororororororo😢😢😢
@muerasangre
@muerasangre 2 жыл бұрын
👍
@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
10 Godot Engine Mistakes You Might Make (Godot 4 / Godot 3)
10:00
PlayWithFurcifer
Рет қаралды 29 М.
12 Tips to Boost Your Godot Game's Performance
11:27
Deep Dive Dev
Рет қаралды 12 М.
Beat Ronaldo, Win $1,000,000
22:45
MrBeast
Рет қаралды 158 МЛН
Sigma Kid Mistake #funny #sigma
00:17
CRAZY GREAPA
Рет қаралды 30 МЛН
小丑女COCO的审判。#天使 #小丑 #超人不会飞
00:53
超人不会飞
Рет қаралды 16 МЛН
Мясо вегана? 🧐 @Whatthefshow
01:01
История одного вокалиста
Рет қаралды 7 МЛН
Every 2D Node Explained in 9 Minutes !
9:19
Lukky
Рет қаралды 398 М.
Particle Systems From BEGINNER To PRO | Godot Engine
10:59
PlayWithFurcifer
Рет қаралды 94 М.
How Games Make VFX (Demonstrated in Godot 4)
5:46
PlayWithFurcifer
Рет қаралды 371 М.
Godot Shader Tutorial [Basics] in 7 minutes
7:47
Master Albert
Рет қаралды 103 М.
Godot Scripts I add to Every Game
12:34
Aarimous
Рет қаралды 66 М.
You should use Enums! || Godot Tutorial
23:09
Jacob Foxe
Рет қаралды 14 М.
25 Gamedev Tips for Everyone
15:00
PlayWithFurcifer
Рет қаралды 13 М.
BETTER 2D visuals in 7 EASY TIPS
10:38
MrEliptik
Рет қаралды 77 М.
The Problem With Procedural Generation
17:57
Acerola
Рет қаралды 306 М.
Optimizing my Game so it Runs on a Potato
19:02
Blargis
Рет қаралды 718 М.
Beat Ronaldo, Win $1,000,000
22:45
MrBeast
Рет қаралды 158 МЛН