Friday, 11 November 2011

Theme randomness

I'm having trouble trying to determine the stuff that will be generated in level themes. With lots of stuff it becomes more difficult to figure out how to select that stuff. There is a list of stuff to create for each level theme, but I know it's too restricted and predictable. Creating a list is easy, because you don't have to program a logic that "thinks" what could belong to that particular level theme. And that is exactly what I have to do next.

It's not an easy task. There must be a new type of classification of objects just for level creation. Then the level theme could ask an object from different kind of classes to generate in specific terrain area or climate condition or whatever the reason will be.

2 comments:

  1. This is just a thought and an approach I use in my own roguelike (entitled Middlecrest). Have you thought of using polymorphism in your code? Perhaps have a level class and have all your level themes derived from them.

    Then, all those features ("stuff") that you select could just be interpreted differently based on the theme (i.e. in caves this thing is a rock, but in dungeons it's a weapon rack).

    I don't know how your code is actually written, but thought I would throw out an idea.

    ReplyDelete
  2. Level themes are data-driven so it's almost like polymorphism. The code that determines what objects to create in a level doesn't depend on things like that anyway. In a way it's simple. Let's think stuff like fountains. Not all level themes have fountains and in some level themes fountains are different. Different factors can also affect the amount of fountains. So they are not only selected by the level theme itself, but more randomly, depending on various factors. Fountains are just one example.

    Another example: stalagmites can only be created in particular levels and they can't be created in outdoor levels or dry levels etc.

    ReplyDelete