Low FPS

This forum is currently in read-only mode.
  • Pairer plugin sounds really useful, would be cool if as well as loop each pair you could also have

    always: set turret X to pairer.X("sprite420")

    would always set turret X to the paired instance of sprite420's X

  • Yeah, or something to do with a parent/child relationship with sprite objects?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I dont think you completely understand, the condition loop

    Pair: Loop each

    Would repeat the actions for each parent, and select the spaceships and turrets accordingly. So if you have 600 spaceships and 1200 turrets, it would loop 600 times, selecting the turrets for the one selected spaceship.

  • I dont think you completely understand, the condition loop

    Pair: Loop each

    Would repeat the actions for each parent, and select the spaceships and turrets accordingly. So if you have 600 spaceships and 1200 turrets, it would loop 600 times, selecting the turrets for the one selected spaceship.

    So it's a bit like container, but editable in runtime and capable of having many instances of same object per a parent object. That sounds like what I was originally hoping for containers to be, when Scirra released the first public builds :D. Great!

  • I dont think you completely understand, the condition loop

    Pair: Loop each

    Would repeat the actions for each parent, and select the spaceships and turrets accordingly. So if you have 600 spaceships and 1200 turrets, it would loop 600 times, selecting the turrets for the one selected spaceship.

    I just mean so the pairer object would have all the expressions that a sprite does, but with a parameter for the other object.

    so if you have multiple instances of Sprite1 and Sprite2 paired with the pairer,

    when you have some instances of sprite1 picked in a condition, the expression " Pairer.X("Sprite2") " would give you the X of the sprite2.

    Much like if sprite1 and sprite2 were in a container if sprite1 was picked then sprite2.x would give the paired instance of sprite2's X.

  • 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

  • For now, see my example

    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

  • Sounds good David! Is this going to be something quite simple to make assuming it goes to plan? Or is it a complicated plugin?

  • 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

    did you try this?

    I made an example for you:

    http://www.quotecats.com/what/spaceshipturrets.cap

    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

  • 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

  • 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.

  • Was my example of any help?

    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...

  • 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.

  • Plugin should appear next build

  • Big bonus!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)