Low FPS

New releases and general discussions.

Post » Mon Sep 29, 2008 11:52 am

Ok i am getting a little confused now :) Thanks for all the comments on this though guys.

Can we just consolidate all the info in this thread? I'm a little confused.

What is the fastest way possible of having child objects belong to a parent object and have options to make them stick together In THEORY (When on screen/when ScrollXright > xpos > ScrollxLeft etc.etc.)?

Is this theory possible to do in construct currently, eg. is constructs looping/picking system capable of doing this. If not, should this feature be added? If so, can this just be whipped up and put in the next build, or are we talking a while?

I don't know how construct is written (I don't know c++, i have alot of respect for you guys!), so I'm sort of looking for Ashley/Rich/David's final word on these ideas, as they know exactly how realistic my humble requests are.

Thanks for reading that mini essay!
-Alex
B
2
S
2
G
5
Posts: 448
Reputation: 2,546

Post » Mon Sep 29, 2008 12:25 pm

For now, see my example

viewtopic.php?f=16&t=1737

However, I'm currently designing a pairer plugin that will be heaps faster because it will have direct pointers to objects, so instead of 360000 it will just be 600 iterations...if it works of course :P
B
4
S
2
G
5
Posts: 641
Reputation: 3,011

Post » Mon Sep 29, 2008 1:37 pm

Sounds good David! Is this going to be something quite simple to make assuming it goes to plan? Or is it a complicated plugin?
B
2
S
2
G
5
Posts: 448
Reputation: 2,546

Post » Mon Sep 29, 2008 2:22 pm

[quote="faggatron":cg6x4bap]
Surely you only need one for each loop there, are you using a compare in the system object instead of a compare private variable on the sprite?

so you'd have:
for each ship:
Turret value 'UIDofparent' = Ships.UID
[/quote:cg6x4bap]
did you try this?
I made an example for you:
[url:cg6x4bap]http://www.quotecats.com/what/spaceshipturrets.cap[/url:cg6x4bap]
It only uses one for each object loop to set the positions, so it'd be 600 iterations.

EDIT: in fact when you make it create 600 ships its ultra laggy :x
B
2
S
2
G
5
Posts: 236
Reputation: 2,122

Post » Mon Sep 29, 2008 7:45 pm

Thanks for the example there. I thinks thats essentially what i've already got (I mean, you did suggest some stuff that i changed earlier and now the code is essentially the same as yours. I'll check that when im next doing some coding). It does seem a little slow at 600 ships though don't ya think ;)
B
2
S
2
G
5
Posts: 448
Reputation: 2,546

Post » Mon Sep 29, 2008 8:48 pm

Yeah sorry that example won't really help you if the code is the same, I kindof assumed the lag was all down to 360000 iterations, not actually testing it at 600. Turns out it's still laggy at that many. :oops:
B
2
S
2
G
5
Posts: 236
Reputation: 2,122

Post » Tue Sep 30, 2008 1:22 am

Was my example of any help?


viewtopic.php?f=16&t=1737

It has 600 spaceships and 1200 turrets (approx) and runs at 300 fps... assuming only a couple of spaceships are on the screen at once...
B
4
S
2
G
5
Posts: 641
Reputation: 3,011

Post » Tue Sep 30, 2008 4:36 pm

It is certainly of help yeah. I'll definately use that - Thanks!
But If its possible to optimize the matching of sprites together at all it would be a big bonus.
B
2
S
2
G
5
Posts: 448
Reputation: 2,546

Post » Tue Sep 30, 2008 5:22 pm

Plugin should appear next build :)
B
4
S
2
G
5
Posts: 641
Reputation: 3,011

Post » Tue Sep 30, 2008 10:16 pm

Big bonus! :D
B
2
S
2
G
5
Posts: 448
Reputation: 2,546

PreviousNext

Return to Construct Classic Discussion

Who is online

Users browsing this forum: No registered users and 0 guests