How does one "learn"

Godot Version

4.5.1

Question

This question may seem obvious, but how does someone actually learn to code? So far I’ve been following along with tutorials, having some fun, feeling like I’m getting the hang of it, but when I try to do something on my own, I stare at the screen and have no idea how to do anything.

How does someone actually learn to do this? I’ve been at it for a year and feel like I’ve made no progress.

How old are you?

Good question. I’m a 3D artists who’s been learning to write GDScript for a while with OK success, but I’ve learned a ton of 3D and 2D software over the years, and have some suggestions. Since you’ve been doing tutorials for a while and have a basic idea of how it all works, I’d say get yourself out of Tutorial Hell by making a series of small projects that you’d really like to see yourself doing. Nothing crazy-big at first, but relevant to your goals. So pick 3D or 2D mode, and go for it. The problem with tutorials is that you don’t give a damn about the content, and when working with code, learning a bunch of functions and methods that have nothing to do with what you want to do just doesn’t stick. The API is basically just a big list of things you might do that’s completely invisible and always needs to be looked up, so get used to reading a lot of documentation.

The thing with code is, you build it from the ground up and constantly go back and edit it and refactor so it’s able to do “the new thing” each time. It’s far more important to learn how the code interacts with the nodes, and what sorts of algorithms and inputs are useful in the various circumstances you anticipate needing. I loved the GameDev.tv Godot tutorials for that, but your mileage may vary. Start small, as I said, but relevant. If you want to do a 3D game, start by using free assets to, say, practice making a character move according to keyboard and mouse input. If you can make a character model move laft/right/front/back, then you might try seeing about triggering animations that sync with that. Then you might try having a door open when the character approaches. Then you might try having the character go through the door and trigger a load to a new level where the character can walk around. Bit by bit.

For complex stuff, like breaking down code into separate manager scripts and singletons to handle data management, etc. I’ve found that “talking” it over with an AI is really useful. They often mess up, so it’s not a perfect tutor, but their errors give you something to correct and wrap your head around.

Just start with very simple things. It is better to be able to do something very simple by yourself than to be able to do something very complex by copy pasting what someone else has done. Best way: combine both. Follow simple tutorials but pause frequently and try to mess around a bit, see what you can do. It doesn’t have to be anything big. Just to learn that .length() will get you the length of a string will at many points in the future help you solve a problem that will appear.

The answer may seem obvious too - you write code. Like any other skill, the more you do something the more proficient you become at it.

I acknowledge that you are frustrated, but I don’t think you are being very realistic. A year is less time than it takes to get a computer science degree. Truthfully, I can not think of any complex skill that can be mastered in less than a year.

I have made a career out of writing computer programs. I am still learning. I still have moments when I stare at the screen with no idea how to solve the problem I am seeing. That is just the nature of the job. I have enough experience to know that either I will figure out the solution or a workaround - eventually.

I also know that I don’t know everything. That is why I go to github and read other people’s code. I lurk in the forums and read the questions that I don’t know the answers to. I ask questions when I get stuck on something. I look at interesting things in the software I use and try to figure out how the developers did it.

Done right, learning is a process that never ends.

The problem with just doing tutorials is that there is a good chance your knowledge will be superficial. You learn what to type to do something, but you don’t learn why you type it. So when it comes time to change your code to make it do something else, you don’t know where to change it, and when you want to do something of your own from scratch you don’t know where to begin. I recommend trying to build something very simple on your own. Like a calculator. Make it take command line input and spit out the resulting number. Then you can add more functionality to it, then you can try adding a UI. Don’t use any tutorial, and never ever copy paste code from the internet. Copying code can help you solve a problem right now, but it prevents you from learning how to solve that problem. If you read a solution online, type it out yourself and for each word or token you type out, make sure you understand what it does. If you don’t, go find a text or video explaining what it does. And always ask the question why. Why do I need to instantiate an object before I can read values from it? Why do I want to inject dependencies in the constructor instead of creating them inline? Why do I use .equals() when comparing strings instead of == ? Don’t just accept the how and move on, always ask why.

And the final recommendation: find an education. If you live somewhere education is expensive then this might not be possible for you. But if you live in the EU, then even if there is no education near you in the field, you can travel to one of the countries with free education like Sweden and take a couple of university courses there. It really helps with the fundamentals.

When I started Godot the best thing for me was to do tutorials. The good ones that explain why they do what they do are helpful because then they aren’t telling you words to write, you get to know why you write them. If it explains what it’s going to do before showing you the code, you can try and quiz yourself on a pseudo-code implementation. It doesn’t matter if your first part of code you wrote yourself is good, just that you wrote it. Making good code is something that comes with time, at the early stages of learning to code it’s just important that you feel the nice win of something working. Before starting with Godot I knew basic programming from Khan Academy’s javaScript courses (that I abandoned once I realized I knew enough to code silly little things) but I mainly learned how to code from Godot tutorials. If I had to recommend some tutorials to use I’d say Dev Worm has some good ones. They are a lot of one off tutorials for mini things that are good for once you’ve got some sort of skill working in Godot so you can incorporate smaller features (for example a wall jump) into your existing game.