Ashley need your help!!Behaviors cause high collision checks

0 favourites
  • 7 posts
From the Asset Store
Perfect Particles
$2 USD
80% off
Particles support animations, collisions, effects and etc.
  • Title sums it up.

    I'm made a platform game with bouncing enemies. With a few simple events I got my bouncing enemy, but my collision checks are sky high. On average 1200 for every enemy. In my game I sometimes hit 20.000 collision checks or more. Is this a flaw in the platform behaviour or do i do something wrong.

    I added a small file that contains the events i used for the bouncing ball and the basics.

    Game: Player walks in an arena with bouncing enemies. Once the enemies hit the wall they turn around...this repeats itself. The player can only shoot up so he needs to get underneath the enemies to shoot it, and destroy it. If the ball hits the player, the player dies.

    PS: I tried the bullet behaviour, the problem is that once the enemies hit the wall they get a different jumping height which makes it impossible to avoid them, so it will kill the player. The Enemies needs to bounce in the exact same way during the whole game.

    Game is as good is done so I appreciate every help i can get to fix this and release it for Android and IOS!

  • I'd have a good look at using the sine behaviour instead

    https://www.scirra.com/manual/103/sine

  • I'd have a good look at using the sine behaviour instead

    https://www.scirra.com/manual/103/sine

    Thanks for your reply.

    I have no clue how i should do that. Already took a look at it, but without succes <img src="{SMILIES_PATH}/icon_redface.gif" alt=":oops:" title="Embarrassed">

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Try this out

  • Try this out

    Thanks for the effort, but I think Sine will not work for me. The enemies need to bounce and with shine they are more like flying up and down. So I hope that Ashley maybe has a way to fix the collision checks for the platform behaviour. Otherwise it will mean that months of work will go in the fridge.....

  • What exactly is worrying you about the number of collision checks? Are you not hitting 60 FPS and the profiler is indicating that most of the CPU time is spent there?

    If you look at the per-tick estimate, it's only making about 20 collision checks per tick. That is very few. A single collision check is very, very fast, practically negligible performance impact. It's a simple rectangle bounds check. You can have thousands of collision checks and have almost no performance impact. Poly checks are the slower ones, and the debugger shows you're getting about one poly check per tick per object, which again is almost nothing.

    The platform behavior does make a lot of collision checks in general though. Take a look at the 'Bouncing balls' template that comes with Construct 2. It shows an almost identical effect to the one in your example, except it's based on the Bullet behavior, which users far fewer collision checks.

  • SOLVED! CocoonJS caused the crashes and the lags. I now use IntelXDK with Crosswalk. No problems on my Nexus 5, but on my galaxy tab 2 10.1 still some minor lags when collision checks are about 20.000. However found out that my tab has a Texas instruments processor(I know ) what probably explains the minor lags.

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