Monday, June 30, 2008

Items and Equipment

This past week I have been working on the items and equipment system.

Both systems work similarly, using Django's contenttype and generic relationships to connect characters and the items and equipment they hold. Items are just names for right now. There is no programming underneath to make something special happen if you get a certain item, or programming to control what you can do with an item, but that will follow as soon as I figure out how to do it. The number of items a character may have is currently a hard-coded value. That fits with the simplistic nature of the first release. Nothing fancy, you only get 4 items.

The equipment system is even worse. Each piece of equipment has a type, like sword, helmet, shield, and each type has a slot, like on-hand, head, off-hand. Currenly, you may only equip one piece per slot, which makes sense. However, you may not carry extra equipment and have it take up a slot in your item inventory. I know this is lame, and I'll do something different eventually, but I like the thought that if you defeat a monster or find good equipment, you must decide to equip it right there, dropping whatever was previously in that slot. It again simplifies things.

Now, I am connecting equipment with stats. The stat that is increased is based on type, so swords raise strength while attacking, helmets raise toughness while defending, staves raise knowledge. The amount of increase is based on 2 modifiers, the equipment modifier, and the equipment's material. These numbers are multiplied, so you can have a silver sword +2 be as good as a gold sword + 1. Material is going to be a fun system in V, perhaps with quests for rare materials.

Looking at my goals for 1st release, I have a few things left on the back-end:
  • Monster and item generation

  • Monster wandering

  • User creation



Once these are done, I should be able to start working on views for the interface, then pull the interface all together.
Yay!

Tuesday, June 24, 2008

Levelling and Creation

Levelling and Avatar creation have been completed and tested.

Levelling forced me to finalize my Fighter stats structure, and think about how I would flexibly control advancement. I decided that each tribe controls how many points each stat increases for every level, plus maximum Hp and max Sp. Extra will be added to maxes based on knowledge and stamina. Every level also grants Level Points which can be spent on attributes.

For Avatar creation, I learned about the newforms system in django. I built a helper method to do the actual creation, and a form to pick the name, sex, and tribe. After object creation, every new Avatar is randomly assigned to a clan of the chosen tribe, moved to the clan's starting location, given starting stats, and "leveled up" to level 1.

Next steps include:

  • Items
  • Equipment
  • Monster wandering