Enemy pigeon AI states were being preserved between successive pigeons – now each AI state resets when the pigeon spawns.
Incoming player sometimes had wonky physics – now it works like it’s supposed to.
Player has a little better control over where they will land after being scared off.
I also hooked up my very-simplistic profiler and did some quick performance analysis. I’m not having a lot of performance issues, but I do notice it getting slower as the number of birds increases. Here’s something I found that seems interesting:
Each frame takes three passes through the entities (birds, food, dogs, feathers):
First, to update.
Then, to render shadows.
Finally, it renders the surface and then takes a final pass to render the actual sprites.
Rendering is certainly the biggest cost here. Still, I see a concerning amount of time spent on just the update pass, and I’m not finding anything peculiar happening in it. So I think a large enough chunk of time is spent traversing the entity lists, that I’ll likely see a noticeable improvement if I collapse all of it into a single pass. We’ll find out soon, I hope.
I’m not a big fan of refactoring code, but it happens. Sometimes. I try to avoid it. But here we are.
Here’s the update:
I did a bunch of cleanup and – for lack of a better term – refactoring this week, mostly on the code related to the game’s menu system. All of this refactoring should make some upcoming changes easier.
I also made some changes to how the bonus phases are initiated. I’m still not sure it’s what I want, but we’ll see how it goes for a while.
Here’s an update of me testing the bonus phase changes:
I get so little traffic here (besides the spam bots that abuse the comments section), but I know I still should really update every week. So let’s get to it:
I was actually out of town this week – my wife had a conference in Las Vegas, so I worked from my laptop in our room in the Luxor while she was doing the conference thing. Here’s what I worked on:
There were a number of lingering bugs with the game’s timing, specifically around food dropping and feathers spinning. So I wrote more sophisticated physics, and now those things aren’t problems any more.
The game used a hard-coded screen resolution – now it pulls this dynamically.
Small birds will now retaliate much like pigeons, although only when you scare them away by dashing. They still get scared whenever you get too close, but they don’t retaliate.
I did some research on how I will port my game to mobile, so hopefully there will be some development there in the coming weeks.
I did a lot of code cleanup behind the scenes. Most importantly, I worked on separating the Game and Engine logic as much as possible, so I’ll be able to re-use as much of this codebase as I can in the next game or two.
I’ve started working on the logic to add achievements that will unlock additional pigeons, types of food, possibly bonuses.
I worked on fixing a bunch more bugs related to the Crow bonus challenge feature I added recently. Some of these were really bad scenarios, where you could scare the crows away, but still no food would spawn, and you’d just wait for the game to end. So… glad to have those issues fixed!
I merged a lot of the pigeon and crow code together into a single generic class named “Bird”. It’s a little easier to work with, and I’ll have options to add other types of birds if needed. I was thinking of maybe adding some little sparrows or songbirds as sort of a decoration.
The pigeon AI was pretty stupid before – it just randomly chose to do things. I made some pretty direct improvements to it now. It still sort of randomly chooses what to do, but now if the pigeon starts hunting for food, it KEEPS hunting for food. And if the pigeon turns hostile toward you, well, look out.
Here’s a sample video of me getting pushed around by the new AI: