Nabu's Forum Posts

  • dop2000, Thanks for the tip !

  • Is there any list of these cases that drag down the performance ?

  • I didn't know for the C2 bug related to groups. Neither for the stutters due to Chromium. I've read topics about problems with versions of Chromium and NW but that's all. I make an intensive use of Families (can't do without for game design) and groups (the same, and debugging). Thanks for the tip, I'll try to to something with the groups. I use last version of NW.

    But that's really annoying to come across bugs with main features of C2... like polymorphism with Families. I've got two big projects and one small that I can't port, so I have to finish them with C2. But I'm decided that for further project I'll move to Unity.

  • Ashley,

    Will Construct 2 ever see the benefits from optimization related to polymorphism ? Because I work on a project for more than a year and struggle to optimize it. I had results but spent lot of time on it and never really solved stutters that shouldn't be present. For that I started to think porting the project on Unity (very hard on large project, already done). Even if C2 projects were compatible with C3, I use some plugins that doesn't exists for C3.

    Thanks

  • I already do the same. But what would be the best way to do this for performance ? It seems that collision tests are better placed at top level event instead of inside a sub event.

  • Hello,

    Maybe you should provide a small capx. As of now it's hard to solve your problem. Jumping with physics should be made by applying an impulse at an angle pointing upward, assuming you set a gravity different than 0.

  • Hello,

    I have some units on the layout that chase each other. Once they're close to their target, they start an attack animation. At this animation's end, I would like to damage the units that are overlapping when (invisible) attack zone of the attacker.

    What is the best way, more efficient, to do this ? Any idea ?

    I came with two way :

    • test for collision when animation end between attacker's attack zone and units from different team
    • toggle a boolean for attack zone when animation ends and test for collision in another event between toggled attack zone and units
  • Nandynho, Ok. I hope you'll update it sometime. Thank you for your work !

  • Nandynho,

    Hey, how did you do the first example in your demo, where there's a menu inside a menu ?

  • Hello Reginaldoev,

    I don't know if the problem is solved, but I remember that since I switched to the external physics plugin Chipmunk, which is better in some ways. You have more flexible collision conditions filtering for example, and collision groups with ids and hexadecimal. And that solved many obscur problems I had with built in physics behavior, box2D or asm.js.

    So I encourage you to give a try.

    Best regards, and happy Christmas !

  • Hi, thank you all for replies,

    mekonbekon, I found a similar solution than yours to avoid checking every object every tick. But I don't get enough performance improvements with it cause you can't abuse this trick, if you do so then many objects won't be updated every tick and can alter the gameplay. For things like weapons positionning on characters, it has to be every tick instead you got a lag. And if I filter onscreen/not on screen to position things, it creates a lag between what's on screen and what's not. So I ca use the trick to alleviate CPU usage just a bit.

    tunepunk, same here, I already use a lot of filter condition. By the way your ideas on picking are maybe a kind of solution. Your test works well but I do more calculation per object in my project and that causes more CPU usage.

    Maybe a solution would be to separate states that require to be updated every tick from states that doesn't and store objects UID in different arrays to loop through at different frequence. But again, after testing things like this the gain is very little. At some moment, I can't prevent the player to make all his units attack and switch a lot of units to array that require update every tick.

  • Maybe

    distance*cos(angle) for x

    and

    distance *sin(angle) for y

    Angles are in radian so angle*(PI/180) for using un degree.

    Is that correct ?

  • Hello everyone,

    It's been a while I didn't post in the forums cause I find Construct 2 very complete and I'm used to workarounds. But I'm struggling with one thing, handling many units with behaviors and states updated every tick. (Native application, not mobile)

    Basically it's the For Each loop on a family with some calculations and checks inside that are CPU intensive and tend to kill performance.

    I've read all Ashley posts about optimization and how to rightly use Construct 2 but in some game design you can't pass the For Each loop.

    I encounter difficulties to supress the stuttering when it comes to deal with 40-50 units ingame. With 100 the game is playable but regular small stutters are annoying and low end machines can't sustain. I saw the benefits of collision check optimization that have been done but how could loops can be so demanding ? I tried various things to understand and ran into the case of function calls vs inline events but stress tests were not so relevant.

    Anyone has a solution or an idea to organise the code or something to handle (not so) large number of units ? I mean, 200 with no stutter would be cool !

    Thanks

  • Same question. I'd like to create object in a function and then set some variables and spawn side objects. You can do this with the classic "Create Object" or "Spawn another Object" because Construct pick the correct last created object. But how to to the same with "Create Object by Name" and pick the last created one ?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Did someone experience the same issue ?