New to Godot Engine? Want to get started creating awesome games quickly? Just use AI!
AI learns (is trained) from online content (which is a whole separate topic). As a result, the quality of the answers the AI provides is based on the volume and variety of content available to learn from. Since Godot is still relatively new and niche, AI doesn’t have all that much to go on.
For example, if you ask ChatGPT: “What is the most recent version of Godot Engine?” it may respond with something like:
As of my knowledge cutoff in September 2021, the most recent version of the Godot Engine was Godot 3.4. However, please note that my information might be outdated as I don’t have access to real-time data. I recommend visiting the official Godot Engine website at https://godotengine.org to get the most up-to-date information on the latest version of the engine.
-ChatGPT
You’re less likely to get valid responses for anything related to Godot 4, given that GDscript has evolved, and some APIs have been renamed, and others replaced entirely.
But AI tools will continue to grow and incorporating them into your workflow makes sense. Just be aware that the value you get out of it is proportional to your own understanding of related tech and the specific subject matter at hand.
ChatGPT sort of spews semi-random, contextually related content, and most of the time it’ll probably be in the right ballpark. Just don’t ever blindly trust it.
New developers tend to not yet grasp when they’re asking AI the obfuscated equivalent of “How long is a piece of string?” or “How much does it cost to build a house?” and then have no idea what to do with the response. You’re still largely going to have to do your own leg work when it comes to problem decomposition, but AI can be very helpful for pointed questions that solve a domain-specific issue.
For example, if you want to use an AudioStreamPlayer to play a sound in different notes like on a piano, you should know that you can do that with the pitch_scale, but you have to work out the math. Sound waves are played back at a specific frequency (Hz), and musical notes are represented in semitones but all you have is a “percentage knob” (the pitch_scale). That’s something you can ask AI about, and it will probably spew out some relationships and formulas.
Let’s try it: “Given a base frequency of 440hz and a pitch multiplier, calculate semitones”
To calculate the number of semitones based on a given pitch multiplier, you can use the following formula:
Semitones = 12 * log2(PitchMultiplier)
Where:
PitchMultiplier is the ratio between the desired frequency and the base frequency (440 Hz in this case).
log2 is the logarithm function to the base 2.
Let’s assume we have a pitch multiplier of 2. The calculation would be as follows:
Semitones = 12 * log2(2) = 12 * 1 = 12
So, with a pitch multiplier of 2, you would have an increase of 12 semitones from the base frequency of 440 Hz.
Please note that this formula assumes equal temperament tuning, which divides an octave into 12 equally spaced semitones.
-ChatGPT
Now you have some more context as to what to search for on Wikipedia, StackOverflow, etc.
Equal temperament tuning, for example, is a good candidate and not something everyone is familiar with, if they don’t have a background in music theory. It may also impact the final result AKA the user experience, which is all that matters, so there’s another rabbit hole to dive into.
AI will definitely be able to help you fill in the gaps, but the proper assembly, integration, and overall architectural intent are still up to you. Godot doesn’t have a
log2()
method, so you need to know that
log2(pitch_multiplier)
is the same as
log(pitch_multiplier) / log(2)
. That’s not Godot-specific as much as it is understanding the natural logarithm, and how it relates to your use case.
But if you didn’t know that, you can always ask the AI again: “How to get the logarithm with a base of 2 from natural logarithm”:
To convert a natural logarithm (base e) to a logarithm with a base of 2, you can use the following formula:
log2(x) = ln(x) / ln(2)
In this formula, ln(x) represents the natural logarithm of x, and ln(2) represents the natural logarithm of 2.
Here’s an example to illustrate the conversion. Let’s say you have the natural logarithm of a number, ln(x), and you want to find the logarithm base 2 of that number, log2(x).
log2(x) = ln(x) / ln(2)
Using this formula, you can divide the natural logarithm of x by the natural logarithm of 2 to obtain the logarithm base 2 of x.
Please note that this formula assumes the use of the natural logarithm (base e) and converts it to a logarithm with a base of 2.
-ChatGPT
Based on the information above, here’s a method that will take a pitch and snap it to the nearest semitone.
With a few more changes, like tracking which semitones are in key, you could tune your game’s sound effects to be in key with the music.
For a conceptual recipe, just ask ChatGPT: “Tune all my sound effects to be in the key of the music”
To tune your sound effects to be in the key of the music, you’ll need to determine the specific key of the music and then adjust the pitch of your sound effects accordingly. Here’s a general approach you can follow:
Identify the key of the music: Determine the key in which the music is composed. The key is typically indicated by the key signature or can be determined by analyzing the tonal center and the chords used in the composition.
Determine the relative pitch shift: Find the difference in semitones between the current key of the sound effects and the key of the music. You can use a music theory reference or tools such as a piano or pitch detection software to measure the difference.
Apply the pitch shift: Once you know the relative pitch shift in semitones, you can transpose the sound effects accordingly. Use the formula mentioned in the previous response to calculate the new pitch for each sound effect based on the desired semitone shift.
Adjust the pitch of the sound effects: You can use audio editing software or tools that allow you to modify the pitch of your sound effects. Apply the calculated pitch shift to each sound effect to bring them in tune with the key of the music.
Keep in mind that this process assumes your sound effects are tunable and that changing their pitch won’t adversely affect their quality or intended purpose. It’s also worth noting that in some cases, adjusting the pitch alone may not be sufficient to make the sound effects blend harmonically with the music. Other factors like timbre and rhythm may also need to be considered to ensure a cohesive and pleasing sonic experience.
-ChatGPT
AI will definitely be able to help you fill in the gaps, but the proper assembly and integration are up to you. The code that AI writes is only based on what it learns from. And there is a lot of junk out there. Every line of code is an opportunity for bugs, maintenance work, and time sinks. In addition, AI doesn’t care about best practices or bounded contexts, SOLID, KISS, YAGNI, DDD, etc.
In summary: AI is a tool and learning to use AI effectively is also a skill set on its own, but it will provide a huge productivity boost to those who do. After all, developers are problem solvers, and if a problem can be solved faster, that’s a Good Thing™.
Here’s a collection of tutorials that are helpful if you’re new to using Control and Container nodes to create UIs in Godot 4. The Game Dev Artisan video covers creating a simple UI with a reload indicator for a simple 2D tank game: Clear Code’s 11+ hour Ultimate Introduction to Godot 4 has a chapter …
Per feedback, we’ve exposed more inventory user interface component signals to make it easier to react to slot/item interactions with custom logic. New features: In addition, these bug fixes are included:
Once I found out about the Steam Deck’s Desktop Mode, it got even more interesting. Steam Deck’s Gaming Mode vs Desktop Mode You see, the Steam Deck defaults to an analog of Big Picture mode on PC. It runs full screen in “Steam Deck gaming console” mode. But underneath all that is a Linux system …
Creating games with Godot Engine using AI
New to Godot Engine? Want to get started creating awesome games quickly? Just use AI!
AI learns (is trained) from online content (which is a whole separate topic). As a result, the quality of the answers the AI provides is based on the volume and variety of content available to learn from. Since Godot is still relatively new and niche, AI doesn’t have all that much to go on.
For example, if you ask ChatGPT: “What is the most recent version of Godot Engine?” it may respond with something like:
You’re less likely to get valid responses for anything related to Godot 4, given that GDscript has evolved, and some APIs have been renamed, and others replaced entirely.
But AI tools will continue to grow and incorporating them into your workflow makes sense. Just be aware that the value you get out of it is proportional to your own understanding of related tech and the specific subject matter at hand.
ChatGPT sort of spews semi-random, contextually related content, and most of the time it’ll probably be in the right ballpark. Just don’t ever blindly trust it.
New developers tend to not yet grasp when they’re asking AI the obfuscated equivalent of “How long is a piece of string?” or “How much does it cost to build a house?” and then have no idea what to do with the response. You’re still largely going to have to do your own leg work when it comes to problem decomposition, but AI can be very helpful for pointed questions that solve a domain-specific issue.
For example, if you want to use an AudioStreamPlayer to play a sound in different notes like on a piano, you should know that you can do that with the pitch_scale, but you have to work out the math. Sound waves are played back at a specific frequency (Hz), and musical notes are represented in semitones but all you have is a “percentage knob” (the pitch_scale). That’s something you can ask AI about, and it will probably spew out some relationships and formulas.
Let’s try it: “Given a base frequency of 440hz and a pitch multiplier, calculate semitones”
Now you have some more context as to what to search for on Wikipedia, StackOverflow, etc.
Equal temperament tuning, for example, is a good candidate and not something everyone is familiar with, if they don’t have a background in music theory. It may also impact the final result AKA the user experience, which is all that matters, so there’s another rabbit hole to dive into.
AI will definitely be able to help you fill in the gaps, but the proper assembly, integration, and overall architectural intent are still up to you. Godot doesn’t have a
log2()
method, so you need to know thatlog2(pitch_multiplier)
is the same aslog(pitch_multiplier) / log(2)
. That’s not Godot-specific as much as it is understanding the natural logarithm, and how it relates to your use case.But if you didn’t know that, you can always ask the AI again: “How to get the logarithm with a base of 2 from natural logarithm”:
Based on the information above, here’s a method that will take a pitch and snap it to the nearest semitone.
With a few more changes, like tracking which semitones are in key, you could tune your game’s sound effects to be in key with the music.
For a conceptual recipe, just ask ChatGPT: “Tune all my sound effects to be in the key of the music”
AI will definitely be able to help you fill in the gaps, but the proper assembly and integration are up to you. The code that AI writes is only based on what it learns from. And there is a lot of junk out there. Every line of code is an opportunity for bugs, maintenance work, and time sinks. In addition, AI doesn’t care about best practices or bounded contexts, SOLID, KISS, YAGNI, DDD, etc.
In summary: AI is a tool and learning to use AI effectively is also a skill set on its own, but it will provide a huge productivity boost to those who do. After all, developers are problem solvers, and if a problem can be solved faster, that’s a Good Thing™.
Related Posts
Building UIs in Godot 4
Here’s a collection of tutorials that are helpful if you’re new to using Control and Container nodes to create UIs in Godot 4. The Game Dev Artisan video covers creating a simple UI with a reload indicator for a simple 2D tank game: Clear Code’s 11+ hour Ultimate Introduction to Godot 4 has a chapter …
Inventory System v1.8.1 available
A quick update to yesterday’s release with a few fixes:
Inventory System v1.6 available
Per feedback, we’ve exposed more inventory user interface component signals to make it easier to react to slot/item interactions with custom logic. New features: In addition, these bug fixes are included:
Godot Engine on the Steam Deck – Developing games on the go?
Once I found out about the Steam Deck’s Desktop Mode, it got even more interesting. Steam Deck’s Gaming Mode vs Desktop Mode You see, the Steam Deck defaults to an analog of Big Picture mode on PC. It runs full screen in “Steam Deck gaming console” mode. But underneath all that is a Linux system …