How to create a fake collision?

Get help using Construct 2

Post » Mon Feb 18, 2013 3:43 am

Hi pals!

For some reason to save performance for mobiles if we use a lot of objects using collision checks could affect the peformance for browser and CocoonJS.

When we disable collision for sprites, but how to make a fake collision using special workarounds?


Thanks!
B
95
S
25
G
20
Posts: 3,052
Reputation: 22,613

Post » Mon Feb 18, 2013 4:00 am

Invisible sprites takes so mush out of the performance?
ImageImageImageImage
B
140
S
58
G
36
Posts: 2,547
Reputation: 31,170

Post » Mon Feb 18, 2013 4:22 am

@shinkan According to Ashley, invisible sprites don't change the performance, they are basically registered objects in memory. They don't take rendering time.

I doubt if the collisions are part of logic performance, not rendering.
B
95
S
25
G
20
Posts: 3,052
Reputation: 22,613

Post » Mon Feb 18, 2013 4:34 am

Yes that's true, they don't take rendering time.
How many and what kind of collisions do you need?
ImageImageImageImage
B
140
S
58
G
36
Posts: 2,547
Reputation: 31,170

Post » Mon Feb 18, 2013 4:39 am

@shinkan

Im making a puzzle game more like diamond dash.




The problem is affecting the performance due to many collisions in CocoonJS, they told me CocoonJS is not a javascript performance booster, just another rendering performance.


Here is my .capx http://dl.dropbox.com/u/76227787/FallingBlocksPerformance.capx

They told me do not use collision, unless should have each block have state if position is changed, then do fall without collision. I have no idea how it works.
B
95
S
25
G
20
Posts: 3,052
Reputation: 22,613

Post » Mon Feb 18, 2013 4:54 am

Maybe try to approach this from diffrent angle.
What if You could save x an y position of every box on screen to array. Then if you destroy one box you can pinpoint correct position of that object - row and column - in array, and move all boxes above in same column down by heigh of destroyed box.

Is that make any sens? I'm not good in that kind of games, so it's just my theory.

Edit: That way you could do that without any collison checks - I think?shinkan2013-02-18 04:54:59
ImageImageImageImage
B
140
S
58
G
36
Posts: 2,547
Reputation: 31,170

Post » Mon Feb 18, 2013 5:09 am

@shinkan i tried to make one using array with row and column between positions but when spawn blocks from above after of one or more than two blocks are destroyed, it didn't work, i've spent 4 days without solution :S
B
95
S
25
G
20
Posts: 3,052
Reputation: 22,613

Post » Mon Feb 18, 2013 9:01 am

Bump, because i haven't received a help since 1 week ago
B
95
S
25
G
20
Posts: 3,052
Reputation: 22,613

Post » Mon Feb 18, 2013 10:10 am

What about a simpler approach?...
By this I mean
only checking for collisions when the block is actually falling...
Or
Checking only once a block has fallen and come to rest...
Checked by a instance variable?

This would radically cut down on the number of collision checks...

As far as I can tell anyway....
:-)
Worth a test...
When in doubt..or you are lost in a Zombie apocalypse or someone is giving you a hard time..Remember one thing..... Read the Construct 2 Manual..it will save your life.:)
B
29
S
11
G
8
Posts: 307
Reputation: 7,323

Post » Mon Feb 18, 2013 10:14 am

@mystazsea

It was useless, i've tested it before, these block fall to out of layout.
B
95
S
25
G
20
Posts: 3,052
Reputation: 22,613

Next

Return to How do I....?

Who is online

Users browsing this forum: CavalierBubble, Evanetot and 24 guests