Pick instance with UID Problems

  • I'm using pick instance with UID and on IE9 it works perfect, with Chrome and Firefox just sometimes. Is there a limit on how many instances used, the UID is in the 1300 range.

    <img src="http://www.fishertextiles.com/uid.jpg" border="0" />

  • I changed the code to:

    <img src="http://www.fishertextiles.com/foreach.jpg" border="0" />

    It works with IE9 and very slow with Firefox and Chrome. At least it works, but why so slow?

  • I would guess its because for each is a loop running every tick.

  • ...and if the UID is around 1300, that could mean about a 1000 iterations each tick and that will probably bring down the fastest machine...

  • Weishaupt

    newt

    But why then does IE9 works with no delay regardless of the Machine?

    I changed to a for each because there is only 30 instances of that object which is much better then 1300+ using the other method.

    Also i forgot to mention that the fps never drops below 58 with both codes.

  • Ie9 is really fast with javascript.

  • newt I'm getting 70-90 fps with chrome.

    Here is a demo

    The code i'm concerned about controls the movement of the gold coin when it is overlapped by the player. The 2 numbers in the lower right corner are the fps and global inventory variable.

    Also the old code is still in place for the sword and and shield.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Am I missing something? Nothing happens, when the player runs over a coin...

  • Weishaupt

    Thats my problem. When i run it on IE9 the coin moves to the lower left corner and the amount increments by 1. On Chrome and Firefox sometimes works.

    What browser did you try it on?

  • Chrome.....maybe you can share your CAPX? That makes it alot easier for us to help you

    Have you tried "on colission" instead of overlapping?

  • Weishaupt

    I might do that, but the capx uses 1 unreleased plugin for the maze generation and 2 unreleased behaviors, 1 for the spider movement and logic and the other for the player movement and logic.

    I just tested on chrome on a windows xp machine and there is no problem. Just chrome on windows 7 32bit. I haven't tested on Windows 7 64 bit yet.

  • I am on Win7 64bit

  • Problem fixed, switched to using the bullet behavior and destroy outside of layout. Works now with every browser i tested.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)