more indepth optimization help needed PLZ

0 favourites
  • 10 posts
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • I'm having problems getting my game to run smoothly on android with Cocoonjs. I think it has something to do with collisions. My intro/Cinematic layout has 5 collisions total and it runs at 48 FPS, the most basic layout in my game(layout1) has approx 60 collision objects atm and only gets 5-8 fps.

    collisions for enemies and pickups are all set to

    IS on Screen

    System-Every -- seconds

           Playerbox on collision with ...

    What I'm trying to do is limit the amount of collision checks. So hopefully I'm making enough sense to ask a few questions.

    1. Am I actually limiting checks with the method mentioned above? If not what am I doing wrong?

    2 Does the ground tiles need to limit the collision checks as well?

    3 if I did the above properly, what is the collision objects limit per layout for the average tablet PC, on average/rough estimate even?

    Really I have so many questions and I'm getting no place atm<img src="smileys/smiley18.gif" border="0" align="middle" /> , so any help would be greatly appreciated.

  • Are there events where you expect the playerbox to be colliding off screen?

  • Thanks for the reply Isometric,

    there are collision events all the way through the layout. they are spread out. the layout is 6144 by 1024. it's layout setup is something like mario bros.

    I have "bad guys" on collision with invisible "edgemarker" sprites to turn back and fourth. these are all the way through the level.

    Hope this answers your question.

    Trailer is posted here if you would like to get a better understanding of what i have so far.http://www.scirra.com/forum/topic59113.html

  • you could do something like:

    Global constant number ACTIVATION_DISTANCE = 600
    
    +Every Tick
      -> badGuy: set activated to false
    
    +badGuy: X > (scrollX - ACTIVATION_DISTANCE)
    +badGuy: X < (scrollX + ACTIVATION_DISTANCE)
      -> badGuy: set activated to true
    
    +badGuy: Is Activated
      -> move (badGuy.speed * dt) at Angle (badGuy.direction)
      +badGuy: is overlapping edgeMarker
      +trigger once
        -> badGuy: set direction to (180 - badGuy.direction)

    badGuy.direction should toggle from 0 and 180 each time badGuy overlaps an edgeMarker

    this way it should easily move left and right between two edgeMarker

    Also badGuy.speed should be in pixel per seconds

  • Thanks for the reply Yann,

    I've tried what you've got above but I must be messing something up. The enemies move but they do not change directions.

    Here is a screen of exactly what I did.

    <img src="http://www.mediafire.com/conv/4a0da8378d1545e279d6539130de33d4cc879d8dec44a8a4fc619ca4b921d2ed6g.jpg" border="0">

    here is the hyperlink as the insert img is not working for me

    click here for pic

    Thanks for your help!

  • is overlapping has no action

    trigger once should be put in the same event block as is overlapping

  • Has this actually helped improve the framerate? Collisions are surprisingly low CPU, since usually 99% of objects in the layout can be immediately determined not overlapping, since their bounding boxes don't overlap.

    If you share your .capx I could see if there's anything more likely to be slowing it down.

  • Don't know what I would do without you guys:)

    Yann

    your spot on, it seems to be working fine now. I just about to test. I'll post back as soon as I have results.Thanks again

    Ashley

    Thanks for the offer. It would be great if you would take a look at it. As you can probably tell I'm not a coder, so please be prepared <img src="smileys/smiley9.gif" border="0" align="middle" />. Any help you can give me would be very appreciated. I want to test first though, try and avoid wasting your time, I'll post back with results and PM you after I'm done. Thanks so much:)

  • I tested the changes and there was an improvement but not by much. I reworked the spawning of the other enemy classes and now the Fps starts out at 7-8 and increases to about 16-17 by the end of the layout. I'm still lost as to what the cause is.

    Ashley

    I will PM you my capx file and info. Thanks for helping.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Email sent,thanks again

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