This is my first post on the forum, so I’d like to start by thanking the creators of GDevelop and all the people who make up this community and share their experience and time. Thank you!
Now back to the question…
Having read in other posts, I have understood that a large number of collisions in the scene can negatively influence the performance of the game.
So I wonder if conditions like “distance between objects” or “x/y position of object X” are less demanding in terms of performance?
By logic I understand that these require less calculation than collisions. I would be very grateful if someone could confirm it for me.
It’s just that I’m trying to create a game based on a single scene and I try not to introduce collisions, where it really doesn’t need that much precision (believing that in this way I avoid future disappointments… ).
Hi!
In this matter, testing and experiments can help you.
But I would suggest not to engage in premature optimization, and solve this problem when it appears. I don’t think it will be difficult to replace the collision check with a distance check between objects.
How many objects do you have on stage to worry about optimization?
This is something I’m actually really curious about as well! I’d seen a tutorial somewhere (I can’t remember which one, I’ve watched a lot lol) that said something along the lines of to never use collisions if you can avoid it cause they’re so demanding, but then every other tutorial I’ve watched that shows how to handle player interactions with npcs or triggering events, just about everything, uses a collision
@E1e5en you’re right.
Finally, it is not something that is difficult to correct afterwards. Although it is true that it could be a bit tiring work. Regarding the objects, for now there are not many. I’m more focused on the game mechanics for now. And since I plan a lot of interactions with the environment… it’s a question that occupies my mind.
Because I imagine that delimiting the collision box requires a lot more calculation, although I don’t know if this difference is really felt.