301 Days

A year of gamedev experiments.

Day 20 - Infrastructure 2

| Comments

Taking the plunge and updating some of my tools.


Unity 5

In truth, it was rather painless. It automatically made the few changes to one of my scripts that I was expecting:

Assets/NpcScript.cslink
114
115
116
117
118
119
120
121
122
123
124
125
    // disappear if desired
    GetComponent<Renderer>().enabled = toBeSeen;
}

public void UpdateMaterial(int currRound) {
    if (lastActiveRound >= currRound-1 && Health > 0f) // one round leeway in case we catch the DB in mid-update
        GetComponent<Renderer>().material = liveMaterial;
    else {
        presumedDead = true;
        GetComponent<Renderer>().material = deadMaterial;
    }
}

…since the shortcut to the renderer has been removed, we have to get a reference to that component instead. Of course we don’t want to leave it this way, where it gets the reference every time; we’ll grab it in Awake. But glad the upgrade didn’t try to do that refactoring for me.

But the real candy for me is the Profiler that I now have access to. Here’s something I was expecting:

And something I wasn’t: Especially given:

There must be some sort of default audio managing build into the Editor. When I Build & Run with the profiler hooked up to the now-external player: Much better. And found the docs that explain it.

Now to verify the source of those CPU spikes. With the remotely attached Profiler, choosing one of those spikes to look at, I can see this far: But then need to enable “Deep Profile” and run it in editor to drill down further: Clearly we need to get those database calls out of that Update; out of the Unity UI thread completely, if possible. This may prove helpful.


Visual Studio Tools for Unity

Also pretty straightforward. It’ll take a little getting used to (VS has never been my home IDE), but seems like the way to go.


Octopress 3

I think I’ll publish this first.


Day 20 code - visualizer

Comments