Wednesday, September 14, 2016

Weekly Update #4

Surprised already at weekly update 4. Anyway, got pretty stressed out earlier this week when, after having not touched the game for a while, the frame rate was around 30. I suspected this was because my laptop was unplugged, which is seldom for my working environment, but I've been trying this coffee shop thing lately. Anyway, I double checked my laptop power settings weren't supposed to be "balancing" or in "light" mode and sometimes, when I'd remove Big Bird or turn off various other game objects, the FPS would jump back up to 60+. I tried rolling back and I had the same issue, which really made me think it was plugging in the laptop. Anyway, the whole thing did go away when I got home and did plug in my laptop, but up until I plugged it in I was getting pretty scared and depressed since if plugging in didn't cure the problem, I had zero idea what was up.

The big reason I had started to pay attention to frame rate was that I had, a few weeks ago, started noticing that every second or two the FPS would dip from ~70 to ~45 for a moment or two. It seems this was due to the number of enemies I had started spawning. I've now reduced that number, or rather, not going to spawn them at the same time spread around the map, the plan is to create spawn triggers at various y values. The Sleeper.cs I don't think helps that much with processing, because the box collider has to stay enabled and be always checked if it's colliding with the Alerter circle collider. I also slightly optimized the Flyer.cs code, spreading out range checks to every 3 seconds or so instead of every update. It probably wouldn't be a bad idea to implement some group AI behavior and go through groups of enemies as a list, rather than have AI attached to each one. This might be termed "flocking" but idk. The bigger thing, for optimization needed now, because I don't want to get bogged down optimizing, would be to just implement the spawn triggers.

I created a HUD for the water and solar energies and got drinking/sweating/shield up/shield down working for a generalized Carrier. Removed some other Big Bird specific carrier code. Worked on the Shop and Shopkeeper stuff and made it work with any general Carrier a bit better. Still some issues with it. Found another issue with spawning the giant tetrominoes and used a much more straightforward ClearRiver approach, which, instead of checking for the river when placing tetros by attempting to box cast their colliders at the correct position and correct rotation, I just have a function on each river dot that clears itself of the specified objects. Much cleaner.

Still didn't spend as much time on the game as I'd have liked.

-Max

No comments:

Post a Comment