Performance & Movement

Get help using Construct 2

Post » Sat Feb 15, 2014 9:35 pm

Hello,

I have an easy question.

I try to design my game as performance optimized as it can be.

What calculates faster?


Option 1:

object 1 - move at angle 180 -4*dt
object 2 - move at angle 180 -4*dt
object 3 - move at angle 180 -4*dt

I think this is the slowest method, because the game has to calculate the degree .


Option 2:

object 1 - set X to self.X-4*dt
object 2 - set X to self.X-4*dt
object 3 - set X to self.X-4*dt

This I think whould be the second fast, as the game has to check every objects X and than substract from this value.


Option 3:

object 1 - set X to self.X-4*dt
object 2 - set X to object1.x
object 3 - set X to object1.x

Finally I think option 3 is the fastest as it has only to calculate the first object and than simply check the first objects X coordinates for the other two objects.


Am I right? The difference is probably not noticeable at all but maybe if I whould have 100+ objects.


Thank you.Alyra Games2014-02-16 00:57:00
B
10
S
2
Posts: 135
Reputation: 1,090

Post » Sun Feb 16, 2014 4:28 am

If you are trying to move all three objects to the same position every tick...then yes, technically speaking, the latter option should be the fastest.

You are unlikely to notice the difference though, even with many hundreds of objects.

As is often said: C2 has a tendency to slow down from graphics, not logic, though there are exceptions (bullet hell shooters, as I have discovered...)
Don't lose your work. Backup your game with Dropbox.
B
44
S
10
G
10
Posts: 1,106
Reputation: 9,202

Post » Sun Feb 16, 2014 4:39 am

Good to know. Thank you.
B
10
S
2
Posts: 135
Reputation: 1,090


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 43 guests