Combat Scripting
Or, NPC AI.
From what you’ve already seen in combat, there are a lot of options. Most new player ships have 6-8 actions they can take each round of combat; and can only do 5. While some NPCs do less than that – especially low-level NPCs – there are going to be NPCs that have more options. Some a lot more. Having NPCs pick which of those actions to do each round is going to be important – and perhaps more important, who to use those actions on.

For some NPCs, this is pretty straightforward: the random robotic guard has two weapons it fires at the target with the lowest health, every round. For others, like a drone carrier with a rogue AI, that script will need to take advantage of a wide selection of weapons, equipment, and other options; as well as possibly coordinate the drones it is launching. Having a system that can do all of that reliably is important.
Also, one of our goals is player-aligned NPCs. Which means that we need both good enough default scripts; for when your building gets attacked, or when the automatic patrol ship you launched takes on a pirate; but also a way for players to make better scripts if they want.
And right now, NPCs – including offline players – don’t shoot

Options
The first thing we needed was a tool that would allow us to take advantage of all of the options. We went through a few iterations on how to do this best; but the general idea is to have a list of actions with conditions: each round, we go down the list and check the conditions – if all of them are met, the action is chosen; until all of the character’s actions are chosen or the end of the list is reached.
While the idea of this is pretty easy; actually making it work has taken a while. Widmo may talk about this more later; but for now, I’m just going to say that it’s taken a while to make it work.
Human-Readability.
Because players are going to need to use this, making it human-readable has been a priority. Consider the following code:
CoPAAAAAAAAAAAAAAAAAAAAAAghxMzYMzMmZYGzMz0MMMzYGDAAAAAmZmZmZmZmNzMjBAAAzMzMAAAAGYgZMassAyyA2AYGsB
It’s not clear what that means, or anything else about it – you might not even be able to guess what it is (World of Warcraft talents import). I tried to find some other examples; but a Pardus quicklist is a paragraph-long block of numbers; and a Path of Exile import/export code is several pages of random letters and numbers.
Even game scripts are often written in code – and while that’s fine for people who know code; it’s not so great for everyone else. It also poses a problem for us if it means letting people do things on our servers. Instead, I was looking for something that was understandable enough that I could give it to a teenager with no special skills, and they could figure out what would happen.
Collaboration
One of the bigger problems in making this all work is teamwork. If you’re fighting one against one, this isn’t an issue – but fights in VERZ aren’t limited to one on one: one of the early tests we did involved 7 players fighting 3v4; and one of the second tests I’m running once we get this working is deliberately stacking 10 NPCs on a tile and getting as many people as I can to attack the stack. Mass combat will happen.
Which means that scripts need to be able to coordinate. In a large fight, over-focusing one person means that you waste shots on someone who is already dead; while under-focusing means that the other team has a lot of injured but not enough dead. Also, your options aren’t just “fire weapons” – if you’ve got something that makes an enemy easier to hit or take more damage, you want your teammates aiming at that enemy.
Final product
I wish I could show it – but it’s not done yet. I will, however, show some of the examples of what kinds of things are going to be available from our system:
Space Fly:
- Always – Use Erratic Flight – Self
- Always – Use Sting – Enemy Least total health
Macross Massacrator:
- NOT action available (Missile Barrage or Reload) – Shield Boost – Self
- Action Available (Missile Barrage) – Missile Barrage – Enemy least total health
- Action Available (Reload) – Reload – Missile Barrage
- Enemies Descriptor is Missile – Fire Flak Defense Turret – missile with highest total damage, then least total health
- Self Shields = 0 – Repair – self
- Always – Fire Laser – enemy least total health
- Always – Fire Laser – enemy least total health
Building Command Center:
- Enemy total health > 70 – identify target “Base Target 1” – enemy Least total health
- Enemy total health > 70, NOT “Base Target 1” – identify target “Base Target 2” – enemy Least total health
- “Base Target 1” NOT “target locked” – Lock target – “Base Target 1”
- “Base Target 2” NOT “target locked” – Lock target – “Base Target 2”
- Enemy total heath > 70, NOT “Base Target 1” not “Base Target 2” – Lock target – least total health