Friday, 10 April 2009

Level class refactoring

I'm browsing through the Level class and trying to clean it, plus programming some missing things at the same time. It's quite an overwhelming task, because Level is a huge class. When I separated ground objects from terrain tiles (they became actual objects) the change was bigger than I first thought so that's basically what needs to be refactored in Level.

Sunday, 5 April 2009


I need some planning with actions. First I have to think how actions are broken down to atomic pieces for both player and monsters and what data actions need. The AI for actions is going to be really tough stuff. I don't have experience with sophisticated AI and it's first time I'm trying to do that. I have a vague idea how it's going to work, because I have thought AI issues a lot during the development.

Saturday, 4 April 2009

The new Avatar

I'm refactoring the player class and also U_Npc, the base class for monsters and the player. It's now getting slightly interesting, because I'm restoring the actions which the player (and monsters) have in the game world. They caused some serious problems before, because I wasn't really good at figuring out where actions should take place. Even I knew monsters share some actions I didn't (for some strange reason) place them in the base class.

Writing the code for actions is I think the hardest part in roguelike project. You know, those innocent looking commands like eat, look and search. They rely so much on the engine core, that if the engine is broken then the commands can't work, or they require constant refactoring to match the changes in the engine. Of course, writing modular code is a good way to prevent such problems, but I really didn't know how to do that until now.