Monday 22 March 2010

Actors

Solved the init problem with Actor class by using late initialization in derived classes. Actor is in a middle of class chain and has no information of derived objects until they are initialized. I don't know how bad that is, but I can't see any other solution for this. You have to know more than Actor knows to determine which object type is a container or opener. One other solution could be pass that information as constructor's parameter, but it's pretty much the same.

It's almost done now, the only thing missing is determine which monster types can carry items. It's already in monster data and for that I have to add one check to cover it.

Wednesday 17 March 2010

Creatures

Lately been fixing artificial intelligence using data-driven building blocks. This is one of the areas that needs most work, because I had only basic moving for creatures in early versions. In fact I have disabled AI and creatures just sit there, waiting for the programmer to do something about them. I'm glad if I can fill all the missing information in about two weeks and then begin to write the executive AI routines that handle the vast archives of creature data.

Tuesday 9 March 2010

Notes

I may have talked about this earlier, but I have special comments in the source code starting with word "note:". Those parts of source contain a problem I have left to solve later. There are now 74 notes. Most of them are hard to fix and today I pretty much fixed one of them, which involved adding stuff to Score class (which I was talking about in 2008 blog entry). Fixing "note:" problems is as important as anything else in the source code, but they have been difficult to handle, because of generic difficulty or that something is still missing, like serialization which I now can handle, thanks to important experience from Teemu's serialization.

Sunday 7 March 2010

Containers

It's almost month from last entry. I really feel I have now control over containers and there is not much to do with them anymore. Writing container code is hard, because of ownership issue which can be quite complicated in a large scale program. Well, actually it doesn't have to be complicated. I made the usual mistake with container class and tried to give it to too much responsibility. It's easy to think that giving class more functionality will make things easier, but it's not always the fact. It will work only if the class will  handle things that belong to it. Then it doesn't matter how simple or complex the class is.

The annual 7DRL madness is going on, but I have my own battle with Kaduria. They can lose the battle and retreat, but I have to push onward to victory.