Nabu's Forum Posts

  • R0J0hound,

    Because it's tricky to fix it ? Or maybe you got no time.

    By the way, thanks for clarifying.

  • Hello,

    I'm having issues when pasting objects that have your Outline effect applied. When pasting, it draws black pixels around sprites outline. This only happens under Node Webkit export not preview as far as I know.

    Do you know something about this ?

    I found later that it may be related to Outline effect only, and not Paster, but I don't know.

  • Some kind of magic, thank you very much for your contribution !

  • Up ?

  • Hello,

    I was wondering how to make an AI for moving physics driven space ships. I thought of some things, like readjusting trajectory, compensating torque and trust, set velocity on target, etc... But I don't really know where to start. There gonna be small ships probably with dampeners to make them agile, and large ships with very different movement. Any suggestion ?

  • Hi maugiroe,

    The Construct 2 built in Pathfinding behavior does not work per instance, and has only one global map for everything. You have several add on plugins that may do this. I made a request for this but no answer yet.

  • Hello,

    rexrainbow, I'm doing some performance tests and I noticed that with your plugin I can decrease CPU usage of a heavy loop from 10/15% to almost 0. But it also increase the CPU usage of the C2 Engine. Is it normal ?

  • Hello,

    If you don't know the type of the target, you can create a family that includes all the targetable objects. And then you first pick the family by UID using the Turret Behavior's TargetUID, and try to pick one of the object with same UID.

  • Thanks 99Instances2Go, the plugin looks great. Hard to adapt an already existing project, but promising !

    Also thank you oosyrag for the advices.

  • blackhornet, I could make a little capx but it's more about ideas on optimizations for many units.

    Yes, thanks — What I did and explained in my last post is very similar. But as I told it's very small improvement unless you have hundreds or thousands of units. It basically splits the amount of calculations, that remains the same, onto multiple smaller loops. Instead of having one periodic "big" stutter, you get small ones.

    I thought it could be a great optimization, but it's "only" a good little trick. Am I wrong ?

  • Hey fm4fanAT,

    Thanks, that seems to be the way. But I just made a stress test and found no improvement, CPU usage is the same. I set an instance variable for the sprites and a global variable for keeping track of checked groups. On sprite creation, I set the instance variable to the global and increment the global (from 0 to 2, so I got 3 groups of sprites). In the loop I filter the selected sprite to check with condition (if instance variable match the actual global) and increment the global. Before I tested every 0.6 seconds, now 0.2 with 3 times less calculation per loop.

    So it does not lower the total amount of calculations needed of course, but only better divide the amount during same time as before. It only decreases little stuttering that can occur when there is too much calculation in one big loop, by doing more smaller loops.

    Very good in theory, but few results in practice.

    Do you know other kind of optimization when it comes to large number of units ?

  • Tilemap object is relatively well optimized for drawing or collision, as it is a bunch of rectangle polygons to check.

    So it should not be a problem. Thus optimization is very project specific. It would be great if you could provide a capx.

  • Hello,

    If you want random animation to be played when pressing the same key, just set :

    • On key pressed (whatever you want)
    • Set sprite animation to choose(animationName1, animationName2, animationName3)

    animationNameX being a string,

  • Hello,

    Your event "Is BasketTrigger overlapping Ball" is not set by instances, and only triggers the first of all the balls that overlap in the same tick.

    So you have to change it to :

    • For each Balls
    • is Ball overlapping with BasketTrigger
    • Add 1 to score

    Like in this : https://www.dropbox.com/s/zpe3495i84iz1uc/100balls-clone-fixed.capx?dl=0

  • Try Construct 3

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

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

    I got a project with an essential "For each" loop that can be CPU intensive. I have to restrain it to every x seconds action instead of every tick to be comfortably playable at some level in the game. I was wondering how it is possible to divide, or allocate this loop into several ones. For example, I would like to check the first half of the picked instances in a tick, and the second in the next one. Or if I use "every x seconds", check the first half at t 0, the second at t 0.15 seconds, again the first at 0.3, etc...

    Any idea ? Did anyone ever come to this optimization ?