Does setting position to platformer everytick slow down CPU?

Get help using Construct 2

Post » Sun Feb 01, 2015 2:31 am

Not a how to, but just a simple question.

I seem to enjoy setting a ton of sprites to my platformers location every tick for various reasons, but I'm not sure if it slows down the game on other computers or mobile.

Example: I like having a weapon, hat, gun, particles etc.... all on my platformer for ever tick.. would this every become an issue?
B
12
S
4
G
2
Posts: 132
Reputation: 1,749

Post » Sun Feb 01, 2015 2:36 am

Interested in this question too. Thanks for asking.
B
5
Posts: 38
Reputation: 301

Post » Mon Feb 02, 2015 10:16 pm

Same here.
B
11
S
3
G
3
Posts: 206
Reputation: 2,379

Post » Mon Feb 02, 2015 10:49 pm

The golden rule: measure it. If you can't measure a difference, no. If you can, yes.
Scirra Founder
B
398
S
236
G
88
Posts: 24,433
Reputation: 194,635

Post » Tue Feb 03, 2015 1:24 am

Wouldn't it be less intensive to just pin them?
B
20
S
8
G
4
Posts: 195
Reputation: 3,555

Post » Tue Feb 03, 2015 5:35 am

when you say "platformer" you mean "player" or "player character"?
B
33
S
9
G
1
Posts: 156
Reputation: 3,034

Post » Tue Feb 03, 2015 6:34 am

@eliasfrost It's not precisely the same thing? From my experience, pinning seems to result in some dithering/jagging. This is very notable if you have one visible sprite pinned to another, as in viewtopic.php?f=147&t=122530
It also occurs in my current game, where the edge detector for an NPC is pinned, resulting in some erratic movement. Thankfully, I like that bit of semi-randomness.
B
11
S
4
Posts: 152
Reputation: 1,236

Post » Tue Feb 03, 2015 1:22 pm

It's an issue that has to do with pixel rounding, the .capx that was provided in the thread you linked had pixel rounding on, which disallow objects to be drawn between pixels hence why it stutters. Toggle pixel rounding off and the problem is fixed.

I used the .capx in your mention and did some quick monitoring with pinning vs positioning every tick. Pinning the object resulted in a cpu usage of 1-3% while positioning every tick gave me a stable 4%, sometimes 5%.
B
20
S
8
G
4
Posts: 195
Reputation: 3,555


Return to How do I....?

Who is online

Users browsing this forum: Apollo14 and 25 guests