playMaker

Author Topic: Performance Issues - Enemy Waves  (Read 1788 times)

Pappa

  • Playmaker Newbie
  • *
  • Posts: 3
Performance Issues - Enemy Waves
« on: July 27, 2014, 06:48:58 AM »
Hi guys,

I'm working on my first game in unity at the moment and loving playmaker (I'm not the greatest coder ever), however I have recently run into some performance issues around spawning enemy waves. Please forgive my ignorance if this is an easy fix :)

My game is a first person tower defense game that requires relatively large enemy waves. Currently I have the enemies created and deactivated. These get activated and placed when required. I am also hiding their meshes when outside the players view.

I get a large fps drop (70 down to around 20) whenever I activate an enemy that then jumps back up to normal and as more of them activate the fps drops more and more until it is unplayable. The most I have gotten active at once is 30ish before it crashes. The models are around 1500 tri's. I am also using Rain AI for their patching.

Would anyone have any idea how to prevent or atleast reduce these frame drops? If any more info would help please let me know.

jess84

  • Hero Member
  • *****
  • Posts: 515
Re: Performance Issues - Enemy Waves
« Reply #1 on: July 27, 2014, 06:57:08 AM »
You need to use a Pooling manager, rather than creating and destroying objects.

If you search for pooling manager on here, you should get all the info you need.

Pappa

  • Playmaker Newbie
  • *
  • Posts: 3
Re: Performance Issues - Enemy Waves
« Reply #2 on: July 27, 2014, 07:20:19 AM »
Thanks a lot, just found Smartpool on the asset store. Will give it a go tomorrow morning and see how I go :)

Pappa

  • Playmaker Newbie
  • *
  • Posts: 3
Re: Performance Issues - Enemy Waves
« Reply #3 on: July 27, 2014, 08:03:18 PM »
I got SmartPool working and I have gotten rid of the frame drops on spawn. Thanks :)

However I am still suffering from frame drops as the number of enemies appears. Is it likely that the enemy models I am using are simply too complex to have that many at once?

EDIT: I believe I may have tracked down what is causing the slow down. It appears to be the pathfinding system. I have tried Rain AI and SimplePath and they both seem to cause massive slow downs once I get over 10 enemies spawned. Does anyone know of some ways to optimize pathfinding or a better system to use?
« Last Edit: July 27, 2014, 09:55:51 PM by Pappa »