i haven't really played any of the modern castlevania games; the most recent one i played was sotn i believe. but the bosses in sotn didn't seem that hard to code; the hardest part would probably be their AI.
Castlevania bosses don't have much of an AI to begin with. They have a set of pre-defined actions that get triggered in a certain order or randomly, or at least that's the impression I got from playing the games.
Also, on a side note, all modern Castlevanias (excluding the 3D ones) are very similar to SOTN.
That's right. There isn't something i could call an "AI". And the new 2D castlevanias aren't really all the different from SOTN. However I would argue that they contain even more ridiculously huge amounts of content (e.g. the soul system in AoS and DoS). The huge amount of content is what really amazes me and sets it apart from other games(even though the content gets reused a lot). And if there's a game i definitely must see the source code of - it has to be one of the metroidvanias.
Gah.
Moreover latest castlevanias feature around 100 different enemies. How do they handle so much data?
It looks to me like you need general programming experience more than a specific answer to this question.
Please state exactly what additional knowledge i might need.
Or at least suggest some programming paradigms which might come in handy.
Or supply ANY kind of VALUABLE information.
Otherwise I'm afraid your post is of no value.
If i had the experience for making 100 wholly different enemies i wouldn't be there, would I?
and a sniff of
Polymorphism If you would think of an
abstract type or class named ENEMY
you'd see you could come up with very basic or abstract methods. move() for example.
by overriding such a method move() you could simply give differnt enemies different ways of moving, like flying, like a slime, running towards you, seek player position etc etc etc.
member_variables could be used to keep track of speed, force, healt, attackstrength and much more.
I think this method would be more suited for games having not more than ~50 enemies.
I'd like to keep enemies as "data"(2d joint model+scripts) and not really a hard-code anywere near the main-code or engine. I could be wrong though.
Has any of you stumbled across an open-source game featuring vast amounts of content and enemies? (A game on
http://happypenguin.org/ or something?)
I wouldn't let the way you want to graphically build up your enemies decide too much about the actual class. Either way if you choose to build up your enemies from sub-images or just from pre-drawn images. An enemy will have 1 or more image-frames. to be put in 1 place or more then 1 at the same time. I spotted an enemy on the youtube with an enemy with 2 very big hands, such an enemy obviously will need more then 1 image on screen ...
2D bone model with several defined actions and animations would cover a wide range of enemies, including some of the coolest bosses like these two:
(Castlevania: OoE, Eligor)
(Castlevania: SotN, Galamoth)
+ ability to script special custom "parts of bodies" (like a lightning rod in second video)
+ ability to script custom behaviors (chasing a player with a huge hand or a sword)
+ a list of scripted special attacks (like lightning, fireballs, lasers, etc) which could be emitted from any of the parts or by the player or be called from any script
+ a particle emitters attachable to any of the parts (like a bleeding monster)
+ detachable parts (like a hand you could chop off)
+ ability to mark which parts do damage and which parts can take damage
+ bone/tile interaction scripting
etc
It's a huge amount of work, but i think it's a reasonable model and leaves plenty of room for customization via scripting.
The actual enemy behavior is going to be scripted, each having a separate script file.
I think i get you, but i fear a little your going to be writing 100's of roughly the same scripts. try to write as high-level methods first, you'll see you can re-use everything.
and then you could just tell your desired new custom enemy to use a few of those methods, tell it its member-variables and feed it an array or 2 with images, and give it a scary latin-sounding name
The scripts basically will contain information about which actions/sequences of actions to trigger under which conditions, including information about chasing, etc.
Probably some of the scripts will be similar, but there has to be a way to break them apart and define some reusable basic chasing/movement behaviors.
Yeah, I'm trying to strike a fine balance between customization, code reuse and ease of making and debugging new enemies. And i really don't want to impose any kind of restrictions on what could be made within the object model.
The biggest challenge seems enemies which consist of several seemingly separate parts working together, like this boss:
http://www.youtube.com/watch?v=pyz39w_FqyI (Castlevania: PoR, Loretta & Stella)
But it still seems doable within my object model: by using an invisible joint between 2D skeleton model consisting of two animated parts. Scripting a boss like that would clearly be a challenging task nevertheless.
Thanks for ideas!
Try however to be more specific, giving a more precise code snippets in a language of your choice/pseudocode/etc. As in "how would you do it"? Much appreciated!