Collision Mesh Generator

New releases and general discussions.

Post » Sun Aug 23, 2009 7:47 pm

It'd be really cool to have a feature in Construct where we could take a sprite and let Construct generate its own collision mesh - just like refining selections in Photoshop (CS3 and newer). It'd take the sprite, analyze it and simplify it and then Construct should be able to store each collision mesh as a subobject directly in the sprite.

It's quite a nuisance and create collision sprites for the more complicated spriteshapes. An internal, procedrual solution would save ram and time.

Just a thought :)
B
6
S
2
G
3
Posts: 520
Reputation: 2,690

Post » Sun Aug 23, 2009 9:48 pm

Do you mean you simply want a quicker way to have a different collision mask for a sprite, or do you want a new collision engine (ie. current is pixel-perfect, it sounds like you want a vertex-based polygon collision detector), or both?
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Sun Aug 23, 2009 11:08 pm

I don't know, whatever works best and smoothly with Constructs behaviors. The current problem is that for high res art that isn't blocky, you'll need to come up with lots and lots of collision tiles that you'll have to paint manually, cause the sprites can be a bit more complicated - which takes up a LOT of time.

So the idea is that Construct would analyze the sprite shape and generate a simplified version by itself.

The current per pixel implementation is a bit 'too perfect' - which means that it detects every little variation in the sprite - it there's a 1 pixel dot standing out, the playerSprite with platform behavior will often come to a complete halt when it collides with the pixel. So you have to do it manually and make sure that everything is perfect.

So the optimal implementation would be like a channel that you could turn on in the sprite editor and then change the collision mesh of a sprite with a couple of sliders - like changing how much it simplifies the shape, offset it so that it looks like the player sprite would slightly stand inside of the sprite, etc. - just a procedural way to create a collision mesh / sprite for our tiles.
B
6
S
2
G
3
Posts: 520
Reputation: 2,690

Post » Mon Aug 24, 2009 12:08 am

Are you talking about the platform behavior getting stuck on parts of ground tiles? I get around that by using a few invisible simplified sprites for the actual platforms/ground that can be made into more complex shapes quickly by dragging around and pressing enter. It works for the games I'm making, but I don't need the player's platform object to follow the ground sprites exactly, so I don't know if it would work for you.
Moderator
B
88
S
32
G
33
Posts: 3,005
Reputation: 27,432

Post » Mon Aug 24, 2009 1:31 am

I think what he means is some sort of interpolation of the sprite.
Like this:


Its fairly easy to do via levels in Photoshop, or Gimp. In fact I already have a script that does it for me.
Image Image
B
161
S
48
G
90
Posts: 7,356
Reputation: 66,767

Post » Mon Aug 24, 2009 1:59 am

[quote="newt":3bziwpw7]I think what he means is some sort of interpolation of the sprite.
Like this:


Its fairly easy to do via levels in Photoshop, or Gimp. In fact I already have a script that does it for me.[/quote:3bziwpw7]

What he said.
B
6
S
2
G
3
Posts: 520
Reputation: 2,690

Post » Mon Aug 24, 2009 6:09 am

I don't think stuff like that is too simple
but while we're at it
a less rounded, more polygonal version for custom physics masks would be cool too
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Fri Aug 28, 2009 10:35 pm

So it would be actually just a separate collision mask which you'd import from an image?
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Sat Aug 29, 2009 8:10 am

The whole idea would be that Construct would create this procedurally the moment you import the sprite - so that we don't have to paint collision masks for every single tile manually.

Currently I use a solid block and a sphere for standard collisions, but for custom stuff like hills, slopes, etc. - it can be a pain to do everything twice if an algorithm could take over that job.

The actual creation of the mask isn't even that bad, but importing everything twice and lining things up, stacking them, hiding them, setting attributes... that can be a lot of work.
B
6
S
2
G
3
Posts: 520
Reputation: 2,690

Post » Sat Aug 29, 2009 9:49 am

http://www.youtube.com/watch?v=5H4KHhJs3ss
http://www.youtube.com/watch?v=y9vs494u4Ik

If you mean having a separate image for a collision mask as for the visual display, these 2 videos show a way of having a separate collision mask for an image. I've been too busy to impliment it properly in and easy and logical way for the picture editor...but at least it can be done :P
B
4
S
2
G
5
Posts: 641
Reputation: 3,011

Next

Return to Construct Classic Discussion

Who is online

Users browsing this forum: No registered users and 2 guests