Today I'm going to code in a very cool new feature - skill casting guards! We've got 33 skills to play with and can have all sorts of awesome new enemy types to fight against. You'll be dodging enemy plasma balls, shooting through the cracks of enemy force fields, using your skills to reveal sneaky invisible enemies and more! Not only will this make Stealth significantly more diverse and entertaining to play, but it will also teach players how to fight AGAINST skills in PvP, which is just as, if not more important than using the skills themselves.
Automatic Skill CastingIn the map editor I will have the ability to add skills to the guards. I'm thinking you will be able to customise a few things. The skill itself, the skill level, what difficulty levels the skill will work in, the casting rate, a damage multiplier and a few other things. There will then be an add skill button which adds the skill to the list. Here is a very ugly mockup of how it will look:

So down the bottom I'll have a skill dropbox, you select a skill like Force Fields. Then you configure the level and what difficulties this will work in. Then there are a few specific properties just for Force Fields. I'll need to code these in on a skill by skill basis. Here you could have a damage multiplier on the explosion, an enemy range the guard must be within before he casts the skill, and a timer which makes him cast the skill every 15s. You then click the Add Skill button and it appears up the top left in a list, with numbers underneath showing what difficulties this skill will be used in. Lots of configuration here!
Next up I need to think of how each of these skills are going to work. Of course the skills in MF are very complex and I'll never code an AI that can cast the skills as well as a human player will, but that's ok. The guards don't need to cast the skills in a super smart way, they just need to do something interesting so we have lots of varied enemies to fight. Now skills in MF can be broken into 3 main categories:
Pure Passive SkillsThese skills will be very easy for me to code in. I won't really have to add any specific AI for these skills, simply give the guard the passive and let them play as normal. If they have Final Focus they will simply gain accuracy when it triggers, if they have Disabling Drop they will disable you if they happen to land on you (which a map maker can configure with way-points), and if they have Static Charges they will naturally gain mana as they shoot at you (and give you a very nice positive penalty to exploit too!). Easy stuff!
Add-On PassivesThese skills are also going to be quite easy to code in. A skill like Stagnation isn't really going to change the AI behaviour of the guard, he's still going to cast Radiate when an enemy is within range regardless. There are a few skills in this category which need special attention though, such as Spike Trap and Smoke Bomb (which are really more like actives that happen to cast at the same time as their base). So I can treat these like the proper actives.
Active SkillsThis is the tricky bit and I'd love some ideas here. There are a lot of active skills which need specific AI to determine exactly WHEN to cast the skill, and perhaps WHAT to do once the skill is cast. This has to be done on a skill by skill basis, so give me your ideas! Again the guards don't need some super amazing AI here, just to cast the skill at an interesting time based on a few conditions. The whole point here is to create a diverse and fun bunch of enemies to fight. Let's go through these active skills and see what sort of AI could be used for the casting:
Force Fields: Simplest approach would be to cast this as soon as they enter combat, which would effectively make them harder to aim at. Plus Bouncing Bullets would passively bounce bullets back at the player and the explosion would hurt anyone nearby.
Radiate: Once they get within 50% of the Radiate range they auto-cast it.
Frenzy: Just cast as soon as they enter combat and keep it on till they die or run out of mana (or maybe the casting frequency could toggle it off after a configurable Xs?)
Assault Armor: Cast once their health gets below X%.
Mana Leech: Very simple, aim at the enemy and spam spam spam!
Invisibility: Hoo boy how do this one? There's really no point doing this unless they're moving. But in general it could be fun if the guards keep toggling invis on and off and moving around, popping into and out of view and taking you by suprise. Maybe they cast it as soon as they spawn and it will automatically disable as soon as they start firing at you. On these guards you could give them 9999 mana so it doesn't run out. Thoughts welcome here.
Venom Shot: Spam that shit!
Blade Fury: Tricky one! They need AI for when to cast it on and when to cast it off. They should cast it on when they get within a certain range, and then cast it off as soon as the burst becomes available (and they're in range). Would be fun to time their bursts and dodge the attacks.
Spike Trap: Basically needs to be treated as a separate active to BF. If a guard has BF they should cast it from a further range and aim the spikes 10m infront of the player. Alternatively just aim them directly at the player as thsi would still reduce the players movmeent options.
Teleportation: This one will be sick. I reckon they just choose a random spot within a 10m radius of the player and teleport to it, taking the player by suprise and requiring quick reflexes to dodge.
Black Hole: Same logic as Radiate, cast once within a sufficient range to slow you down. Probably some sort of smart AI like don't cast on a player if anothe guard already has them locked in a BH, but wait till that expires then take turns.
Smoke Bomb: Like Spikes it's pretty much a separate skill. But maybe the behaviour should still be the same, just cast it when an enemy is in range of the Smoke Bomb instead of the BH? They should probably be smart enough to leave the smoke bomb after casting it though!
Self Repair: When the guard's health goes below 30% turn SR on. Once it reaches 100% turn it off again.
Plasma: Point and click baby!
Energize: Easy one, just cast it once as soon as they spawn.
Shockwave: Lots of options here but the simplest is simply to cast it on a player when they are A) in range and B) holding barrier. The revealing property isn't really necessary for the AI anyway, and in doing this they will probably freeze a few of the player's incoming bullets which will be nice. Smart players could even exploit this by holding barrier very quickly just to get the positive penalty damage reduction.
Lasing Orb: I'm thinking simplest approach here is to simply cast it when they spawn and barrier everywhere to drag it around. Dealing more damage and moving in barrier nice and fast. The Orb itself will need to be deleted either when the guard dies or when the next stage begins.
Bullet Time: This one is a bit tricky as there are so many ways to use the skill. But I think a fun mechanic to play against would simply be a guard who toggles BT on when they enter combat, and then toggles it off after Xs (configured in the casting time). This will routinely unleash a giant blast of seeking bullets at the player which you need to dodge. These sort of enemies would be great to have in Filtration for example so your Shockwave has an extra nice use to freeze these bullet blasts.
Stolen Seekers: This is an add-on to BT but I think if a guard has this coded in the AI could be tweaked to instantly toggle BT off as soon as they have 5 bullets inside the BT.
Of course I welcome ideas and suggestions for how these skills will work, but even with these simple rules it's gunna be great! Even something as simple as having 2 venom guards in the back, 2 Force Field guards in the front, and a dude with Static Charges in the middle would make for some very interesting mechanics. How do you play it? Before you just killed them all in whatever order you wanted. Now though? Maybe you try and kill the 2 Force Field guards first before their FF explosion triggers. Then you intentionally get hit by a venom shots for the seeking positive penalty, then finish the venom dudes off to avoid too much DOT damage. Then finish off all the normal unskilled guards and save the Static Charges guy for last because his positive penalty is sooo sweet and you want the free mana regen. Then from out of no where a boss teleports behind you and you gotta run run run!! Great fun!
Waypoint Skill CastingIn addition to these automatic skill castings, I will add the ability to cast skill at specific moments determined by the guards waypoint system. Just as you can already configure a waypoint to start firing automatically at a certain spot, I will have the ability to automatically cast a skill at a certain time when they reach that waypoint. This way map makers can script more advanced skill usage if they need to. This might be best used with skills like Invis, where they cast it on at a certain waypoint, move to another waypoint and then cast it off again. That sorta thing. I'll have to think about how this will work with each specific active skill though and might need to provide a few additional customisation options.
Anyway gimme your ideas and feedback! This will probably take a week or two to code in but it will totally be worth it. After this maybe I'm confident enough to tackle AI vehicle driving and chemical placement.. but one thing at a time
