alee's Forum Posts

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

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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

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

  • 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

  • Ashley, you are the man.

    As described by a friend of mine "Construct is mean!"

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

  • Deadeye, will that method save processing time? What i mean is, do you think containers are so much faster that having some invisible objects will still be faster that using the current method? I'd probably only have a maximum of 5 turrets per ship so it could work. Does this mean i have to make different objects for each of those 5 turrets? Or can i multiple instances?

    Also, i got rid of a bunch of the For Each conditions and the code is now more efficient with it still working, however its still HELLA slow After creating 40 ships, it drops from 200FPS to 40FPS. (Better than the 30fps i had before).

    Can i do better in optimization? Are containers faster? I would have hoped I wouldn't get any FPS drop from this...

  • Can i still use containers when its uncertain how many turrets are wanting to be created and stuck to the ship at different points?

    eg. 1 ship may have 3 turrets, and 4 thrusters

  • Looks sweet dude!

  • Haha!

  • [quote:1xzwe4yr]Yes - nested loops can be very CPU intensive. If you have 600 Ships and 600 Turrets and you do:

    + For Each Ship

    + For Each Turret

    -> Actions

    You are requiring that the actions are run 600 x 600 times, which is 360,000 times (over a third of a million). Repeat this a few times and you're asking the CPU to run millions of iterations!

    Only do loops like that if it is absolutely necessary. What are you doing that requires that code? Often, there are much more efficient solutions.

    Yeah this is the problem... I disabled the group that had this code in and it run like a dream now. But i'm not sure how to do it without "For Each".

    Basically, Each ship has multiple turrets that are meant to "stick" to its action points. They also have multiple thrusters that stick to the action points. How can i make all the ships have the correct turret and thrusters stuck to their ship?

    So bascially, theres a buch of ship objects, a bunch of turret objects, and a bunch of thruster particle objects. Currently i'm saying for each turret, for each ship, if the UIDofparent value of turret is = to Ships.UID, then set X,Y accordingly.

    Please tell me there is a better way

  • Hi there,

    I'm getting low FPS on my game when the object amount reaches around 600. This Is unacceptable really as Its going to go alot higher than that. I'm wondering what procedures i should follow to find out what is causing this high FPS and cut it down.

    I made my sprites under half size, but it seems to not make any difference. In The task manager, it is using 100% of CPU resources, leading me to believe its not a graphics card bottleneck, but a CPU one. Leading me to believe its something in the way i've coded it.

    • Alot of my variables go into an unnecessary amount of floating point digits (i only really need it to 2 decimal places or maybe even 1) Is there a way to set variables to have a maximum amount of DPs?
    • Alot of For eachs.. In some events i have for each object "Ship" for each object "turret" in the same condition. I found this is the only way for it to work... Does this sound inefficient?
    • How do you use the profiler? Could that help me?
  • Ah sweet. Glad that one is sorted

    GIEF NEXT BUILD PLOX LOLZ. Sorry i got carried away.

  • I think construct has an improved technique to replace spreading values, but i don't really know what it is atm. Its probably UID's (each object has a unique ID).

    Can someone who knows confirm?

  • 1 Level for the engine is generally a good idea though. As long as your game uses the same engine for all the levels (eg. its not a spore type game where its basically a load of different engines stuck together to make a whole game). I use groups to seperate stuff off.