Advertisement

Huge memory wasting

Started by February 10, 2019 10:28 AM
1 comment, last by a light breeze 5 years, 7 months ago

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?

waveDataImage.thumb.png.2f6021bbfbee3eaac3731880a8857254.png

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.

This topic is closed to new replies.

Advertisement