Thanks! Many more tutorials are coming. I want to focus on quality over quantity, so it may take a while. I want these tutorials to remain relevant for years.
you have no idea how long i have been looking for a time and a day night cycle thank you soooo much your videos are fun clear and fast, just amazingggggg
Very cool! Great job! Can you give a hand how to apply that light circle are not visible due to day cycle while adding light circles. Mix mode helps a little, but it visible like a faint light circle, really annoying. Also any suggestion how to implement smth like flashlight to the player which could be turned on using a button.Thnx in advance
Thank you for this wonderful tutorial. I wonder since we’re basically changing the overall color palette it means it won’t be possible to implement something like glowing windows in houses during the night?
This is an awesome tutorial because the codes are clean and can be easily understand! What if I wish to store the time data across all the scene so that the cycle will not reset every time I change scene? Which variable should I store globally and how do I implement it when I change to a new scene?
I feel you left the setup really vague for the UI and it was near impossible for me to follow along at around 5:30 and that really let this down, which was a shame because it had very good potential
Loved the tutorial, thank you very much. Is it possible to access the times from other scripts? I would like to have my NPC pull out a torch (well enable a Light2D on him) when it gets to a certain time.
Cool! But it seems to me that using CanvasModulate as a layer above the others makes it impossible to use any light sources on the tilemaps. Because the whole thing is covered with Canvas, the light sources will be modulated by this day-night system, or the effect of their lighting will be modulated. Am I wrong?
CanvasModulate basically sets the ambient light color, so the effect of additional light sources is increased from using it, not diminished. Could probably even play with using overbright colors at day with a decrease in exposure to simulate lights being less visible in direct sunlight.
Implementing realistic months/years is a bit more tricky, as not every month has the same amount of days and depending on the year, February has a different amount of days. To keep things simple, you could attempt to make each month 30 days.
this kind of works because evening is the same as dusk....if you have different times of days and different colors this won't work because it looks like you go from night to day in reverse...
I noticed that the github repos for your tutorials are licensed under GPL, if I follow your tutorials and use snippets from your videos, am I bound by the terms of the GPL?
Hey, thanks for awesome tutorial. But what if i need to create lights during a night? I mean... it should be night still but at the same time it should bring some light to make things more bright and visual during a night. Should it be a mask which will decrease transparency level of canvas or other approach?
Very good tutorial. Followed it and works flawlessly. A question: how can I avoid things like floating combat text from being modulated? I've tried playing with z index but doesn't seem to work
You have a few options: - set a custom canvas material on your text and disable shading - use a CanvasLayer on top of your scene and put the floating text there - use a different light layer for your combat text
How does export work with gradienttexture1d, i can't seem to get it to appear in my file system pane, i also checked where i saved the .gd file but i cannot locate the .teras file plz help T_T
@@bitbraindev I ended up reading up on this a bit. The Godot 4.2 docs say that the int is 64 bit. I read some concern on Reddit that targeting Android or web will result in 32 bit ints, but this is weird because I know modern browsers have a BigInt type which supports 64 bit numbers, which would mean cross-platform parity for 64 bit ints. Interesting problem, but it could be that you were initially right and that all Godot ints are 64 bit since there seems to be cross-platform support for 64 bit integers.
Is the medieval village tileset available somewhere for free use? I know its in the tutorial download files, but is it part of a bigger tileset I can download, and is it okay to use it in my own project?
Hey I don't know if anybody will see this but I successfully implemented this tutorial but was hoping for some help with keeping the time across scenes. I am trying and failing at having the clock not reset anytime my player goes into a building XD
Just in case someone sees this in the future, to maintain information between scenes you can create an autoload file in Project Settings. This script will run immediately when the project starts and keep on running throughout. It's not scene dependent and can be used to track information across scenes, such as time, inventory, any player stats etc.
If anyone is having trouble I suggest loading up the demo project they provide. Helps see the scene structure they're working with and how to set yours.
About 15 hours ago I completed my daynight cycle, did it in a similar way so nice to see I'm on the right track :D
There is no right or wrong approach but I prefer things to be as simple as possible and math is quite elegant.
I spent hours trying to make a day night cycle then this video helped me get one working in no time.
Thank you very much sir.
Would love more godot 4 tutorials! These are great
In progress!
He's back 🎉
omg thank you so much
I didn't understand anything, but I know I'm a beginner and I should trust the process to evolve.
Thanks this was a good tutorial. I like seeing how the day night cycle is represented by a sine wave
4:22 An int function on a float does not round down. It truncates the value.
Technically, you are correct. However, it achieves the exact same result. Poor choice of words on my part.
You chose a beautiful color palette for your day-night cycle. Also, cool new thumbnail style! 🙌
You're the best. Keep making great Godot 4 tutorials.
Thanks! Many more tutorials are coming. I want to focus on quality over quantity, so it may take a while. I want these tutorials to remain relevant for years.
Thank you so much for the tutorial!
Long time no see u mate , I hope that u doing very well in your life
Cheers! In fact, I am doing very well. Already working on the next video!
@@bitbraindev i will wait it , just let it cock good 👌🏻
Cool! I'll implement that in my Game really soon!
Ahhhh bitbrain tutorial 🎉🎉
2:05 "we want a blue tint for night mimicking a full moon's glow."
Or you can go for what I'm going for and have a near impenetrable darkness. >:)
Amazing, thank you! ^^
welcome back
Yeah! New video!
Welcome back!
you have no idea how long i have been looking for a time and a day night cycle thank you soooo much your videos are fun clear and fast, just amazingggggg
Very cool! Great job! Can you give a hand how to apply that light circle are not visible due to day cycle while adding light circles. Mix mode helps a little, but it visible like a faint light circle, really annoying. Also any suggestion how to implement smth like flashlight to the player which could be turned on using a button.Thnx in advance
This was really helpful, thank you!
Thank you for this wonderful tutorial. I wonder since we’re basically changing the overall color palette it means it won’t be possible to implement something like glowing windows in houses during the night?
Great video, and a really neat solution!
thank you! Nice tutorial
Great tutorial as always!
This is so awesome! 💛
This is an awesome tutorial because the codes are clean and can be easily understand! What if I wish to store the time data across all the scene so that the cycle will not reset every time I change scene? Which variable should I store globally and how do I implement it when I change to a new scene?
Ey @bitbraindev did you use motion canvas for the animated graphs etc.
Yes! All code is open source here: github.com/bitbrain/motion-canvas-animations/tree/main/godot4-tutorial-daynightcycle
I feel you left the setup really vague for the UI and it was near impossible for me to follow along at around 5:30 and that really let this down, which was a shame because it had very good potential
thank you so much!!!!
Thanks!
How can I make it so the night time takes 1/3 the amount of time the day does?
Loved the tutorial, thank you very much. Is it possible to access the times from other scripts? I would like to have my NPC pull out a torch (well enable a Light2D on him) when it gets to a certain time.
A way to solve this is by creating a global signal inside an autoload and connect to that!
@@bitbraindev Brilliant, thanks for the pointer!
Very helpful tutorial. May I ask what code editor are you using? Does not seem like the built-in.
Thanks! It is 100% Godot Engine but with my own custom theme. Grab it here: github.com/bitbrain/godot-dash
Excellent!
Cool! But it seems to me that using CanvasModulate as a layer above the others makes it impossible to use any light sources on the tilemaps. Because the whole thing is covered with Canvas, the light sources will be modulated by this day-night system, or the effect of their lighting will be modulated. Am I wrong?
You should use 2D lights without a problem. CanvasModulate is not a texture on top but a modulation shader operating on the screen texture.
CanvasModulate basically sets the ambient light color, so the effect of additional light sources is increased from using it, not diminished. Could probably even play with using overbright colors at day with a decrease in exposure to simulate lights being less visible in direct sunlight.
Hi very nice job.A idea plz i want to implement month (seasons)? ty !
Implementing realistic months/years is a bit more tricky, as not every month has the same amount of days and depending on the year, February has a different amount of days.
To keep things simple, you could attempt to make each month 30 days.
@@bitbraindev i tried to add
if day >= 30: month += 1; day = 1 ; minute = 0; hour = 0 but time stops after 30 days .
@@spiritnet6219 sorry for late reply, but if you do if day == 30: day = 0 and time = 0 it will reset the day to 1
sooo.. how do I do the actual in game timer?
It was completely skipped over
this kind of works because evening is the same as dusk....if you have different times of days and different colors this won't work because it looks like you go from night to day in reverse...
I noticed that the github repos for your tutorials are licensed under GPL, if I follow your tutorials and use snippets from your videos, am I bound by the terms of the GPL?
I changed it to MIT now 🤘
I just used an animation player and animated everything with that.
Very nice! Are you considering to make one in 3D as weell?
Maybe in a few years. Currently, I am exclusively using Godot for 2D only.
The vid was great and really helpful, thank a lot
BTW got any plans for 3D tuts?
No 3D at the moment. Long-term though, I want to build smaller 3D games (e.g. horror games) so maybe there might be a tutorial coming out of that.
Happy to hear that, I'm really looking forward to it
Hey, thanks for awesome tutorial. But what if i need to create lights during a night? I mean... it should be night still but at the same time it should bring some light to make things more bright and visual during a night. Should it be a mask which will decrease transparency level of canvas or other approach?
maybe u should tying light2d node in godot 4,is too ez
cos(x) * -0.5 + 0.5 іs the same function but simpler and faster
Very good tutorial. Followed it and works flawlessly. A question: how can I avoid things like floating combat text from being modulated? I've tried playing with z index but doesn't seem to work
You have a few options:
- set a custom canvas material on your text and disable shading
- use a CanvasLayer on top of your scene and put the floating text there
- use a different light layer for your combat text
@@bitbraindev ohh I love you!!! Thanks, it works great with the unshaded material.
So how can i make the day last longer? Like say i wanted it to last for 10 minutes?
How does export work with gradienttexture1d, i can't seem to get it to appear in my file system pane, i also checked where i saved the .gd file but i cannot locate the .teras file
plz help T_T
How to scale image from tileMap?
how to make light sources? for example, fire torches, it is strange that this is not shown
Fire torch will be a separate (shorter) tutorial. For Godot 4, I want to split things up more but go into more detail in each video.
Is there any danger in the time variable overflowing at some point, since it just grows indefinitely?
With a 64bit int it would take 585 million years.
…so you’re saying there’s a chance!
@@Lion4de also correction: by default, Godot has a 32 bit signed integer, so that would overflow after 25 days.
@@bitbraindev I ended up reading up on this a bit. The Godot 4.2 docs say that the int is 64 bit. I read some concern on Reddit that targeting Android or web will result in 32 bit ints, but this is weird because I know modern browsers have a BigInt type which supports 64 bit numbers, which would mean cross-platform parity for 64 bit ints. Interesting problem, but it could be that you were initially right and that all Godot ints are 64 bit since there seems to be cross-platform support for 64 bit integers.
can i use the time ui assets in my commercial project?
sure, just make sure to credit me!
Is the medieval village tileset available somewhere for free use? I know its in the tutorial download files, but is it part of a bigger tileset I can download, and is it okay to use it in my own project?
Here you go: beast-pixels.itch.io/overworld-tileset-grass-biome
Hey I don't know if anybody will see this but I successfully implemented this tutorial but was hoping for some help with keeping the time across scenes. I am trying and failing at having the clock not reset anytime my player goes into a building XD
Just in case someone sees this in the future, to maintain information between scenes you can create an autoload file in Project Settings. This script will run immediately when the project starts and keep on running throughout. It's not scene dependent and can be used to track information across scenes, such as time, inventory, any player stats etc.
how to do it in 3.5?
Should work the same mostly. It's math based which is engine independent
If anyone is having trouble I suggest loading up the demo project they provide. Helps see the scene structure they're working with and how to set yours.
I have never seen any triple a game project made with godot. Very small games only
Sonic: Colors was made with Godot!
@@bitbraindev looks very interesting. Thanks)
Yo quiero hacer un juego de plataformas 2.5D ( es mi sueño 😅 )
hehe boi. Dont stop me from making a >>> ,m,m
From 5:28 here all goes downhill and nothing works anymore. Guess I will give up on this system hahahaha
and you have the code 1:1 like this? It should work. What problems are you seeing?