Saturday, 30 November 2013

Quest for Avatar

Avatar, or the player class, is derived from Creature class. Then many functions can be used by the Avatar, but sometimes or more like usually it needs a check if the Creature is the player and do something strictly limited to player character.

It's a perfectly valid option, because it can work without problems. Still, I wonder if it could be possible to use Creature class "component" of the Avatar without Creature knowing about the derived Avatar. I guess what is often done is a common class where both Creature and Avatar derive, but it seems a bit difficult to implement. You can also use more generic Creature functions that return information to Avatar class which then decides how to process the data or whatever.

It may sound like this is irrelevant in game programming, but I have noticed that when I improve OOP features of my source code it also becomes easier to understand for me. And sometimes the result contains improved gameplay features as well.

I'm also more experienced as programmer to handle that kind of thing now.

Sunday, 3 November 2013

X marks the spot

The question of terrain or level topology is easy as it is hard. I can make a level theme incredibly fast with the current data-driven engine, but somehow those themes don't satisfy me as they are. Levels need more details and also variations that should be difficult to predict. The slightly predictable level themes in Nethack (and other roguelikes) was something I wanted to fix with this game. But creating such levels is not easy.

Back a while I let go of strict data-driven approach and added special level themes, but at the same time I feel the data-driven code can do more and it already does when I added a special-ish level theme containing lots of lava. If however the data-driven system can't create all stuff needed in a level theme it has to be removed and used a manual generation instead. Hopefully most level themes can be created with the engine.

Even getting all level themes in some kind of physical form seems to be difficult, but it's something that should be done now, because you need levels to navigate in the game world and interact with game objects and since climate and other features play such an important role there must be different kind of themes to try out to see how easy or hard they are simply as terrain.