How do I rotate behaviour and performance ?!

Get help using Construct 2

Post » Sun Jul 12, 2015 12:35 am

hi all,
i'm building small game wich contain one sprite with rotate behaviour
i just test it with / without this behaviour and i see that if it's enabled the game lagg and performance is bad
is there any way / solution about this problem ?
thanks in advance
B
46
S
16
G
8
Posts: 794
Reputation: 8,335

Post » Sun Jul 12, 2015 4:30 am

Check your projects configuration settings..........Is your "Use High-DPI Display" is Yes.., "Downscaling" is high quality...... and also check which physics engine is being used,,,
B
4
Posts: 13
Reputation: 226

Post » Sun Jul 12, 2015 6:00 am

high dpi is set to set yes (if i set to no the image quality is horrible)
downscaling is set to low quality
physics used is box2d asm

?
B
46
S
16
G
8
Posts: 794
Reputation: 8,335

Post » Sun Jul 12, 2015 7:00 am

Well, all the rotate behavior does is the same as a event like this:
Every tick: sprite: rotate clockwise speed*dt

With just one object, there isn't much you can do to make it faster.
How is the performance bad?
If you're getting a low framerate then you might have a blacklisted graphics card. If you can update your driver it may help.

If instead you're getting a rotation that's not buttery smooth, then it's a current browser issue. You can have lots of sprites/events/behaviors or very few and it doesn't affect that. Chrome supposedly has a fix coming in a newer version, but other than that other browsers have varying degrees of stutter. Once one solves it well I'm sure the others will follow suit.
B
92
S
32
G
109
Posts: 5,291
Reputation: 70,993

Post » Sun Jul 12, 2015 9:05 am

i'm developping on mobile phone
i just try every 0.017 set angle to self.angle+10*60*dt
it's better than before ... but still some times lag
B
46
S
16
G
8
Posts: 794
Reputation: 8,335

Post » Sun Jul 12, 2015 9:29 am

matrixreal wrote:i'm developping on mobile phone
i just try every 0.017 set angle to self.angle+10*60*dt
it's better than before ... but still some times lag


Not sure why you'd use dt inside the "every x seconds"-event
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sun Jul 12, 2015 9:36 am

LittleStain wrote:
matrixreal wrote:i'm developping on mobile phone
i just try every 0.017 set angle to self.angle+10*60*dt
it's better than before ... but still some times lag


Not sure why you'd use dt inside the "every x seconds"-event


i always use it like that
is it bad ?
B
46
S
16
G
8
Posts: 794
Reputation: 8,335

Post » Sun Jul 12, 2015 9:44 am

matrixreal wrote:
LittleStain wrote:
matrixreal wrote:i'm developping on mobile phone
i just try every 0.017 set angle to self.angle+10*60*dt
it's better than before ... but still some times lag


Not sure why you'd use dt inside the "every x seconds"-event


i always use it like that
is it bad ?


Not sure if it has any effect, positive or negative, but seems illogical..
Every x seconds is framerate independant as far as I can see, why re-add framerate to it?
But then again, maybe it's one of those things outside of my knowledge..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sun Jul 12, 2015 10:55 am

Every 0.017 seconds and lower is the same as "every tick". So dt can make sense there.
All every x seconds does is check the time since it last ran, then if it's >=x it runs.

The rotate behavior and doing it with events should be identical for performance. Actually the behaviors often should perform better.
B
92
S
32
G
109
Posts: 5,291
Reputation: 70,993

Post » Sun Jul 12, 2015 6:13 pm

R0J0hound wrote:Every 0.017 seconds and lower is the same as "every tick". So dt can make sense there.
All every x seconds does is check the time since it last ran, then if it's >=x it runs.

The rotate behavior and doing it with events should be identical for performance. Actually the behaviors often should perform better.


what you suggest to me please ?
B
46
S
16
G
8
Posts: 794
Reputation: 8,335

Next

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 34 guests