REQUEST: Curves in collission polygons

Discussion and feedback on Construct 2

Post » Thu Feb 16, 2012 11:41 pm

[QUOTE=Kiyoshi] This. Multiple shape collision would be a great addition. The problem would be not only handling the multiple collision cases between rectangle, polygon and circle, but too many shapes on a sprite would would drop performance. Still a very welcome feature :D[/QUOTE]

As I said, you can, simple do invisible sprites, then pin them on the point where you want that area checked.
ImageImageImageImageImageImage
Image
B
98
S
22
G
16
Posts: 1,338
Reputation: 21,202

Post » Thu Feb 16, 2012 11:50 pm

ImageImageImageImage
B
155
S
61
G
41
Posts: 2,577
Reputation: 34,314

Post » Fri Feb 17, 2012 12:54 am

[QUOTE=TELLES0808] As I said, you can, simple do invisible sprites, then pin them on the point where you want that area checked.[/QUOTE] Yes it's doable to some extent (without circle collision support obviously), but it becomes a nightmare to manage if your sprite has animations. You need to create an entire new system through events to support animating the collisions.

And @Kiyoshi, actually you only need to add collision test between circle and polygon, since the other primitives like square and triangle are also polygons. I don't know about performance, but it surely would help cover some shapes uncoverable by a single collision polygon.
Scirra Employee
B
140
S
49
G
17
Posts: 708
Reputation: 17,094

Post » Fri Feb 17, 2012 1:44 am

Rectangles should be treated differently than polygons depending if they're rotated or not. If they aren't you can just do the simple check:

rect.Left <= other.Right AND
rect.Top <= other.Bottom AND
rect.Right >= other.Left AND
rect.Bottom >= other.Top;

But if they're rotated the check is much more expensive. That's why rectangles can't be treated as polygons at least at engine side.
B
58
S
14
G
10
Posts: 632
Reputation: 12,705

Post » Fri Feb 17, 2012 3:16 pm

@Animmaniac I love your creature.
B
207
S
37
G
13
Posts: 136
Reputation: 29,897

Post » Fri Feb 17, 2012 3:34 pm

Gamesalad has a circle collision option. There must be a way to do it. Also it is needed for any top down games with a player and solid walls(like my game Maze Manor ). If the player does not have a circle collision shape it will get stuck facing the wall at what ever angle you touched the wall and will not rotate until you back off the wall. This is a problem say if you walk up to a wall then go to the right the player will walk right while facing up. I've corrected alot of this with placing a specific collision shape on my player, but it still happens at certain angles.
B
8
S
3
G
2
Posts: 107
Reputation: 2,219

Post » Fri Feb 17, 2012 3:41 pm

[QUOTE=Bert] Gamesalad has a circle collision option. There must be a way to do it. Also it is needed for any top down games with a player and solid walls(like my game Maze Manor ). If the player does not have a circle collision shape it will get stuck facing the wall at what ever angle you touched the wall and will not rotate until you back off the wall. This is a problem say if you walk up to a wall then go to the right the player will walk right while facing up. I've corrected alot of this with placing a specific collision shape on my player, but it still happens at certain angles. [/QUOTE]

I see, this is a real problem.

I was trying to reproduce a top-down RPG, like zelda, but stopped after the Z ordering problem. Anyway, doing a octagonal polygon will decrease drastically the performance of you game, this is what I concluded after trying.

Oh, and to setup the lines, I saved the project on a folder and written the polygon code inside the XML, because setting it visually give you a bad triangulation.
ImageImageImageImageImageImage
Image
B
98
S
22
G
16
Posts: 1,338
Reputation: 21,202

Post » Fri Feb 17, 2012 5:40 pm

on collision polygon for physics there is an option for circle collision, but if your object is multiframes with different shapes, every frame should have this option, i hope this is on the todolist
ImageImage
B
65
S
19
G
7
Posts: 814
Reputation: 9,691

Post » Sat Feb 18, 2012 5:39 am

spriter will eventually have a c2 plugin, and it allows multiple nameable collision boxes that can be animated along with the character, and can be checked either generally, or by name
Spriter Dev
B
96
S
21
G
12
Posts: 3,256
Reputation: 16,813

Previous

Return to Construct 2 General

Who is online

Users browsing this forum: SnipG, yme and 5 guests