Relating to Instances and Actives

For questions about using Classic.

Post » Sun Mar 15, 2009 10:32 pm

How does Construct tell the difference between instances of an active?

Is it just like TGF's rather poor method of using Spread Values and the collide with another object semi-automatic way that you must design your whole code around (depending upon the use) or does it have several or at least one better method?

I'm also curious about the active limit. I remember reading something somewhere saying that Construct has an unlimited amount of actives available and without any slow-down, is this true?
If it is, then that means Instances are less needed, and if I wanted to, I could just code the whole game according to each seperate active object, using as many as I need to, correct?
B
2
G
4
Posts: 17
Reputation: 1,084

Post » Sun Mar 15, 2009 11:16 pm

[quote="MBK":1ol6augh]active[/quote:1ol6augh]
Sprite.

Construct tells them apart by using conditions to filter only the instances that met the event.

[quote:1ol6augh]Is it just like TGF's rather poor method of using Spread Values[/quote:1ol6augh]
You rarely, if ever, need to use spread values in Construct - have a look at the 'For Each Object' condition.

[quote:1ol6augh]collide with another object semi-automatic way that you must design your whole code around[/quote:1ol6augh]
I don't understand this, what's the specific problem you are talking about? Hazarding a guess, you might be interested in the advanced collision system condition, which allows you to choose which objects involved in the collision get picked in the event.

[quote:1ol6augh]I remember reading something somewhere saying that Construct has an unlimited amount of actives available and without any slow-down, is this true?[/quote:1ol6augh]
It's true that Construct supports an unlimited number of sprites, and you don't need to specify any limit. However, if you're drawing them all on the screen, there will of course be a slowdown. Construct isn't magic, if you have twice as many objects, it'll probably take twice as long to draw them all! We've worked hard to try and make it as fast as possible, though.

[quote:1ol6augh]if I wanted to, I could just code the whole game according to each seperate active object, using as many as I need to, correct?[/quote:1ol6augh]
I don't really understand... you want to code each instance separately? I wouldn't advise that. The best way to go is to use ordinary objects, use Families to group together the related ones (like Friendly and Enemy), and code your events around the families. You can use event sheet includes to have your family events affect the entire game, and it saves you repeating events.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,580

Post » Mon Mar 16, 2009 2:52 am

[quote:footjzyp]I remember reading something somewhere saying that Construct has an unlimited amount of actives available and without any slow-down, is this true?[/quote:footjzyp]

Depending on what graphics card you have, and what you're doing with the sprites, you could have several hundred sprites moving around on the screen without any slowdown.

Physics will slow things down with hundreds of objects colliding at once, because it's mathematically CPU intensive. As will calculating collision between normal sprites several hundred times per tick (as in with a loop).

Heavy use of shaders, motion blur, large amounts of particles, etc. will cause slowdown on some graphics cards because they're very GPU intensive. The Plasma object will as well for some people. Be frugal with your effects. Try to fake it as much as you can by creating effects on your sprites before importing them into Construct whenever you're able to.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 9 guests