Dom Pedro II
Modder For Life
Impaler[WrG] said:Dom: I was thinking about the implementation of your mod and realized that the addition of so many variables to the CvUnit class will result in a considerable incresse the the game memory consumption as units are instantiated many many times in the game. It probably wont be enough to cause any realy seriously deteterious effects, I'm thinking of minimizing long term memory bloat. I would recomend that you look into using reduced sizes on many of the variables, short int can be substituted for int in most locations and their are probably some situations when char will be safe to use. Just use the small variables in the object and cast everything within the get/set/change functions to isolate them from the rest of the program. Their are some examples of this in the CvPlot class as Firaxis did do a bit of optimization their (plots being the most numerous objects in the game). Avoid an signed/unsigned convertions as these are known to be unreliable on different processors. I've been thinking of doing a memory usage profile on Civ4 which could be used to track how much our mods are actualy incressing the size of the game memory footprint.
Thanks for the tips, and yes, this was a concern of mine as well. I've been trying to put checks in as many places as possible to keep the system from running through unnecessary processes.
Also, since unspecified integers default to signed anyway, I don't think it'll be an issue.