Jump to content
  • Advertisement

Unity Huge memory wasting

Recommended Posts

I work in Unity...

In order to save the flow of waves I use Three data types 

  • Enemy formation(choose)
  • Wave Segment 
  • Wave

Enemy formation have one Enum formation type and enemies which form that formation

Wave segment have list of formations like (formation 1 & formation 2 & formation 2)

Wave have list of WaveSegments(+ one list - time between these segments)

All of those data types take memory of less than 1kB in most of cases(e.g. from 300 bytes to 700 bytes)

Minimal memory to save one file is 1kB so every asset will be 1kB so I'm wasting at least half of memory.

Is there a way to organize this better?


Share this post

Link to post
Share on other sites

Unless you have a lot of these files, it's probably not worth worrying about.  We're talking less than one megabyte in an age where games regularly take multiple gigabytes.  I probably care more about reducing file size than most people, but chances are that there are better places to save memory in your game than this.

That said, if your formations are just (formation, enemy_type) tuples, then there's no need to save them as individual files - just put them into your wave segments directly.  I'm not even convinced that separating out the wave segments from the waves is a good idea.

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!