alee's Recent Forum Activity

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

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi,

    I'm doing a draggable options box that you can call up in my game. I'm wondering, will i have to do an "always set options text to Optionsbox.X+43" etc. for all the objects i want to stick to the objects box when its being dragged. Or is there some clever simple way?

    The problem with doing it in code is also that it takes a while to get the objects at the right position. I don't really mind doing it this way, but i thought i'd check if there was a better way.

  • Ok ash I've uploaded an example. Having the same issues in the example as in my main program.

    Basically, the code is meant to move the star 50 pixels to the right when it hits the left edge of the viewport. (of course in the game i would not do 50 pixels, i would just set it to the rightside of the viewport).

    Maybe i'm just using it wrong... Can you take a look at it Ash?

  • Having trouble getting the "stars" in this example to move when they hit the left side of the viewport.

  • Yeah i remember thinking it was awesome. But turns out i haven't opened it a second time. The only reason i was playing it is because I had somewhere to be and was procrastinating

    Its not bad. Its just not that good.

  • Ash, can you verify that this isn't in this build? Or am I just doing it wrong?

  • Yeah that style is sweet. Looks very dark, just the way i like it!

alee's avatar

alee

Member since 4 Nov, 2007

None one is following alee yet!

Trophy Case

alee has no trophies yet!

How to earn trophies