Nabu's Forum Posts

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

  • Try Construct 3

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

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

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

  • Problem Description

    Keyboard input sometimes not triggered, maybe keyboard released, or key down triggered itself.

    Attach a Capx

    https://www.dropbox.com/s/qnrbgqam9wkscjn/KeyboardInputBug.capx?dl=0

    Description of Capx

    A sprite with 8 direction movement behavior and ZQSD keys to move

    Steps to Reproduce Bug

      Play a little and randomly the sprite get stuck in one direction until you press the related key again

    Observed Result

    Key get stuck down until press a second time

    Affected Browsers

    • Chrome: (YES)
    • NodeWebkit: (YES)
    • FireFox: (NOT TESTED)
    • Internet Explorer: (NOT TESTED)

    Operating System and Service Pack

    Windows 7 SP1

    Construct 2 Version ID

    Construct 2 beta r241

  • Hello everyone,

    I'd like to share with you my game, Ultimate Barbarian, just released on itch.io https://nabu.itch.io/ultimate-barbarian. It is an action game, with Roguelike and RPG elements. Made to be hard (hope so) and brutal. You can follow an main quest through different locations on a map in a fantasy world of Barbarians, train yourself in arena fights, buy weapons and enlist warriors to help you in battle, explore dark dungeons and find treasures !

    Video of current gameplay :

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