Two questions

Discussion and feedback on Construct 2

Post » Sat Jan 12, 2013 12:38 am

1. Is collision of objects based on brute force or is this a more complicated method(binary or qaud tree)

2. When creating image objects and based on how graphics memory works. Should my images be based on 0 or 1 starting size count.
Should I be using 7,15,31,63... or should I use 8,16,32,64.... for my steps of 2.
B
87
S
18
G
9
Posts: 2,455
Reputation: 14,834

Post » Sat Jan 12, 2013 12:52 am

1.
Collision of objects is when an object is inside another object
(hitbox within hitbox)

2.
I don't think that you will need to do this unless you know you need to remove a small amount of data or need to reduce lag
(Steps of 2 is binary which is 1,2,4,8,16 and so on..)TheNormalGeek2013-01-12 00:53:17
(\__/)
(='.'=)
(")_(")
B
20
S
9
G
1
Posts: 68
Reputation: 3,057

Post » Sat Jan 12, 2013 1:14 am

1. Objects are ignored if their bounding boxes are not overlapping which is an almost instant test, so collisions do not generally cause any framerate impact.

2. You don't need to worry about this for Sprites. For Tiled Backgrounds it helps them tile seamlessly, and they need to be exact powers of two (e.g. 16, 32, 64...)
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,580

Post » Sat Jan 12, 2013 2:21 am

[QUOTE=Ashley] 1. Objects are ignored if their bounding boxes are not overlapping which is an almost instant test, so collisions do not generally cause any framerate impact.

2. You don't need to worry about this for Sprites. For Tiled Backgrounds it helps them tile seamlessly, and they need to be exact powers of two (e.g. 16, 32, 64...)[/QUOTE]

ok, so if I have 500 sprites and I'm colliding them on other 2 objects. There is no slowdown for collision checking. The reason I'm asking is because my game is about creating 1 more object on every touch. So the objective is just lots'f of objects. I've put a cap on it to not crash the system, but I'm wondering once it starts hitting 200+ it will slow down even if they aren't activly colliding, but just need to constantly check for collision.

I'm refering to this article and the section
"Technical limitations
Due to the way graphics processors work, images are usually actually held in memory in a power-of-two size (e.g. 128x128, 256x256, 512x512, etc). For example a 150x150 image will have to be placed on a 256x256 surface, with the rest of the pixels transparent. Notice that means it uses a lot more memory: out of the whole 256x256 area, only about a third of the pixels are actually used for the image. The other two-thirds is simply wasted, but still sit there taking up memory! If you have a long animation with 150x150 frames, it can end up wasting several megabytes of memory - and just for one animation."


but if there are no concerns about it. then i'm fine with it :) as at this time i've been setting all my sprite sizes to the power of 2, just not sure if I needed to set for a 0/1 as the base count size.
B
87
S
18
G
9
Posts: 2,455
Reputation: 14,834


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 18 guests