Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(1 edit) (+2)

Hi, Thank you! Glad you enjoyed it! I like this subject so I wrote a lot :)

To be honest we did not need to focus much on performance and were more focused on the time constraint :). That being said we did make sure to make a few minor tweaks that got us enough enemies on screen running fairly well (still lags a bit on some penetrating bullet shots) but we were satisfied enough given the map size we made. I'll give you a list of what we did do, and what we totally could do.

We used the Unity game engine and the Universal Render Pipeline so some of these might be specific to that.

Things we did:

  1. Make sure bullets, slimes, and hit effects were destroyed when they were done with. So not letting your bullets fly off screen forever, for example.
  2. Using discrete collision detection on the rigidbodies and not continuous, since things are colliding relatively slowly.
  3. Basically turning off anything in our URP renderer we did not need, like anti-aliasing. Although, now that I think about it we could have turned more off :).
  4. We don't currently have any Realtime shadows.

Things we could / should do (if we made the game/maps bigger):

  1.  Add all of our sprites to a Sprite Atlas in Unity so there are not multiple texture look ups (this is super fast to do, we just forgot to do it)
  2. Double check our scripts for places we can take code OUT of the update or physics loops.
  3. Use object pooling instead of instantiating slimes / bullets / effects like we currently are
  4. Use gpu instancing and instanced properties in their material/shader as needed. A good use case for that in a game like this would be having health bars on all of the slimes. We could use gpu instancing with instanced health/color properties to show all of those health bars, with different colors and values, all in 1 draw call. I suppose you could do something similar with the Sprite Atlas and swapping textures as well.
  5. If we really needed to push the number of objects it seems Unity's ECS/DOTS system would be a good choice, I still have not had a chance to try it out though. I also don't know if it works with WebGL!
  6. This list goes on... :)
(+1)

Thanks for the detailed response! I'll be saving this to come back to for any future projects that require a lot of enemies or objects onscreen at once, it's really useful :)