We've nearly finished (finally) with the timeline events. The two remaining occurrances are going to be very similar to the snipers we did last time: set up some location markers and then script the Ghost Warrior bots to take up position.
Over the last three months, some of the ideas that were initially woolly and indistinct have firmed up a bit. Countless tests have shown that the timeline technique is actually quite effective for controlling the pace of the action and building up the threat level at a measured rate. Without getting ahead of ourselves though, I can say that there are holes in the approach that will need to be addressed, so we should be prepared to adjust a lot of what we've done as we create a clearer picture of the game.
Let's just finish the Ghost Warriors and then we'll put the whole timeline together and see what happens.
The middle-game will consist of ten more Ghost Warriors, all medium-weights for starters (although this bit is critical when it comes to balance so we might change that later). Five of these soldiers will take up positions around the bunker at a distance, providing visual evidence that the Angels are surrounded, while the other five will assault the front ramp. Let's look at the tactical map again:
The crosses marked in green are the destinations for five bots that are triggered un-dormant by the event called SpookDefense. The purple crosses show the destinations for the assault group triggered by SpookAssault. I've had to split them into two groups like this because the engine struggles to have fifteen (10 Ghost Warriors + 5 Angels) under script control at the same time. The symptoms of the game cracking under the strain are jerky framerates and bots suddenly losing their textures to become plain white geometry. Interestingly, I found this out well before the creation of the monster pathnetwork last week so it can't be held to blame (although I'm waiting expectantly for path-related problems to raise their ugly heads), it's purely down to having so many bots move at the same time.
By splitting them into two groups, we can move the static ones into position, make them 'sleep' thereby taking them temporarily out of script-control, and then move the others up to assault the bunker.
The scripting for the bots isn't anything we haven't done before, let's look at one of the assault troops:
debugmode 11 dormant 1 ontrigger SpookAssault gotolabel MoveOut sleep :MoveOut sleep 1 onevent Autobegin gotolabel MoveOut dormant 0 gotoactor CoverPoint0 sleep
And here they are in action:
It's alright, but it's a bit generic and vanilla, plus it's an even match between the Angels and the assault group, which would be fine if I didn't know that the Angels might have aleady taken a bit of a battering from earlier events. In the interests of balancing and making the behaviour of the assaulters a little more varied, let's try out a new command 'inert'.
The scripting system works like this: the bot will follow the instructions in the script one after the other until it gets an event generated by the game. Up until now, these events have been determined by us but the game also determines its own events based on bot 'stimulus'. For example, we might script a bot to 'gotoactor CoverPoint0', at which point he'll merrily take off across the desert. When he sees one of the Angels however, the game sends him an event of its own, 'SeeEnemy' and he leaves the script to go autonomous. That's when the AI code takes over and the fighting begins. After the enemy that caused the event has been vanquished, or drops out of sight, the bot sends an event back to the game called AutoBegin. The line that you'll see pretty much everywhere in the bot scripts is:
onevent Autobegin gotolabel Hello
...which is just a way of telling the bot to run the script from the point marked, for example 'Hello', if it reaches a state where it's looking for a script again.
This method is fine, as long as you don't mind the bots choosing to do their own thing when the fancy takes them. Sometimes, however, that's not what we want and that's when the 'inert' command comes in handy. 'Inert' stops the bot from reacting to any of the events sent by the game that would cause it to become autonomous, leaving it under script control indefinitely or until the script sets 'inert 0'.
To try it out we'll script two of the assaulting Ghost Warriors to take up kneeling positions in range of the bunker and bombard the outer ring of the fortification with their assault rifles secondary fire mode (a bolt of energy that splinters into deadly shrapnel on impact) all in inert mode. This means that these guys won't be as big a threat to the Angels, neither reacting to them nor hunting them down, but they will still give the impression that the bunker is under a concerted attack and the bouncing shrapnel will still present a hazard.
This is what the new script looks like for the bots supplying the suppressing fire:
debugmode 11 dormant 1 ontrigger SpookAssault gotolabel MoveOut sleep :MoveOut inert 1 dormant 0 gotoactor CoverPoint23 setstance crouching turntoactor LookTarget5 setfocus LookTarget5 firealt 10 gotolabel MoveOut
...and here they are in game:
Good enough for now.
This stage of the game represents a shift in the balance of power. Up until now the player will have had free range of the map, pretty much, but now the Ghost Warriors have well and truly arrived and we need to let the player know that she is in quite the predicament.
To facilitate this, we move the remaining five Ghost Warriors into visible positions surrounding the bunker, but well outside the range of the ubiquitous Assault Rifles I've been using as everybody's primary weapon. I'm hoping this will have an interesting psychological effect on players that are used to attacking every threat that appears until they've blasted themselves some breathing space. Trekking out from the bunker to get into range of the obvious potential threat will put the player at a much bigger risk now that once familiar territory has become infested with Ghost Warriors. On the other hand, the watching Spooks aren't doing anything overtly threatening (yet) so maybe the player should just run the clock down.
Scripting these bots is easy, just a question of un-dormanting them and gotoactor-ing them into place. Here's one watching the bunker:
A few tests reveals a problem, however:
...if the player has managed to scavenge a sniper rifle from our scouts earlier, it's the work of moments to headshot the watching Warriors and the illusion of threat is gone. If they player has acquired both sniper rifles, then they'll even have 20 shots to take out five enemies.
One solution to this is (ugh) respawning enemies. I usually hate this technique in games, but then I also hate timed levels and that's not working out too badly. In a desperate attempt to justify it, it's not like these watchers are going to march endlessly on the player, nor are we asking the player to find an exit route or do some other taxing activity other than wait around while they watch the watchers watching them. As long as the player stays holed up in the bunker they shouldn't derive much frustration from the maintenance of the number of Ghost Warriors surrounding them.
We making a big deal out of the notion that the Angels are surounded by a vastly numerically superior force and I would have preferred to go the 'simulation' route of putting in a numerically superior number of Ghost Warriors to represent that at one to one. Unfortunately, the technology just won't handle that many bots at the same time, so a replenishing system is starting to look attractive.
Setting it up is easy, virtually the same system as the artillery shells, in fact. Five Actor Factories maintain a minimum of one 'owned' bot each, spawning at one of three places per Actor Factory. Each Actor Factory assigns a particular script to the bot it has spawned, enabling us to move it into one of the five positions surrounding the bunker. By placing the spawnpoints at varying distances from the destination point we put the respawning bot into play for a little while. By killing off a watcher bot she buys some time until that position is taken again.
It would be nice if we could vary the destinations for the respawners, either by creating a new class that chooses a script at random or some other method of shuffling the deck. In the interests of progress however, I think we'll save that for later.
The last event concerning the Ghost Warrirors is the final assault. This is when Yamagata Aritomo will make his appearance on the battlefield in his scary battlesuit. Managing the drama of this situation, trying to achieve the impression that all is lost, just before the cavalry arrives in the shape of the dropship, is going to be difficult. Working through all of these timed events it has become clear that the best approach is to work iteratively, to get some of everything into place and then play through it a few times. Testing it through play is the only practical way to get an impression as to how the whole experience will eventually pan out and which areas need further consideration. This is all just a fancy way of saying that for now we'll set up Aritomo and his bodyguard in a similar configuration to the assault group above (sans the suppressor tweak).
Here they are at their starting point:
That concludes the timeline section of our plan and it's time to assess all the work we've done so far and see what influence it will have on how we are to proceed. Next time we'll get all of our events into place and play through the entire hour, making notes as we go along.