Crafting stations…

Posted in Items, Zombox on February 26th, 2014 by Tyson Ibele

Here’s a teaser of some of the new crafting stations you’ll be able to build in Zombox. After you build or upgrade each one, you’ll be able to craft many new items.

Can you guess what some of these will be used for?

Items on the ground…

Posted in Items, Zombox on February 21st, 2014 by Tyson Ibele

So, since the inception of Zombox 3 years ago I’ve wanted to make it possible for items to lie on the ground, outside of any particular container they could be stored in. This is a standard element of many RPGs like Diablo, Torchlight, Minecraft, etc.

The reason that this was never possible in Zombox (up until now) is due to the sheer number of resources required to have an implementation of this idea work. If the actual item geometry is to be displayed on the ground, that’s a lot of extra polygons that an iOS device just wouldn’t be able to handle. If a graphical representation of the item is to be displayed (like, its GUI icon), it would require a lot of draw calls to display each and every icon that is dropped…and every draw call is another hit on the GPU, which would quickly slow the game to a crawl. Batching wouldn’t work on those icons unless they were using a texture atlas, and updating UV/vert lists on a mesh to match icon/world coordinates would be slow.

But then I realized that I could use a particle system to do all of this quickly, and in only 1 draw call. The solution is a bit of a hack that requires “freezing” particles at particular frames on a texture. To elaborate, Unity allows you to tell a particle system to cycle through cells on a texture sheet. This is how animated particles are created — you create a texture sheet with a grid of cells, each containing a different frame of animation. Then you tell Unity’s particle system to cycle through the cells at a given rate, which results in an animated particle texture.

Well, if I create a texture sheet that contains all of my icon textures, and then tell a particle system to advance to a particular cell of that texture sheet and freeze there, I am able to achieve the effect of individual sub-textures of a texture sheet displaying properly on individual particles. Once that’s done, the rest is easy.

So…as a result of this new system, several new things in Zombox are possible:

  • items can be dropped or picked up, anywhere in the game world
  • objects that contain items drop their items on the ground when they are destroyed. The dropped items will be degraded in the process, though
  • when a player approaches an item on the ground, the item will hover around the player, alerting the player that they can examine the item
  • zombies and npcs will now drop their items/weapons when they die. Thus, their items/weapons can be retrieved by the player following their death

Click here to see a scaled-down image of the particle texture sheet I created, which stores all item icons within it. This is the texture that the particle system which displays all dropped items references.

Here are some animations showing various player interactions with dropped items: