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.
Image
B
108
S
24
G
18
Posts: 1,373
Reputation: 22,824

Post » Thu Feb 16, 2012 11:50 pm

ImageImageImageImage
B
158
S
67
G
43
Posts: 2,603
Reputation: 35,968

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
156
S
53
G
17
Posts: 710
Reputation: 17,900

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
15
G
11
Posts: 632
Reputation: 13,325

Post » Fri Feb 17, 2012 3:16 pm

@Animmaniac I love your creature.
B
212
S
38
G
14
Posts: 136
Reputation: 30,555

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.
Image
B
108
S
24
G
18
Posts: 1,373
Reputation: 22,824

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
71
S
22
G
7
Posts: 827
Reputation: 10,177

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
101
S
22
G
12
Posts: 3,271
Reputation: 17,068

Previous

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 9 guests