Crystal Towers 2: Anatomy of a Boss
Oct. 19th, 2009 12:08 pmBoss monsters are usually a bit of a headache to write. You have to think up a cocktail of attacks, weak points and strategies that are balanced to be difficult to cope with at first but possible to learn through experience, and then write the whole thing's behaviour, which can often get quite complex. As evidence that I'm still working on the game, this is the seventh of the bosses I've made, and at the moment it's called Beam Stack.
The general approach that I'm using for bosses in this game is treating them as loose sort of state machines, with one string called State which is the main thing that decides how the boss should behave at any time, along with a heap of other variables on the object that describe more of the details of those behaviours. By making at least one of the possible actions in each state being to change the contents of State to something else (and having what it changes to possibly dependent on other conditions), the boss can move between behaviours in sequence.
( A more in-depth explanation of how it all works, for the benefit of those interested, coders, ZZTers, and the insane )
And all of that goes together to form the thing that you see in the video. After I first set it up it took me ages to get past it the first time, but now I can do it fairly reliably - if other people find the same thing, then that's just the right difficulty of boss I'm aiming for.
The general approach that I'm using for bosses in this game is treating them as loose sort of state machines, with one string called State which is the main thing that decides how the boss should behave at any time, along with a heap of other variables on the object that describe more of the details of those behaviours. By making at least one of the possible actions in each state being to change the contents of State to something else (and having what it changes to possibly dependent on other conditions), the boss can move between behaviours in sequence.
( A more in-depth explanation of how it all works, for the benefit of those interested, coders, ZZTers, and the insane )
And all of that goes together to form the thing that you see in the video. After I first set it up it took me ages to get past it the first time, but now I can do it fairly reliably - if other people find the same thing, then that's just the right difficulty of boss I'm aiming for.