A few things to do, nothing too exciting.
Managing managed memory for management
Added some code to start spitting out the memory being used pre- and post- a forced garbage collection after 15 seconds, then pause the game when the post-GC memory stops changing. With the server not running, and me not touching anything, we should get semi-consistent results, right?
56 57 58 59 60 61 62 63 64 65 66 67 |
|
- First run:
- Total Memory at time 15.00965 pre-GC: 27,811,840.00
- Total Memory at time 15.14369 post-GC: 19,075,070.00
- Second run:
- Total Memory at time 15.00806 pre-GC: 24,526,850.00
- Total Memory at time 15.15492 post-GC: 19,468,290.00
- Third run:
- Total Memory at time 15.01008 pre-GC: 24,870,910.00
- Total Memory at time 15.15714 post-GC: 19,496,960.00
- Fourth run:
- Total Memory at time 15.00175 pre-GC: 24,616,960.00
- Total Memory at time 15.13237 post-GC: 19,505,150.00
…so at least we have a baseline as we make changes that will take less/more memory. Commented out for now, wondering if I’ll actually use it before just switching to Unity 5 and using the built-in Profiler.
Cellular cleanup
Like we did with NPCs, let’s cut down on the size of some of the Cells we’re keeping around:
2591 2592 2593 2594 2595 2596 2597 |
|
220 221 222 223 224 225 226 227 228 229 230 231 |
|
Doesn’t help too much (not like the NPCLite change), and only points to how much I need to overhaul Cell handling in general.
More coroutining
Now that Hatred is handled in a coroutine, Damage should join it. This coroutine is even simpler.
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
|
127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 |
|
The tricky bit: As the NPC is being generated/reset, hits
and hitsFull
are set individually, so there’s a time when we would instantiate a damage indicator unnecessarily.
We can avoid that by defaulting hitsFull
to 1 and hits
to maxint.
84 85 86 87 88 89 90 91 92 93 94 95 96 |
|
Other
Whatcha Playin’?
Currently, Volume from Mike Bithell and friends. Just playing through the story, and I’m not very good, but I’m completely hooked. Have to set a timer so I don’t “One more level…” myself into oblivion.
Good news
Since upgrading to Unity 4.6.8, I haven’t had any more lockups of MonoDevelop. Yay!
Sorry
Random Autumn illness and busy times at work have made these “days” way less frequent when they should be. Hope to improve on that.