Hello TDC! I think it's about time I update my project page on here..
I've just finished a trailer for my current game project. It's taken a lot of doing, so I really do hope you enjoy it! Let me know any feedback you have. Critique is always welcome.
Just liked it on Facebook, Liam. Things are looking grand in that trailer and playthrough.
The AI companions are new since the last Agent Egypt demo... How challenging was it to come up with a workable AI like that? I can sort of intellectualize and visualize it in my head. Are there a bunch of invisible detectors that the AI responds to for jumping and the like?
I'll gladly share how I got the AI working, it was actually much easier than I thought it'd be. I'm really happy with how it turned out, the tag along characters can run through a level from start to finish independently, but they are still somewhat basic.
It uses a platform movement object assigned to an invisible rectangle (for more lenient collisions), then a separate Active Object is used for displaying the animations. And finally, an Active Object which acts as a detector for when the character is within range of an enemy/destructible object that they can attack - This prompts them to initiate their attacking animation and jump forward. If any part of their sprite collides with a target, it counts as a hit, because so far I've not needed it to be specific to the character's blade due to how quickly they attack, and their general positioning always seems to be believable in relation to the object their attacking.
When the Active Object for displaying their animations overlaps backdrop object, they automatically jump up until they are no longer overlapping it. This means they can technically jump up infinitely, but the levels are designed in a way to mask this. It needs to be this way though, as some walls are too high for a single jump to cover, and they can't double jump like the player can. They also jump once when the main player is in a falling state - that may sound a bit strange, but it just gives them a second delay to their jump after the play has pressed jump. This usually gets them to jump over a hazard fairly well. (Though you can use an Active Object detector for specific jumping of course).
That's really the gist of it, I have a lot of other interactions and functions for them such as swimming/taking damage/etc but most of all that is simply taken from my main player events and copied into a new group for the extra characters and edited accordingly.
There are a few glitches with them that I have to watch out for though - If they manage to jump into a wall with a ceiling above it (usually above a doorway), they'll get stuck at the top, between the wall and ceiling. They're also not really capable of making jumps up onto floating platforms - They really need it to be too close to the floor in order for it to work, which isn't good. Although I suppose I could use a detector on either side, and have a 50/50 chance of them either jumping up onto it when the collide with it, or simply ignoring it, to keep it interesting. I'll probably work that in soon actually.
The bottom line is, it's essentially just like making the a standard PMO player, only using automated jumps and attacks when certain conditions are met. Hope that helps anyway!