How do I fix fps issue with solids and fix bullet behavior?

Get help using Construct 2

Post » Sun Dec 18, 2016 3:55 pm

I've got 2 problems that i'm just struggling to fix. I'm not sure if they're bugs or if i'm just un-aware of a mistake but here they are:

1) When the player rubs against a wall, I get 60fps, When an enemy is shooting at the player I get 60fps, but when the player rubs against a wall while being shot at, the game goes down to 2 fps, does anyone know why the performance messes up?

My player uses 8 directional movement, my walls are solids and my enemies use line of sight and the > Every X Seconds condition to fire. It's nothing complicated that really should strain computers or even laptops at that matter. My 5 year old laptop can run the game pretty well. But it gets this problem too.



2) My enemies are all the same object, when I spawn one it randoms which animation to play and depending on which is chosen it sets the stats and attack patterns of the enemy. That works fine, enemies have the right health, damage, speed etc but for some reason this next thing only applies to 2 of my 6 enemies... When the enemy dies:

My wraith's bullets suddenly change path to target the player until they time-out (bullets in my game only last about 2 seconds at most)
And my warrior's bullets do the same, except my warrior has 2 attacks, slash and stab. When it dies all the stabs turn into slashes and follow the player until they time-out.

I'd post my events but the only thing that happens when my enemies die is that they get destroyed and they place a loot bag down. I haven't made an actions for the bullet when my enemies die so I haven't made a mistake without realizing.

Just wanted to know if anyone else has had this problem?

Thanks,
Conra
B
6
Posts: 26
Reputation: 306

Post » Mon Dec 19, 2016 2:20 pm

can you post a .capx . I promise nobody will steal your game at this point.
B
9
S
1
Posts: 63
Reputation: 857

Post » Mon Dec 19, 2016 8:20 pm

I removed all the un-important stuff and changed all the sprites, So cool! Son of a bitch!
All the stickmen are ok enemies, the Warrior and Ghost are the ones that previously had a problem


https://drive.google.com/file/d/0B2iDOW ... sp=sharing

The problem with the attacks isn't happening so I might just save my game as a new .capx and see if that fixes it, but the problem with walking into the walks while an enemy is shooting you still persists even when my game in tiny.

If you can sort this for me it would be very appreciated!
B
6
Posts: 26
Reputation: 306

Post » Mon Dec 19, 2016 9:51 pm

It did not fix it, for some reason my enemies behave fine in that instance of the game but not in my main version or my new copy... Hmm....
B
6
Posts: 26
Reputation: 306

Post » Tue Dec 20, 2016 10:13 am

Yes. I noticed strange glitch. Investigating now.
B
9
S
1
Posts: 63
Reputation: 857

Post » Tue Dec 20, 2016 11:33 am

Looks like solid behavour and pathfinfing works bad. It's not a shooting problem. If you disable collisions on Solid blocks - problem disappears
B
9
S
1
Posts: 63
Reputation: 857

Post » Tue Dec 20, 2016 11:48 am

From more tests it is sure a collision and enemy pathfinfing. When player near solid object pathfinding overheat system. I reccomend cancel pathfinding, or change path method
Last edited by MadScientist on Tue Dec 20, 2016 12:01 pm, edited 1 time in total.
B
9
S
1
Posts: 63
Reputation: 857

Post » Tue Dec 20, 2016 12:00 pm

B
9
S
1
Posts: 63
Reputation: 857

Post » Tue Dec 20, 2016 3:58 pm

Ah, thank you very much ! Now I know it's actually a performance issue on the programs end and not my specs I have just easily sorted it.
The fact that I set the enemies to find your position every 0.1 seconds all I had to do was up it to 0.5, so there's not as many tasks being executed in the system. The enemies aren't AS precise now but at least there's no performance issue now. They're still quite consistent. I might test around to see what the optimal check-rate is for performance. To also help out i've made it so the enemies won't chase you if you're too near spawn so less enemies should be on screen where the issues happen. Thanks for this!

However the bullet problem still persists. The Warrior and Wraith's shots still change animation/direction when the enemy is destroyed.
This was the problem that I had little faith in fixing. The only possible solution I can think of would be to:

A) Rather than them all being 1 object for convenience, being all separate so that they have no way of changing animation since they're stuck to 1 sprite per attack.

B) On creating the object I create an XTarget and YTarget in the instance variable so that I can set so that EVEN IF the warrior or wraith is defeated it will stay true to the path.

At the end of the day I don't see why I should be having to add more objects and events SPECIFICALLY because two attacks aren't functioning the same as other bullets that have the same actions and events as them...

Appreciate the support!
B
6
Posts: 26
Reputation: 306


Return to How do I....?

Who is online

Users browsing this forum: nahima and 7 guests