Geometric Primitives vs. Sprites

Discussion and feedback on Construct 2

Post » Mon Apr 02, 2012 12:23 am

Im just wondering why Construct 2 isn't implemented Geometric Primitives object which is designed to create helper objects like solid boxes to place below from 30 sprites of different buldings what don't require to create 30 events to make collision between buildings and player, it's just one event for geometric primitive to place below the buildings.

I've seen HTML5 Canvas is capable to draw rectangles, lines, dots, filling colors, etc. without using the sprites to make helper objects. Do they cause performance issues than sprites? i'm just wondering.

I think sprites require to use primitive images like blue box to create helper objects is really unnecessary because it's useless to have more bytes in images folder.

Also check some cool dynamic primitives except Mona's images
http://paperjs.org/examples/
B
95
S
25
G
20
Posts: 3,052
Reputation: 22,613

Post » Mon Apr 02, 2012 5:47 am

Why not have an invisible tiled background object set to solid? C2 allows rotation, stretching, resizing, etc and you can make the base image that makes up the tiled background as small as you want--2x2 pixels even. Just block out what you want solid with that and have a single event that makes the object invisible on runtime (start of layout -> make invisible). Heck, put that invisible event on the main event sheet that you might be including on all layouts and you have about no effort involved.

Unless there's something more specific you're trying to do.
B
90
S
32
G
14
Posts: 935
Reputation: 14,540

Post » Mon Apr 02, 2012 6:06 am

I exactly did this method as you posted...

It makes me wonder why it doesn't include to draw geometric primitives, i still need to know the reasons.
B
95
S
25
G
20
Posts: 3,052
Reputation: 22,613

Post » Mon Apr 02, 2012 2:55 pm

We've had geometric primitives, lines etc. on the todo list for a while. But it's almost identical to just pasting in an image to a sprite and using that. So it's not really a high priority.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,468

Post » Mon Apr 02, 2012 6:01 pm

@Ashley... But don't sprites try to keep track of lots of things? Or have you optimized them so that the performance is only marginally worse than primitives?
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,390

Post » Mon Apr 02, 2012 6:38 pm

@sqiddster single-frame sprites are already optimised to be equivalent to what a geometric shape object would have to handle.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,468

Post » Mon Apr 02, 2012 7:09 pm

I have this habbit of deleting all my non collisionsprites masks in to a three pointed colllison masks. Does this improve the performance?
Or what if I would have 100-points collision mask, but never use the collision in it?
B
40
S
5
G
5
Posts: 405
Reputation: 5,657

Post » Mon Apr 02, 2012 10:12 pm

Very impressive, Ashley ;)
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,390

Post » Tue Apr 03, 2012 3:24 pm

@nemo - not testing collisions means the collision mask is ignored completely so you don't need to worry about the collision mask at all. Also before the collision mask is actually used it does a bounding-box test followed by a bounding quad test (effectively a 4-point mask), so whether that's followed by a 3 or 4 point collision mask really doesn't matter, it already just did a 4 point one.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,468


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 7 guests