Peaceful Zombies

Finished lots of optimizations today, but you can’t really see any of those in the screen shots. Other than a small improvement on town and building placements. Towns are now able to organically grow during the world building step, and they connect correctly with roads now, without drawing too many roads (lots of 2D sorting went into getting that to work correctly).

But I promised characters and… look! There are some zombies in there. They render correctly now, they collide with walls (well, they avoid walls at least) and there’s also a rudimentary (I use that word too much) AI and goal system implemented for all characters in the game. More after the lovely peaceful zombie screenshot:

Side note, if anyone wants to create some low-res pixel art, let me know. I need all sorts of 8×8 tiles for decorations (rocks, better trees, debris, etc). The screenshot above also appears to have one of the old tire decorations lying on the road. I don’t see any of the animal skulls I made though, but they do spawn fairly infrequently.

Anyway, back to the AI system.

The current design is fairly simple, and I’ll extend it as needed, but for most of the upcoming features it should work fine. Characters have a list of goals that they’ll try to achieve / carry out. Most goals are simple, but some goals do encapsulate other goals as well. For example, the SearchForX goal is the same as a Wandering goal, except it can be interrupted at any point if the character finds or observes the thing it was looking for. This can be anything that has been defined in the world. Food, items, zombies, friends, enemies, buildings, roads, water… you get the picture.

The goals that are available right now are:

Wander: Used by the zombies mostly to shamble around, it’s basically a local area search with no end conditions.

WalkTo: Uses an A* search to calculate a valid route from one point to another. This will be used by characters to “find home” or move to the “last known location” of something important (missing people, lost items, etc).

Idle: Characters following this goal basically just wait for a broadcast to give them a new goal.

SearchForX: Character wanders in a location until it finds the thing it’s looking for, or time runs out.

Still on the short list are goals like: Escort, Alert, Train, Repair… most of the other goals I have in mind are based on character skills, so I’ll have to start working on that system next to take full advantage of more advanced goals.

Both path queuing and goal queuing can be interrupted by “emergencies” as well. Those are currently not implemented but it was an easy addition and should come in handy in the future.

Up next on the list, 1 collectible item (I’m thinking it will be… money just to make things easy for now) and then I’ll work on the in-game UI. This might take a little while for me to design correctly, I need to make decent use of the realestate and figure out just how the context menus will work, without being completely overwhelming. I want everything to be fairly intuitive to control.