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
B
93
S
20
G
14
Posts: 1,218
Reputation: 19,500

Post » Thu Feb 16, 2012 11:50 pm

ImageImageImageImage
B
140
S
58
G
36
Posts: 2,547
Reputation: 31,170

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
129
S
45
G
15
Posts: 705
Reputation: 15,413

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
13
G
10
Posts: 632
Reputation: 12,515

Post » Fri Feb 17, 2012 3:16 pm

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

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
B
93
S
20
G
14
Posts: 1,218
Reputation: 19,500

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
61
S
19
G
6
Posts: 809
Reputation: 9,028

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
88
S
21
G
12
Posts: 3,240
Reputation: 16,486

Previous

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 17 guests