Announcements, feedbacks and other discussions about GDevelop.
User avatar
By Lizard-13
#67603 The difference should be minimal. It will be a bit worse if you separate actions related to the same object in multiple events, i.e. if instead:
Code: Select allConditions: No conditions
Actions: Do = 5 to the X position of Player
         Do = 10 to the Y position of Player

You do:
Code: Select allConditions: No conditions
Actions: Do = 5 to the X position of Player

Conditions: No conditions
Actions: Do = 10 to the Y position of Player

GD will recreate the Player objects list twice, worse performance for sure but barely noticeable on a small scale... I think :)

EDIT: Just made a test, added 247 instances of the same object on the scene, and used three approaches:
Added a single event like this:
Code: Select allConditions: No conditions
Actions: Do = 5 to the X position of Object
         Do = 5 to the Y position of Object
         Do = 5 to the X position of Object
         Do = 5 to the Y position of Object
         ...x200

In total there is a single event with 200 actions, the total events time is ~0.93 ms per frame (4.7 % of the total time)

Then I did it:
Code: Select allConditions: No conditions
Actions: Do = 5 to the X position of Object
         Do = 5 to the Y position of Object

Conditions: No conditions
Actions: Do = 5 to the X position of Object
         Do = 5 to the Y position of Object

...x100

In total there are 100 events with two actions each, the total time is ~1.2 ms per frame (6.1 % of the total time)

Finally I did it:
Code: Select allConditions: No conditions
Actions: Do = 5 to the X position of Object

Conditions: No conditions
Actions: Do = 5 to the Y position of Object

Conditions: No conditions
Actions: Do = 5 to the X position of Object

Conditions: No conditions
Actions: Do = 5 to the Y position of Object

...x200

In total there are 200 events with a single action each, the total time is ~1.4 ms per frame (7.3 % of the total time)

The thing is that 200 events (using the same object) is a lot for some people but it could be something common for others...