Construct 2 SDK - Advanced use

For developers using the Construct 2 Javascript SDK

Post » Thu Jan 19, 2012 3:11 am

@VampyricalCurse: With the built-in behavior, the way things are coded yes, it's better to stick to 8 points.

Ashley had to code the physics behavior so it can be widely used, in many cases.
He had to make decisions to manage this.

But Armitage said he wanted to develop his own plugin based on box2D. So after all, maybe a specific implementation may help raising the possible number.
A plugin specificaly coded for a game could handle only issues of said-game.

I think in theory that makes it possible.
Now to see it actualy done is yet to be seen.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 7,000
Reputation: 57,795

Post » Thu Jan 19, 2012 8:46 am

[QUOTE=Kyatric] @VampyricalCurse: With the built-in behavior, the way things are coded yes, it's better to stick to 8 points.

Ashley had to code the physics behavior so it can be widely used, in many cases.
He had to make decisions to manage this.

But Armitage said he wanted to develop his own plugin based on box2D. So after all, maybe a specific implementation may help raising the possible number.
A plugin specificaly coded for a game could handle only issues of said-game.

I think in theory that makes it possible.
Now to see it actualy done is yet to be seen.[/QUOTE]

I see, so I did misunderstand. So, in the case that I need a bit more than 8 points, how many points it's a bad idea?
B
47
S
10
G
6
Posts: 455
Reputation: 8,326

Post » Mon Jan 30, 2012 12:01 am

It really depends on the context of the contact point.

Let's make the distinction between the maximum collision pairs Box2d can handle and the maximum proxies (objects) you can spawn in a single world.
By default the only 8 limit number I remember to see in Box2d was the maximum number of polygon vertices a shape could have... Which is probably enough considering you can build complex object from many shapes.

If I do recall correctly the maximum default number of object you can spawn in box2d was 1024 but you can easily push this up to 2048 without any slowdown. That's what I did in my engine because I'm using the edge shapes that generate a lot of proxies. Actually if the physical engine is a key feature of your game you will easily reach that given limitation but since Box2d is only about processing data, it's not a real problem (you would probably have to focus way more on the rendering part).

The pair number is 8 * proxies by default. If you go over this default number, Box2D throw an exception (that I guess Construct 2 handle to avoid any crash ?).

Maybe the suggestion of 8 collisions point per objects comes from this factor ? That would simply mean that 1024 object can have safely up to 8 collisions points at the same times. Hopefully this will probably never happen !

The contact point is something you handle on your own, personally I store them in a pool and use them to process specific collision.
But trust me, there is many situation where an object will generate more than 8 collisions at time (for example 10 balls on the ground :).

So except if the Construct 2 Team did some weird optimizations in that area (why ?) you probably don't have to "count" the number of contact point your game will have to handle at max but rather know how many object can be displayed at the same times, if you really need that much and finally if you can group them in various Bit Mask to avoid as much as collision and awaken object in your simulation.
B
10
S
3
G
5
Posts: 14
Reputation: 3,344

Previous

Return to Javascript SDK

Who is online

Users browsing this forum: No registered users and 1 guest