One week in and 23 days to go.
Most of my work has been on the engine, unsurprisingly, though I have taken the time to work on some art for the game. My next challenge began this morning. It involves this:These enemies are all static placeholders in the game; I have yet to add their AI. And on that topic… Designing an AI systemWith the original game, I was rushed. I'm rushed now too, but I just happen to have taken a hint from the last time that the copy-paste enemy code reuse in Exile was bad. It got to the point that, while I was working on the old improvements before I lost them, I just deleted all Enemy related code. That also happened to trim 5000 lines of code from the game.In the original 'system', every type of enemy inherited some virtual methods from the Enemy class. And that's where the natural C++ code reuse ended. One of the things I copy-pasted frequently was the billboard drawing code. For each enemy I had copied the same 100 line segment and pasted it in. Collision code? Same thing. Movement code? Same thing.This time, I've been taking bits of code that I know I'm going to be reusing and adding them to the base class. The update method for my Fallen Knight enemy contains a single line:drawBillboard(spr_walk, position);
AI_IDLE
AI_FIND
AI_ATTACK
AI_SHOOT
AI_FLEE
void EnemyFallenKnight::ai_idle() // Starting state
{
if(Map::GetMap().isPlayerNear(this->pos) &&
Map::GetMap().checkLOS(this->pos, Player::GetPlayer().pos))
{
// Wake up, we can see the player
this->state = AI_FIND;
this->clearPath();
}
}
void EnemyFallenKnight::ai_find()
{
// Find a path to player if possible
if(path.empty())
{
path = findPath(this->pos, Player::GetPlayer()::pos);
}
else
{
// Move towards path.front(), then pop it and
// continue on to the next point, until we're one step away from the
// player.
if(nearnEnoughToPlayer)
{
this->state = AI_ATTACK;
}
}
}
wait… so this back up plan would be an entirely different game on another engine right? lol that doesn't sound like a good back up since it would require starting from scratch :P
but the idea is solid, it could be fun but it depends on how it handles multiple enemies and transition from platforming controls into the fighting controls.Well, it's a much easier game to make in a shorter space of time. It'll be 2D, and probably done with GM. I've made a few concept sprites for the player already:
Have to decide what palette I'm going to use; maybe a subset of the NES palette, or something of my own design. I'll figure it out.Multiple enemies I intend to handle carefully; possibly one at a time with potential flanking (And a way to counter that by turning around quickly).As for the transition, that's where I have to be careful. Karateka made the transitions very difficult. For an NES games, the animations of the fighter were pretty fluid, but for some unfathomable reason, the developers used acceleration and momentum for the running. More often than not, you'll run across the level to meet the first opponent, but end up running right into his fist because you couldn't stop on time. I want transitions to be 'instant', and I intend to let the player run up to an enemy, drop into battle mode, pull off a few hits, then leap back again. EDIT: Oh, and there's the possibility of a shield (I've been drawing a few frames where the player is holding one, and working out how that would work on paper).spriting shields on characters and having it clearly visible and not covering other important elements of the character is pretty tough, at least it is to me. Especially top down. i suppose it'll be easier in a side scroller.
what happens if a fight takes place on a small platform or on two platforms with each fighter being on a different one? if the arrow keys handle the sword, how will the player jump? :PIf you jump it'll 'snap' out of the fighting stance and you'll regain control. I want it to be easy to dodge.
And as an addition to that, I want to make sure that the levels are designed fairly, so there aren't any impossible to deal with situations.well you got things worked out pretty far :P seems like you've thought this out more than a mere back up plan lol.
I've had this idea on paper for at least a month, possibly more :P
I've been getting into the habit of writing my ideas down, and thinking them through whenever I have a chance.the sad truth about writing down ideas is that the majority of them will never ever be started, let alone finished :P. but its nice at least, makes us feel really creative when we peek inside that folder lol
Yeah, and it also gives me a pool of concepts or mechanics to work with if I'm ever out of ideas. :P