Posted in Items, Zombox on January 28th, 2012 by Tyson Ibele
This week in development I worked on getting the weapon crafting system working, as well as giving the player the ability to collect supplies which can be used to construct walls and doorways. Last week’s update showed the ability to construct those building elements, but there was no way to actually gather the raw materials necessary for them. Now, every time you destroy an object in the game, there’s a chance it may drop some useful raw materials that can be picked up.
New weapons can also be crafted now, by combining various pieces together in the crafting window. For example, you can combine a box of nails and a baseball bat to create a nail bat, or a pool cue, some duct tape and a knife to create a lance. Right now there are about ten craftable weapons that I’ve added to the game, but in the future there will be many more.
Also, the construction mallet shown in last week’s update has been given two modes: repair and destroy. Using it to repair an object costs money, and in destruction mode it can damage solid objects faster than most other weapon types.
Finally, new particle systems have been implemented, which generate debris every time an object is damaged. The type of particle emitted depends on the substance of the object being hit. A door will emit shards of wood, a wall will emit chunks of concrete, etc.
Here’s a video demonstrating all of the above features!
First, I apologize for the lack of updates the last couple of weeks. Some extra work was occupying my free time and I couldn’t work on Zombox as much as I wanted.
Regardless, I’ve got quite a big update this week, because Zombox now features a construction system! You can use it to build your own custom buildings and shelters. Once a wall or doorway is built, it only has partial HP, so a player must use the “Construction Mallet” (a new item) to repair it to full health. The “Construction Mallet” can be used to repair any object in the game world. The mallet is currently unbalanced, so there’s no penalty for using it to repair something, but eventually I plan to integrate it into the ammo system, or have it drain the player’s money during repairs, or something else in order to persuade the player to use it wisely.
I’ve also modified the inventory UI a bit to make way for the upcoming crafting system, as well as the supply system. Because it doesn’t make sense for a player to be able to build walls and doorways without the proper supplies, eventually you’ll need to collect scrap metal/wood/concrete before being able to build things. While this system isn’t yet integrated fully, the UI has three new item slots in the bottom left to keep track of the amount of building supplies the player is carrying. Also, in the bottom right of the new UI are three new tabs, which the user can click on to quickly switch between the examination window, the crafting window, and the settings window.
During my work on Zombox in the last weeks, I also implemented Jump Point Searching into the pathfinding algorithm. However, even though JPS performed better than vanilla A* on full paths, the current pathfinding system in Zombox is highly optimized towards returning partial paths, and JPS doesn’t return very good partial paths due to the way it expands nodes. So I ended up reverting back to my old pathfinding system. I worked on optimizing it further too, so it now performs about 40% faster.
Here are some images and animations demonstrating the changes listed above!
Posted in AI, Zombox on January 1st, 2012 by Tyson Ibele
So, over the last two weeks I’ve been updating the zombie AI.
The old AI system had many problems, was hard to update, and lacked many important features. So I started from scratch and implemented a behavior hierarchy, similar to the one described in this book.
Here are some key features of the new system:
zombie AI is now sight/sound based. Zombies will tend to wander around aimlessly, until they see/hear something that catches their attention. Things like the sound of the player hitting an object with a blunt weapon, or firing a gun will attract zombies, but they won’t automatically know what caused the sound. This means that zombies can be distracted with sounds while the player heads in the opposite direction. It also means that it’s now possible to sneak up on zombies from behind.
zombies now flock more realistically. No longer will they randomly intersect walls, or the player, or each other. When attacking, they’ll also try to surround their target.
zombies will try to break down the doors of buildings, if they see a human/hear a noise inside.
I’ve also improved several other aspects of gameplay. Items that require ammo now display their ammo counter inside their icon, when assigned to any of the active item slots. Also, zombies and props can no longer be hit through walls or other solid surfaces.
Here are some screens showing the debug info I use to help me visualize the new AI system. White lines show new A* paths that are calculated. Green lines point to the next node on a zombie’s path when the zombies is following a sound. Magenta/Cyan lines point to a zombie’s active target (cyan = close, magenta = far). Red lines show the next node on a zombie’s path when the zombie is chasing a target (although zombies are allowed to veer off their path when the target is directly in range). Yellow lines point to a new sound that a zombie has heard.