Friday, September 9, 2011

Monsters

Hey

I have had some trouble making up my mind what to code next. I got so much to do I don't know where to start :) After a while I decided to start working on monsters to get more than plain templates in to the game.

So far there are following races for monsters: spider, human, dwarf, drow, kobold, rat, mouse. Of course there are more to come but I think I can start the work with those. Before this post I had skeleton, a template, for the monster but It was basically just an object standing there, not doing anything.

I'll show how the monsters are created by using this "diagram" to show inheritancetable.


  • Monster
    • Living
      • TimedEntity
      • ActionEntity
      • SocialEntity
      • Object
        • Serializable
With this design the player class is actually no different to monster class, just replace Monster with Player and thats the design for player class. The game actually only needs Object class to make an object visible in the game world, everything else is just fine tuning stuff.

Everything below Living class is up and working but changes and new features are mainly added to Living and Monster classes. Currently I am working on some sort of random generation of monsters by race and wait to determinate correct spawn area for different monsters in map. After that I have to do some sort of low level AI for movement. The combat AI still faraway :/

4 comments:

  1. What are the specific features of each class ? I imagine Living has a health value and can die, but this apart... SocialEntity ? has a facebook account ? :D

    ReplyDelete
  2. Object holds the actual attributes needed to show for example '@' at the certain tile ( Object is base of every object in game, items, armos, monsters etcetc )

    If something inherits SocialEntity, then it can be communicated with.. usually mobs has this ability and few special objects ( singing sword for example )

    If something inherits ActionEntity then its able to do any kind of actions ( moving, attacking etc ). This is needed to make anykind of AI. Objets gets action points which it can spend or save during turn.

    TimedEntity means it can be assigned into timer. This means for example that Player is assigned into timer with value 'hungry' which ticks every turn ( or in assigned intervals ) and when it hits assigned value it executes a event which fires function which does something.. in that case the player would die on starvation..

    That can be applied to poison effect, tiredness.. and stuff like that..

    Living holds mostly npc and player related stuff like inventory, equipment, primary stats and skills.

    ReplyDelete
  3. Oh ye and obviously Serialization class is inherited from Object so every class which inherits Object can be saved into data stream.

    ReplyDelete
  4. Looks great so far Pelha!

    -Isher

    ReplyDelete