How do I Create Physics Structures

Get help using Construct 2

Post » Wed Nov 11, 2015 5:51 pm

@CrudeMik
I had a quick go at making a lattice structure like in your first image using both the stock physics & chipmunk behaviors. It's possible to joint everything together, but once you apply a force to the structure the physics starts madly shaking. This was jointing everything to a central sprite, all sprites not colliding.

You could try a more triangulated jointing between the components, that might help, but I've got a feeling that these massive linkages will never work.

Maybe they could be non-colliding things in the background, with selected areas that you can dock with, or have a single collision polygon with all the structure sprites pinned to it?
B
27
S
12
G
1
Posts: 157
Reputation: 3,359

Post » Wed Nov 11, 2015 10:54 pm

This is a situation where joints wouldn't really cut it. The box2d and chipmunk libraries let you attach multiple shapes onto the same physics object, which is like a perfectly rigid joint. The only work needed is calculating the center of mass and inertia of the object as shapes are added/removed.

It's probably easier to to do by accessing the js libraries themselves to do it rather than using the behaviors. Not to mention it would give more control.
B
94
S
33
G
114
Posts: 5,357
Reputation: 73,775

Post » Thu Nov 12, 2015 9:42 am

@mattb - Thanks for having a crack at it Matt, not sure I get what you mean by the single collision polygon method?

@R0J0hound - I see what you're saying, however this is something I've never attempted and wouldn't really know where to start with the JS libraries.
B
44
S
13
G
8
Posts: 622
Reputation: 7,417

Post » Thu Nov 12, 2015 12:25 pm

I meant you just have everything pinned to one big collision poly (either built manually or using some setup that generates a collision hull for the polygon plugin).

Something that physics sims are really good for in random 'dungeon' generation is spacing out a bunch of rooms. Spawn a cluster of shapes & run the simulation for a while:

Image
B
27
S
12
G
1
Posts: 157
Reputation: 3,359

Previous

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 17 guests