New unified variables and variables declaration in GDevelop 5.4

Perhaps. I myself am still not sold on the idea. Possibly because I already listed important variables in their appropriate variable pane so any benefit of doing so now is no more benefit than I had already but with the added ability to take an undeclared variable, say TempVar, and use it as a place to put a json, convert it back into the same TempVar as a structure, erase the structure by turning it to a number etc. I didn’t gain a thing.

Also I liked the long expressions. I made an impressively long expression once when I had first been using GDevelop a few months and I was so proud of its ungainly size I rushed to the forum to share it. I remember Keith I think pointed out that I could have shortened it by doing some of the calculations independently and then using the resulting variables in the expression instead of my verbose and masterful precious.

I am all for people dictating how I do my workflow to make it simpler and more streamlined for them, when they pay me. On my dime, I prefer to do things my way and trust me, when something is quicker and easier I latch on to it because I am lazy and my brain just looks for things like that.

So I for one am pretty disgusted with the change, but it is actually not the first change I have been disgusted with. It really doesn’t matter to me because I love GDevelop and will continue to support it. There is no game engine in the world that is not going to make some change that disgruntles some users but in the end you have to look at majority benefit and the future of the engine. I think they’re being great about the gentle timeline of this whole thing so that people can get migrated over, not just creating a new system and breaking everyone’s old projects outright without ever giving anyone a hint.

I sit on discord trying to solve other ppl problems
Sometimes it is way easier to me to just set up events send screenshot and link to preview of my project to ilustrate+prove it works

This already happened to me but it will be same story for every user for which i try to solve their problem

2 days ago user on discord ask how to make something happen on increments of a number
For sake of simplicity lets say each 5 so at 5,10,15,20,25,30 and so go on

My best idea is to use modulo expression on some variable
(Modulo loops around some number so imagine you have variable seconds and if you mod seconds to 60 then when it should hit 61 it will not go to 61 but instead start counting again from beginning)
So he had variable called Combo
Using compare two numbers condition he could simply go with
mod(Variable(Combo),5)=5
And now in action he could do whatever he wants
And it did not work and it was because my mistake
I forgot module accounts for 0 so when i told him to put there ,5 what it did was go 0 1 2 3 4 0 1 2 3 4 0 1 2 3 4 since that’s 5 digits including 0
I did not realize that so i went to test it in my project and show him it is working
And then i found i forgot about that 0
So proper expression would be mod(Variable(Combo),6)=5
Now it would go 0 1 2 3 4 5 6 0 1 2 3 4 5 6 0 1 2 3 4 5 6 since that’s 6 digits including 0 and it will hit 5

To do that i needed to declare variable just to test it out in my project in which i do not need that variable
I did say sorry for my mistake and showed him how it should be done

Now i needed to go back to my project and delete manually that declared var which my project won’t use / don’t need
Just so i do not litter my project with random vars

Variable update added me 2 tasks which takes up time if i want to provide that kind of help
There is no argument how long it takes it is few secs to declare and delete vars
BUT each time i gonna help someone this way i gonna need to take 2 additional steps
And i cannot say that my workflow because of this update got better the same way you can
Declaring variable in above scenario did not give me anything and only made me need to delete declared variable in addition to deleting events after i did make visual presentation for someone

And i or any1 here is not asking “please remove declaring variables”
Far from it
Cause you see old system still works so projects using old system do not break
I can copy or pre made variable of each type put it into disabled event group and just copy paste them when i need them
Either way i need now take additional steps each time when i try to solve problem for someone on discord or even here on forums
I won’t die from it but my workflow did not got better

So me or other users are not in need of taking away declaring
We ask for streamlined way declare vars or a easier way to use not declared variables

If new system did make your workflow better then good for you
But consider not all of us do what you do and use gdevelop in same exact way as you do
So for some of us new system can cause more problems than it solves
Where in most cases we did not have problems with old system

I agree with ddabrahim, Lucky-j and ZeroX4 here. Declaring the variables in advance is apparently the best way, but I believe that the user should have the freedom to decide whether they want to do it this or another way, even if the latter is not considered to be ‘good practice’.

It is not only easier for beginners, it also makes it faster to stitch something together for testing or sharing. I see it as a strength that you could do something unoptimized in Gdevelop and it would still run.

Reading through the posts in this topic gave me a flashback to this one 2 years ago, when timers suddenly had to be declared in advance.

Obviously everyone gets used to a new system after spending some time with it, I just don’t believe that those changes make Gdevelop necessarily user-friendlier or faster to use - which is one of the hooks on the webpage to try the engine.

I went into topic you linked i did read all of it
Pure luck but imagine in my games NOWHERE i am using timers
Just because i found out i can use TimeDelta() in vars
Or even go straight up with adding/subtracting some value like 1 or 5
To variables and use that instead of timers
JUST because this way i am not need to start something first
I only add action for it to run and check if value is below or above something and im done
With this method i do not get perfect timing i need to check if something is lasting long enough or not too long for my project
Yet i am able to measure it as i please
To be fair and clear with timers i know how much 3 seconds is
Yet i still need to check if 3 seconds as a cooldown is what i want for my project
Isnt it too much or not enough of a delay
So when i simply go add 1 to variable then check if that variable is above let’s say 100 i do not know how much time it will take for it to get it to 100
But i need to go trough exact same process
Where i do not need to know if 3 secs is enough
I need to know if delay i set is enough or not and adjust it anyway

So in conclusion seems i always avoid methods that required extra steps from me
So it is not about if i start using gdevelop from moment declaring was obligatory i would not have problem with it
I would still look for a way to have easier manage system for my vars

But right now we are running circles
Most of us just try to prove why one system is better over another
And that will prove nothing
I wish we sit and think for a better system for everyone
Throw ideas and eventually we find compromise or a solution that will make everyone happy or at least won’t be penalizing in some scenarios

1 Like

Here is some actual, live, user experience dealing with the variable change.

This is honest feedback, im not trying to trash the new update, its literally just me working and having to deal with this.

I also find pretty quick some issues that need to be adressed, and honestly, amazed that it even works like this in the first place…

Like pressing “Enter” on the variable page just closes the whole thing and dosent save anything… almost feels like im being pranked every time i press it lol

1 Like

just quoting what i said (not here) in this thread for other ppl

but i was thinking …

isn’t possible to restore the old conditions without using the old system…?
i mean

we may restore old conditions just as a “bridge” to declare vars in new system.

eg: if i have a undeclared var in – change the scene variable “my var” set to “1”

it will just bridge to the new system automatically declaring it in the scene properties…a scene var with the same name…so old and new sentences can be used and swapped depending on dev choice
They gonna works as a fake undeclared vars…just miming the old method…
it will just fake you thinking that ure using the old method

It will be just a matter on what you believe to read on the screen

ps : we may even have an option in game properties to see or not the full sentence.
if on it will show the kind of var edited (like old method) Eg: change the “scene” var myvar set to 1.
if not it will show the new sentrence change variable my var set to 1

We all have different experiences and opinions, but one thing we all have in common is that we use GDevelop. A no-code game development engine, and it’s VERY good at it. This change brings GDevelop a step closer to it’s purpose.

The team made this decision for a reason, or many reasons, and they know very well what the advantages / disadvantages are. GDevelop now is lightyears ahead of GDevelop few years ago thanks to the people involved in keeping the engine getting better with every update.

I can say that I know a lot about the engine and I also help people here on the forum. But I’m NOT a GDevelop expert, no way near it actually! I don’t know everything about how the engine works in the background, but there are people who do know. So I learn from them and adjust my workflow to how the engine is designed to work.

Now, we can keep on debating which is a better system, and that this change removed a feature that is supposed to make development faster and added unnecessary friction, or that there are many issues now. But we would be missing the whole point.

For beginners or people getting into the engine, this change makes understanding and working with variables so much easier.

For advanced users, this makes projects more organized, easier to navigate and less prone to errors. Which in return saves a lot of time and effort later.

Variables are one of the most important aspects of development. So if the purpose of using undeclared variables is to prototype and test out ideas faster, then these ideas and prototypes are being built on a more shaky foundation. I prefer spending a little extra time planning and setting up variables to build better prototypes and more solid ideas.

4ian explained it perfectly here:

Sure there are still improvements to be made, and the team is working on them atm. But I found that the new system works pretty well at this stage. Remember that it’s still in its early stages, and with future updates, declaring and editing variables will be much much improved.

You can still use older versions of GDevelop or copy existing older events. But my advice would be to start using this new system from now on.

Take a look on my posts above andv tell me what u think

@RMDB
You see you me or any1 do not need undeclared variables
We just need easier way to declare and remove declared variables
Or to be precise we need better variable management system
Because if your var would be declared on 1st time using it in condition/action
Most arguments in favor for not declaring vars would go away
IF removing all events which include that var would result in var being removed then we are even closer to lose argument in favor of having a way to not declare vars
I do not care if i need or if my var gets declared or not
I care what steps i need to take to properly use variable
Same as to what steps i need to take to not have that var in my project
And in the end if you think about it then that is also all you care about
We could adapt without a problem to new system if it would offer better management options

@insein
No one is arguing here technical benefit of vars being declared
Ppl who are against declaring every var do not want declaring go away
They want only choice between one or another or better system to manage it
IF argument is that when you use var in action engine do not know should it be scene local or global var
Then why not leave 3 buttons in variable window to select them as one or another?
Now engine will know and you are managing your var the moment you start to use it
And you are not need to go to different window to set something up to start using it
By pure logic of newbie
Program wants me to set something 1st before i start using it
Then why it is not letting me do in the window where i am starting to use it?
We are talking about just 3 options here/3 buttons or drop down menu with 3 positions
I am all in for your argument that our projects now get better structured cause we plan our vars and declare them
Yet again if i am just to help you or someone else by preparing some events and making screenshot out of it
Then i need each time declare these variables and delete them later so i do not litter my project
I do not need that variable to be declared if i gonna use it just to show/explain something
Yet with new system i am required to take some additional steps just to be able to do what i was doing before variable update
Declaring/deleting vars do not take hours it takes few secs
Yet i gonna need to do it every single time i want to test something for someone or show how to do something
Where at the same time i can copy existing variable like action/condition
And simply rename it to some undeclared variable and it will still work
So from my standpoint only some actions/conditions for me to using undeclared vars were removed yet i still can use them if i want to
But either way i am forced to make some additional steps
So even if i declare or not declare var and care to use it
I am required to sacrifice more time in doing so than before update

So i say lets think of a better system for declaring lets throw some ideas and see if we can find some solution
Cause right now you can give me 100 reasons why declaring is better and i can give you 100 reasons why having option not to declare vars is better
Yet we will be in same exact situation

But if we start giving ideas how to have better system we will start moving forward

Probably i have not explained well…english isn’t my main languiage…but my suggestion
is to restore the old conditions actions just as fake / bridge sentences.
In game option u can have an option to check if you want to see the full sentence.
eg:

i chose option show full sentence
i chose a condition:
if “scene” variable “myundeclaredvar” is set to 1
GD in background will declare that var in scene variable panel automatically (since it will know the type and the value)…as in the new system.

if full sentence option is unchecked it will show the new sentence
If variable “myundeclared” is set to 1.

variable will be declared in both methods.

Nah i do get you
But
1 - we are regressing from having 1 action/condition to having multiple
Where on other hand we still have separate for object and other vars
2 - I say having one action/condition is still less confusing for new users

That is why i offered option where in same exact window we change variable in action or check variable in condition we do all the choices

You do not need to look for other options since all options you could possibly want to select/choose are right there in your face

Look at it this way
You do not need to look for proper option on the left list
You can click whatever you want on the right side of window and see what will show up is it what you want and i say you have better view over what you did select

Maybe i am biased cause its my idea
But what i offer could work as you describe just without 3 separate actions/conditions on the left side of the window

And now let’s look at it this way
I do not want to declare variables
How many times i gonna set up these options before i start declaring them? So i do not need to set up these options over and over?
Yet if i am using var just to show something who needs help i can choose to not declare var and it will not be added to the list and so for purpose of that i can set up few options where in most cases i will just leave it with default values like number scene var and all i input is name and what i would normally select which is sign/operator and value

The problem is that they don’t want undeclared vars anymore…(for whatever reason).
with what i said above there are no undeclared anymore… but you can still write a sentence withot the needs to go in the panel or pop ups tho chose things

Because let’s face it they are right
We do not need undeclared vars
All we need is easier system to declare and remove declared vas
So how about let’s go other way around
Let’s go with auto declare when you use var
Yet you have option there to tag this var as temp var
Meaning that if all events for this var are deleted then var no longer exist in your project
It would be declared but as soon as you tagged it as Temporary var (there would be button for that) it would special icon to notify you its temp var for example some clock icon or whatever
You delete all actions/conditions including this var then it gets deleted from the list
Wouldn’t that be a solution?

Thaz indeed my suggestion…
but i don’t get you…wha’t the needs of a temporary var if it will be deleted anyway (even form the panel) when theare are no sentences?
prolly i have not understand well

Look do you really need undeclared variables
Or in some cases declaring variables just do not make sense?
Cause i say we do not care for being able not to declare vars
We care to just use them so who cares if they get declared or not?
So instead of opting in for not declaring them let’s opt in for auto declaring variables when using them which of course would involve more options in action/condition window
Yet if for whatever reason you do not need that variable in your list you just need it for a moment to show something with screenshot
You tag it as temp variable (you simply press button in that action/condition window) so after you delete all events with that var it gets delete from your project meaning it is not declared anymore

If that would pass i would question any need for variables to be not declared since i would find no use for them
Where key word here is auto declare
Process should be automated and then all arguments for them being not declared would go away
Or am i wrong?

1 Like

Right thaz what i said :smile:
i’m ok too for a temp tag if all sentences are removed
:handshake:

to sum up:

let’s just use old conditions action as a tool/option to autodeclare all vars in the new system

1 Like

btw as i was giving this a try i figured out why you cant have same name variables in Scene / Global and so on… its for expressions.

They removed the need to type Variable(myVariable) and GlobalVariable(myVariable), now you just type “myVariable”, and since you cant have multiples, the system knows if its a Scene, Global whatever…

This seems way better and quicker if it wasent for a few snags…

If you try to plan ahead and organize your variables in structures, you still get the mouth full of Structure.myVariable, if you plan ahead for saving all your variables to do a save system and put your variables into a single structure with structures in side to be organized, you still get Scene.Structure.myVariable

Which would kinda be ok, but now you have extra cliques, and i dont mean for declaring…

Before, you could type in an expression “Variable(myVariable)” and hit “Enter” to close the whole thing and move on, now you cant, pressing enter auto completes but dosent give you the “dots” or even close the prompt if your finished, you have to clique off which i find personally annoying.

I want to chime in as I keep seeing the same group of folks going in circles around this, and it feels like you’re just going to stress yourself out with the thought experiments.

4ian’s response here and other GDevelop company devs were pretty explicit that the old method isn’t going to come back, nor are they going to make the new method behave similarly to the old, nor would they enable some way to use both. At the most basic level, I get it, because it would mean they would need to maintain both methods in perpetuity.

It feels like this thread has lead to the folks going into a cyclical spiral of ways it could go back to that method. For your own peace of mind, you likely need to adjust your thinking and energy on how you can implement the new method in existing projects, finish up your existing projects on the old version and use the new method on the new method, or finish your projects in their current state then come back to do refactoring once you’re at a good stopping point.

I mention this because there was similar discourse when setting up timers changed, and the old method remains retired even a year later. Getting increasingly frustrated here is not going to get it closer to reverting, but just build more and more stress for yourself. This is not a directive or some kind of warning or anything, it’s literally me saying “you’re potentially giving yourself blood pressure issues by hoping for something that will not come to pass.”

3 Likes

Then why even open dialog? Might as well just gone “Put up and shut up”, harsh i know, but its basically what it is.

Why even entertain Zeroxs ideo on the new UI then?

Anyways, im over it, but i tell you this… now that im using the variable page more, i keep finding bugs on day one, how the heck as this been like this all this time?

If you gonna force people to declare variables you could at the very least have prepared the means to do so a bit better, made some QL to it, make it more appealing.

Honestly that stuff with pressing enter just closing the window just made me laugh, how the heck is that a thing that hasent been fixed?

I just found that if you drag stuff out of a structure than it breaks the error message and you dont get an updated event.

You have to clique twice to get off a variable most of the time in the Variable Page when putting in the name.

And so on…

Fine, changes are here to stay, cool, but it was a piss poor implementation and you cant argue that.

Should of really tested the “declaring variables” experience, or event using the whole thing in general, this kinda sucks, i tryed, i really really tried, it sucks man…

…and updating my project is honestly making not want to keep working.

So what you suggest?
I am biased against declaring everything
Yet i am not biased that old system needs to return
I just wish for getting better new system which will be streamlined
I try to explain to users here that not in all scenarios new system is better
Where i cannot deny new system having its advantages

So again what you would suggest us to do?
Give up on the matter? And i am not sarcastic this is a serious question
I mean i do not care for undeclared vars i care for better system than we have right now
And i believe in the end everyone would care more for better system rather than going back