Use of UID directly

UID is a widely used concept .We can see many game engine adapt this feature from beginning.
But in Gdevelop there is no action or condition to use this function directly…instead developer had to make it with events or pull this from JavaScript. As a highly growing engine I think Gdevelop should also add this common feature.

2 Likes

This has been requested several times, including by me.
As far as I recall, @4ian is reluctant to implement it and wishes users to use the “Link” instructions and other GDevelop filtering logic to select instances.

3 Likes

This is correct, because actually there is nothing in the game engine mandating the existence of these “unique identifier”. Instead, I would like to understand why you need a unique identifier.

Is this to remember an object? In which case is a variable working?
Is it for performance? In which case in which context, maybe something to remember an object would be better?
Is it for linking objects, in which case can we improve the existing extension?
Is it for passing object identifier to functions, in which case GDevelop functions should already handle this better using parameters?

I know this is in other engine, but it’s not a reason by itself - they may have been doing this because their engine is not flexible enough to answer to the use cases I presented before :wink:

1 Like

Most of my recent project I needed to use UID. For that case I need to build the function with event every time.It is a big pain to control them for big environment and I had to make many block of event only to create them and many more to control . Then I search for this feature to Un4,Unity ,Construct and Godot. I found out Godot ,construct , and Unity has this feature built in and it is very simple and easy to use them. Then I found-out in google that this is a very common feature to have in many game engine.So as a well wisher of gdevelop I also want this feature to be added.

3 Likes

The question from 4ian was not if you need it but why you need it. There usually are better ways of doing it than using UIDs.

1 Like

Oh! well Uid is meant to select individual object from game so I just explained what was the cause of making uid with event (like it was a big pain for me ) so I explained what other engine dose and how can It help developers Then I requested him to take a look over it .:blush: Some grammatical mistake may happen cuz English is not my first language so mercy to everyone for that :sob:

‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎

As I mentioned before It was working fine with variable and event method. But it was a pain to control :disappointed_relieved:

To go forward with this let me know the specific events and use case: what are you doing, controling an enemy, firing rockets, doing what exactly :slight_smile:
Otherwise it’s hard to help as I explained in my previous message

1 Like

Well First I was making a snake game where I needed to collect last tail cube uid to create another one beside that when snake eat the fruit. And in another project I needed to make a Ai for player where he needs to shoot 3 bullet to random 3 enemy in other level he needs to kill 5 selected enemy automatically also in the same game I needed to collect health data for each enemy where Uid was a good option to use but I used object variable instead. And in many other project I felt the need of Uid. But all the project I mentioned I felt very pain to control those events based Uid so I had to find another way for them.
But at last I want say it is a well asked feature and this will help many developer. Also I don’t think a beginner Gdevelop user can use the event based Uid system properly.

1 Like

UID is an ID that is for all instances of all objects. In this case, I think you want an ID only for the snake tails, so it’s probably better to use an ID variable and not a UID.

1 Like

I was following this Method Method Method

And yea it can be done both ways but still in many other project I felt the need of Unique identifier for randomly generated sprites object.

UIDs would make it easier for beginners at gdevelop. For instance: I tried wrapping my head around the Inventory example when I first started gdevelop and I was very confused. UIDs would make it much, much easier.

1 Like