PR Planning, Stations, and Performance
Hey Folks! Sort of a mixed bag today, as I tackled a few tasks of different colors.
First order of business was chatting with Fernando Rizo, who's been helping me prepare to announce this space prototype more officially. Originally, we were talking about trying to get on some publications' radars for 2018 lists, but since this is likely going to be the first official announcement of the space prototype (including a name!), we're talking a more general, long-term strategy.
This is also sort of the main reason for the recent push to make it playable. Or at least show what the gameplay would look like.
To that end, I was looking into making AI emotional state more visible, as well as how it interacts with others. That's coming along, and if one looks at the details, they can see AI having needs, seeking relief, and moods evolving.
But I think another important aspect might be to return to the concept of finishing a trip from A to B. Right now, I spawn the ship, spawn random crew, then start watching. I can fly around from A to B, but there's no reason to. I literally cannot do anything but fly the ship around or force AI to interact with things. And once I leave...poof! Everything resets.
So I think it would be worthwhile to add something to either end of that AB trip. Maybe a refuel UI, some associated fees, and some way to generate income to pay for it all. And that might mean cargo runs, or spying, or finding a person, investigating a crash. I dunno. But something needs to happen for the crew to keep fuel in the ship, air in their lungs, and food in their stomachs.
During all this, the crew will be doing it's thing, using my half-baked AI. And maybe that'll even be interesting! And even if not, maybe I can see opportunities to make it interesting. (Ideally, also interactive.)
So that seems like I'll need some rudimentary way to show current assets, some UI to add or remove stuff from the ship (fuel, food, cargo) using those assets, and maybe some sort of UI to signify dealing with an NPC (e.g. agree to go to X and come back with intel). And maybe the simplest approach there is to mimic the NEO Scavenger encounter UI, showing items/skills/knowledge the player has when faced with a choice, and their input determines next steps.
Anyway, given all that, I was starting to add a few more stations Michael has worked on backgrounds for. You can see those in the system map of today's screenshot (diamond icons).
However, while testing that, I got fed up with the terrible framerate during that UI. It ran at 14fps, and I decided to find out why. So I fired up Unity's profiling tool (right side of the screen).
What we see there is a EKG-like meter of where each frame was spending time. And before I changed anything a good chunk of that was in garbage collection (dealing with previously allocated memory after it wasn't needed anymore). "Wait for job group" was the key phrase that hinted at garbage collection issues. It was absolutely tanking my framerate trying to clear ~600kB of data each frame. For all you non-programmers out there, this is really bad :)
After a bit of poking around, and selectively disabling stuff, I came across a forum post with a similar issue. And as it turns out, they were making a really simple mistake that I did, too. I had a ton of stuff drawing on a canvas with a graphic raycaster on it. Basically, it was assuming I wanted to click on everything in that canvas, so setup a lot of data for each thing. Simply removing that raycaster shot the framerate up from 14 to 30! And since I plan on only clicking outside that LCD-like screen, this is a freebie.
There is still another 30fps I think this UI chews up, and I could get it back to 50-60fps again. But we'll see if that's worth it tomorrow. I might just return to the mechanics until performance stings me again. That's all for today!