Bullet movement vs coding movement

Discussion and feedback on Construct 2

Post » Wed Jan 29, 2014 8:17 pm

I'm building a game based on the flying template built into Construct 2 and I want to export it to CocoonJS.

Does anyone know what is the difference in performance using the bullet behavior to move sprites across the screen versus creating the movement through actions (i.e. every tick, move X + 5 pixels)?

Many thanks!
B
3
Posts: 3
Reputation: 181

Post » Wed Jan 29, 2014 9:34 pm

It may depend (I'm not sure) on the size of the sprite, the animation, ...
Anyway, best way to know is to try both, and look in the debugger the difference in performance (CPU usage).
B
17
S
8
G
4
Posts: 473
Reputation: 6,191

Post » Wed Jan 29, 2014 10:36 pm

I was just curious if someone had a definitive answer based on their experience. I agree - I'll probably run a test with a bunch of sprites and compare them. Thank you Guizmus.
B
3
Posts: 3
Reputation: 181

Post » Wed Jan 29, 2014 10:45 pm

Bullet behavior uses Delta time to determine number of pixels moved per tick, resulting in a constant speed in fluctuating framerate conditions

So depending on your game you have to decide if you want smooth looking or accurate per pixel positioning...

As long as I can move left, right and fire, I'm Happy...
B
42
S
15
G
11
Posts: 655
Reputation: 12,260

Post » Wed Jan 29, 2014 11:16 pm

To clarify, the code to produce the movement in this case will also be based upon delta time.
B
3
Posts: 3
Reputation: 181

Post » Wed Jan 29, 2014 11:24 pm

No performance difference if you code the movement well. If you overload it with superflous math of course performance will go down. Other wise there is no difference.
B
90
S
18
G
9
Posts: 2,455
Reputation: 15,028

Post » Wed Jan 29, 2014 11:29 pm

I have tested this when I started, Bullet Movement is very efficient, it hardly stresses the CPU at all so its my go to for any sort of movement.

You could even simulate physics with it, using on collision + random(Angle of Motion) to simulate two objects colliding and bouncing off each other, add in "Set Gravity" and "Set Speed" variables and you get realistic mid-air collisions of objects, falling into the ground. It's something to think about until CocoonJS start to properly accelerate box2d/native, which at the moment it struggles at.
B
70
S
24
G
19
Posts: 1,757
Reputation: 17,614

Post » Wed Jan 29, 2014 11:48 pm

i wonder how it compares to the moveto plugin
B
63
S
12
G
6
Posts: 456
Reputation: 8,981

Post » Thu Jan 30, 2014 8:23 am

[QUOTE=Pixel perfick] Bullet behavior uses Delta time to determine number of pixels moved per tick, resulting in a constant speed in fluctuating framerate conditions

[/QUOTE]

Is collision detection continuous or there is the possibility that when FPS is low the object "passes through walls"?
B
7
S
1
G
4
Posts: 16
Reputation: 1,332

Post » Thu Jan 30, 2014 11:58 am

Only a beginner with CS2 myself, but after trials I decided to run with bullet speed for this endeavour. It was more convenient to use by far.

"https://dl.dropboxusercontent.com/u/32755330/Splodged%20v1.05/index.html"

Admittedly my coding for every x seconds to take objects current Y position, add the rate of descent, then set the new Y position, did not use the (dt) command, so it was rather jittery.
B
13
S
3
G
1
Posts: 16
Reputation: 1,499

Next

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 16 guests