Nabu's Recent Forum Activity

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

  • TheRealDannyyy, thanks for the tips

    1 - Yes this happened with previous releases,

    2 - The sounds are preloaded.

    3 - Not rendering Shadow Lights didn't change anything.

    4 - I used render cells and still got stuttering.

    Strange this happen only with the dedicated GPU, and run smooth on the integrated one. Both 32bits and 64bits versions stutter. Maybe it's related to NW.js or Chromium. You can confirm you experienced no framerate drops ?

  • TheRealDannyyy, thanks for the reply,

    I just released a game in alpha stage on itch.io and found jerkiness problems with the Node Webkit export.

    https://nabu.itch.io/ultimate-barbarian

    Heres my specs :

    • NW.js 0.20.0, the last one
    • I7 3630QM 2.40 GHz
    • GeForce GTX 660m
    • OS is Windows 7 SP1

    The game has 20 to 200 sprites on screen with about 100 average, and some shaders. The stutters occurs about every second whatever happen on screen, in cpu intensive times or not. Average CPU usage is 30%, up to 50% some times, with less than 10% for the engine and the same for draw calls, the rest being logics. The preview under Chrome and HTML5 export works smooth on various browsers. Only NodeWebkit export is jerky.

    I found the stutters are almost invisible running the application with my Intel integrated graphic card 4000, although a lot more visible and annoying with the GTX 660m.

    I also tested the game exported with NW.js on a low end computer and it worked well and smooth.

  • Hello everyone,

    I got small but anoying stuttering about every second when exporting a project with NodeWebkit. I tested an HTML5 export and it works a lot smoother. I tested some things displayed on the first page related to vsync and single process but didn't help. My project has about 30% CPU usage all the time and I can't explain the stuttering.

    Any help on that would be welcome.

Nabu's avatar

Nabu

Member since 14 Feb, 2015

Twitter
Nabu has 1 followers

Connect with Nabu

Trophy Case

  • 9-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

13/44
How to earn trophies