Saturday, 9 October 2010

Environmental thinking

Terrain data needs to be refactored, because there are duplicated stuff for it. I probably need only main type for terrains and data associated to different things related to terrain actions. Terrain part has been difficult in Kaduria, because terrains used to be a lot more complex. Now they are just piece of dirt or water etc. But you can't underestimate the complexity of terrain actions since they play such a big role in the gameplay.

If I ever make another roguelike of this magnitude I will certainly make terrain tiles objects that are derived from base class just like all other object types. That would have made things much easier from the beginning. The distinction between objects and terrains cause a lot of extra work.

I need to clear the confusion in terrain part of the source code once and for all. I think it's good to start from the main type data and see what can be included in that, then move to terrain type class. I think this is the task for this weekend.

1 comment:

  1. Sounds good. But then, there won't be much difference between objects and tiles. I decided on the following: tiles are always simple and data-driven, and if they need some complex behavior then I'll place an object on top of the tile, even if it's invisible (doors, plants and furniture qualify for this). Although if you're planning on very rich interaction with common tiles, then your approach is much better (filling up a container with water; burning grass; picking up pebbles from rocky terrain...).

    ReplyDelete