Where can I learn the technical basics? I keep getting stuck on Variables and other aspects

I’ve definitely made a lot of progress since I started learning Gdevelop, but I keep getting stuck in multiple days long states of confusion and frustration. I even started taking some basics of programming online classes thinking it would help.

I read the instructions on variables, and watched some youtube videos, but I still don’t really understand how to implement them, as well as some other technical. I have even gotten answers to some of my questions here, but the answers sometimes don’t make sense and when I ask for clarification on how to implement the suggestions, I don’t get a response.

I keep thinking I understand how variables and some other things work, but then I don’t always get the results I expected. I want to find written or video tutorials that are designed to teach people that don’t already know programming. The instructions on the Gdevelop site often make little to know sense to me as I think they are written in a way that would more likely make sense to people who understand coding concepts that I do not yet understand.

Any suggestions on where to go to find what I am looking for?

Some examples of where I’m stuck:

Spawning an enemy 3 seconds after enemy collides (and dies/deleted) with the player.

Enemy movement. I want them to roam, then follow the player once in range., but even after someone here explained it, using “roamVar”, I don’t know how to implement their explanation. I have it so it will follow the player when in range, but can’t get the roaming to work.
Also, the enemies will follow the player, and don’t go through walls, but they often just sit against the part of the wall closest to the player. They only go around the walls when the player is at certain angles. I can’t seem to get them to be smart enough to go around the walls at all times.

Since it’s very hit and miss getting answers to specific questions, I really want to find a source to deeply learn the concepts so I can figure it out myself. But I come from an art and animation background, not programming. And even though I’ve gone through many tutorials, I still don’t fully understand why some things work that I’ve gotten to work.

Well variables are most the same in all languages, JavaScript, PHP, Python, etc you must at least be familiar with one language to understand how variables work, the scope of a variable, the values that can be stored in each kind of variable, I think this is the basics for you to start.
In GDevelop you have a lot of variable types and with different scope each, some samples.

Object variables: Are related to an object if the object is placed into an scene the variables can be modified by events.
Scope: The object itself and scene where the object is present.

In all cases variables can be:

  • Array - Think on this type as a way to store data like in pairs [key|value], arrays always starts at key 0.
  • Structure - Most similar to Arrays but in this kind of variables you can set the key as you like, can be a number like {0, 100} or a string like {PlayerHp,100}
  • Number = [0-9]
  • String - [Any string can be stored]
  • Boolean - [true/false]

Maybe I’m not too experienced to point you in the right direction and I think there is a few tutorials of variables and how they work and is logic because is almost a must have that any game developer has to know at least one programming language and to be more specific in this case JavaScript is a good start since GDevelop can process JavaScript code.
For instance if I want to make games for iOS and I don’t know Swift well probably my learning curve is going to be slow until I learn Swift.

Anyway here some of the resources I quick found doing the search “GDevelop Variables” in Google:


Thank you @UlisesFreitas

I am planning on trying to learn Python because I have been using Blender for about a decade, and thought it might be cool to write my own plugin. Also if I do any 3D games I’m thinking I should use Godot, and it works with Python (or their scripting language is similar?)
I was hoping using Gdevelop wouldn’t require learning any languages, but that has been getting more and more clear to not be the case unless I stick with the most basic mechanics.

I guess the think I am most confused about with variables is that I assume you can call a variable whatever you want, but I don’t understand how we tell Gdevelop what that variable means.
I’ll watch the videos you suggested and hopefully it will click. I’ve watched some other videos, and my mind kind of glazed over as I got more and more confused each time.

At the heart of GDevelop is the JavaScript programming language. And variables in JavaScript (like in Python) are dynamically typed. This means that if you pass a number to a variable, then the variable becomes numeric, if a string - a string. This defines the compiler / interpreter that processes the written code. It also means that during program execution, the type of the same variable can change if you assign a value of a different type. But it is considered good practice not to change the type of one variable during execution, otherwise, you can simply forget that you have changed the type and get an error.
Variables are a container with data that you visit into it. They can be thought of as a text document that you create for your notes. We created documents (variables) and during, for example, reading a book, write notes there (in one document it writes down how many pages have been read, in another - how many times the author wrote the name of the main character, in another - your thoughts about the chapter read, in another - Your impressions of the entire book). Further, you can return to these documents (variables), what to add, check what is written there.
Variables are declared in advance in the editor (in GDevelop) and can be used in a certain scope (only in the scene, only in the extension, everywhere, as described above).
About your tasks, which you wrote above. Then it’s not just about variables, but about the possibility of constructing an algorithm (a sequence of actions and conditions). Algorithm for writing into a document how many pages have been read: have read a page, opened the corresponding document, increased the specified number of pages.
For example, creating an enemy 3 seconds after the collision (died) with the player. You can simply describe the algorithm of what is happening on paper:

  1. Tracking collision event;
  2. If the player and the enemy collided: delete the enemy, start the timer for 3 seconds;
  3. If the timer is over, create an enemy.

In this task, variables are not needed at all. Alternatively, you can create a variable to store the name of the timer and its duration, when creating a timer and when checking for its completion, specify the name of the timer from the variable so as not to make an error (since this is just a string you can make a mistake). When checking completion, also take the duration from the variable, so it will be more convenient to change it if necessary (not in the code to search, but in the variable manager).
Now you need to write it down with code. You can describe the algorithm in even more detail, already trying to use the terms and functions of the game engine.

When I was a complete beginner the most difficult part was for me is that I was looking at the big picture and I did not even know where to start. The first thing you want to do is to break the game down in to tasks and break each task down in to small, independent problems that you can solve. For example:

So you need a timer and you want the timer to be paused At the beginning
Then you want to check if the enemy collided then unpause the timer
If the timer greater or equal to 3, then create an enemy
To stop enemy creation, you want to reset the timer back to 0 and pause it again after you create an enemy.

So as you can see, I have broken down the task in to 4 smaller problems…

At first it is not easy, but as you get more and more experienced with GDevelop, all the features, events available for you, you are going to get better and better at it. It is something that takes time…

Variable is nothing but a container to store value and you can use these values however you want.
It is also something that going to get better and easier by time and practice.

The most obvious way to use a value is for example when you set the life of the player. You can store the life of the layer in a variable and when you damage the player, you reduce the value. When the value 0, the player is dead.

But you can also use variables in less obvious ways and probably this is what you are the most confused about. For example, above we create an enemy when the enemy collide with a player. So for example if you want to create 2 enemies not just 1, one solution is to use a variable to count how many enemies have you created and when the value is 2 only then you reset and pause the timer.

The value of timer is greater or equal to 3, you create an enemy and also increase the value of the counter variable by 1.
Because the timer is still greater than 3 you are going to create one more enemy and you increase the value of the counter by 1 one more time and so the value of the counter at this point is 2 which means you have created 2 enemies.
So what you do then is check if the timer is greater and equal to 3 AND the counter is equal to 2 then reset and pause the timer.

I can throw at you tons of examples and explanations it is not going to worth anything until it is click for you and you truly understand a variable is just that a value and it is up to you what you do with this value.

No you don’t need to learn a programming language but you still need to learn programming concepts, using events require the same logic as using Python except using events is more simple and more friendly than typing commands. So just because you learn Python don’t expect It to be easier and to happen faster. It is still going to take time and practice to click one day and then you understand regardless if you learn a programming language or not.

But if you choose to learn a programming language, I recommend not to start with 2D or 3D game programming, forget Godot and Unity. I recommend to program console applications first. They are not nice or interesting and can be very boring, but this way you need to deal with the least amount of distraction and noise, which helps you to focus on the most important thing that you want to learn right now which is programming concepts, how to think like a programmer and how to break up a project in to tasks and each task in to small individual problems that you can solve.

Thanks for the responses everyone.

Some of what was said made sense to me, and some is still confusing.

What’s happening with the spawning currently is that it spawns a whole bunch of enemies at a time, or when I use “trigger once”, it just spawns one but when that one dies, no more are ever spawned. That’s why I’m so confused.

As far as the suggestion to learn programing unrelated to games, it’s more important for me to make games right now than to learn to program. So I don’t know that that’s something I can not dedicate the time to right now. But it does make sense what you’re saying. I like the phrase you wrote, “think like a programmer”. I’m going to see if I can find any videos or text tutorials using that as the search. Maybe somethings will click that are currently confusing to me.

The fact that I’ve got some demos for a few of my ideas mostly working and that some things I didn’t understand it all a month ago I feel like I’m starting to understand, gives me hope. Definitely glad I started with Gdevelop. When I looked at Godot and Unity tutorials, it was like a fog horn was going off in my head and all I felt was extreme confusion. At least I only feel like that occasionally with GD.

As for the specific suggestions on how to break down the spawning, I think I understand what’s been suggested, but I still don’t understand how to impliment it.
How do I set up and check a counter? Is that a Boolean variable?

Again, I really appreciate the help, everyone. I believe if I stick with it I will be able to finish what I’ve started. But I’ve had numerous incidences of many hours a day for multiple days stuck in a loop of just trying different things and nothing working the way I expected to. I try to only turn to this forum after that happens and I just can’t figure it out on my own.

No it is not boolean, it is a number variable. In GDevelop it is very convenient because in most cases you can start using variables without need to define them. So you can just use the event straight away to Do + 1 to scene variable Counter. And then just use the event to compare the value of the scene variable Counter if equal to 2…

It is because as I mentioned if you check the value of a timer, it is always be true as long you don’t pause and reset the timer. Or if you are checking collision and the collision never stop, it is also be true all the time.

The reason you get only 1 enemy with trigger once is that when you use trigger once, as the name suggest it is going to run the actions online once while the conditions are true. One of the conditions in the event must be false at least once before you can trigger the actions again. Just like above, if you are checking the timer, it is always true as long you don’t reset and pause and if you are checking collision, it is always true as long the collision is happening. One of them need to be false before you can trigger again.

I mean you can’t really avoid to learn to “program”. It doesn’t have to be a programming language but as I mentioned, you still need to learn programming concepts and it is takes time. There are lots of tutorials on YouTube and also on the wiki about how to get started. I recommend to complete some of those tutorials even if you are not interested in making such games but they can still teach you the basics that you need to make your own games.

If there is something in the tutorials that you don’t understand, you are welcome to ask for help on the forums. Once you understand everything in the tutorials, only then try to make your own games.