First of all, i tried to make the title as short as possible, but when i say 2D platformer Boss i’m having as reference bosses from games like " I wanna be the Boshy" or " I wanna be the guy" ,“Dead Cells” and even “Salt and Sanctuary”. Also, the title says 2D Platformer boss, but it doesn’t necessarily needs to be a 2D Platformer Boss, just fulfill this discussion. I’m saying Paper 2D because that’s the type of game i’m making.
So, i was starting to learn how to play with AI and when i tought i was good enough, after making some very simple npcs that would just detect you, go towards you and attack you with what they have, i tought i could make things a little more complicated, and with complicated i mean a Boss. The boss couldn’t be the most complex because i didn’t have enough assets, but i had enough to play around quite a lot. Oh, and it was all with Paper2D.
The boss was basically Hoshigaki Kisame from Naruto, i could find quite a lot of sprites for him, like defend(which i didn’t implement on the boss), strong attack, weak attack(that was a combo of 3 hits) and 3 specials. I also had assets for “Boss Stages”, but i didn’t even tried to implement it because my problem appeared right on the beggining.
What i had done so far was : Strong attack (it would knock you and throw you), the Weak Attack (that were 3 consecutive hits) and his 3 Jutsus (specials), but after implementing and testing those things i realised i had no idea on how to “Code Design” the actual Boss. I was simply using random values to choose what attack he was going to do and if it was a special, choose which one, randomly, and putting a cooldown on his specials. After i realised it was really bad, I tried to make some basic Stage system to try to balance a little bit, making him only use certain specials at certaing HP or below. Needless to say it worked, but it felt terrible. Totally didn’t feel like a Boss. Some times the fight would start and he would kick the **** out of me with several specials in a row, or simply don’t use it for quite a long time. When he reached his Final Stage , sometimes he would cast several different specials in sequence, and if i didn’t have anything to run i’d simply die. Everything was random, the fight could be extremely easy and sometimes just impossible.
And this is what i want to discuss, how to actually Design the code for bosses like those, how he decides if he’s gonna run after you and use a melee attack, or if you go too far he’ll use a ranged attack, or try to keep distance to throw his ranged attacks, when to use special moves, which ones, how a new “Boss Stage” could affect him, etc , instead of just random stuff. How to design things like patterns to the boss, even if with some randomness, so the player can actually have a plan and don’t play with luck only.