After a bit of consideration and a very constructive discussion with Xedoh on the topic, I now feel confident to present a gameplay concept for hives. I'm looking forward to feedback on the basic idea. Please don't get lost in details like precise numbers for now. There will be enough time for that later.
The Purpose of Hives
Acid Tubes and Spikers both have a short range and attack basically everything in that range. My idea is to give hives the opposite role: Attack a specific target and pursue it relentlessly. This distinguishes hives from other possible defenses.
From a lore perspective it's worth noting that swarms primarily defend their hive. That they defend the alien base is a useful side effect.
One Swarm vs. Individuals
Splitting the swarm from one entity into several individual insects sounds cool, no question about that. But from a practical point of view, there is only one real advantage of simulating each insect individually: The swarm can split up and each insect can act independently from the others. Having a swarm split up is really only useful if you want to attack several humans at once. That does not really fit with my concept of using hives to pursue a specific enemy. You pay for that little advantage with a large number of gentities. That implies a higher computational cost for the simulation, a larger memory footprint and more required bandwidth. In addition it is harder to program. In short, I think that simulating each insect individually is not worth the cost.
Instead I suggest to simply have the size (in insects) as an attribute of the swarm. This is sufficient for the concept that I will explain below.
The Current Hive/Swarm Behaviour
A hive regularly checks for valid targets nearby. Then it launches a swarm to attack the best available target. The problem is that hives almost completely ignore that target and just go for the closest human instead. As a result, the target selection algorithm, that is used by hives, has hardly any impact on the game. Swarms will also stop to follow a human when they lose sight of it. A swarm that attacks an enemy dies immediately after that. A hive can only have one active swarm at a time. That means it has to wait for its current swarm to either return or die, before a new one can be launched.
The Proposed Hive/Swarm Behaviour
The first change I propose is that swarms don't change their target easily. Instead, they chase their chose victim until it is dead, far away from the hive (which the swarm wants to protect), or absolutely unreachable. In this case the swarm will either choose and chase a new target, if available, or return to its hive. This is the first point where the swarmsize comes into play: Each insect (instead of the whole swarm) can only attack once and then dies. When, say, only half of the swarm is required to kill the target, the other half can keep fighting.
The higher persistence of swarms has one significant disadvantage: The average DPS of hives will decrease when swarms spend more time tracking targets. To counter that, a hive will have several swarms at the same time. Instead of the binary "I have a swarm or not", the hive will have a number of insects available. New insects are produced at at specific rate. When that number of currently available insects is >= the default swarm size, the hive can launch a new swarm. One hive will not attack the same human with two swarms at the same time, but it can attack two humans at the same time. Also, when a swarm kills its target, it can then attack the human that is targeted by its brother swarm.
A newly constructed hive will have one full swarm. The total number of insects a hive can support (at the hive or in flight) is 3 times the standard swarmsize, so it can have three full swarms at the same time.
Moreover, only two swarms can be inside the hive at the same time. When a hive reaches that limit (and has no swarm currently outside), it will send on of these two swarms to patrol the area. The current idea is for that swarm to randomly choose structures in the vicinity of its parent hive and fly around between them. Should it detect a valid human target, it will chase it. Then it will either attack a new target or return to the hive - just like described above. There are two reasons to introduce that patrol behaviour: The patrolling swarm can the same target is its parent hive at the same time (which increases the burst damage) and having swarms fly around the base might contribute to the atmosphere of a living alien base.
I have one more special rule to confuse those of you that have prevailed until now: A hive that is directly attacked will immediately launch a swarm to defend, even if it doesn't have a full swarm available. In that case, the launched swarm will simply be smaller.
An Example
Currently, a swarm causes 80 damage. The obvious equivalent is to have insects that cause 10 damage and a standard swarmsize of 8 insects.
Assume that at t=0s, a granger builds a new hive. Initially that hive has 8 insects - one full swarm. Then it produces new insects at a rate of one per second. At t=8s the hive contains the maximum of 16 insects, so it sends one swarm on a patrol around the base. At t=16s, the hive contains 16 insects again and has 8 insects on patrol. With three swarms of 8 insects each (8+16=24), the hive has reached its maximum capacity and stops producing insects.
A few seconds later, a naked human attacks the base. The hive is the first to spot it, and launches a swarm to attack. A moment later, the patrolling swarm also spots the intruder and attacks. That newly launched swarm hits the target first and causes 10*8 = 80 damage. After that, the patrolling swarm hits the human. Two insects deal enough damage to kill the attacker, so six remain. In the absence of another target, he remaining insects return to the hive. In the meantime, the hive has regenerated 4 insects and is at 8+4=12 residents. The 6 returning insects are added to that. The hive population increases to 18, so it immediately launches a new patrol.
I hope that this example is somewhat helpful. I think it covers most of my proposals.
Gameplay Implications and Balance
My proposal boils down to a complete overhaul of hives. With the suggested attributes, a full hive will cause a very high burst damage (160 almost immediately and an additional 80 soon after that), but require some time to regenerate. After that, they require 10 seconds to produce a new swarm. In comparison, current hives produce a swarm every 3 seconds. Not counting the initial burst, my proposal reduces the DPS from 80/3 = 26.7 to 10.
This damage characteristic (high burst, low dps) further distinguishes hives from acid tubes. It should make suicide rush against alien bases much less effective and promote sustained assaults. An attacking group that can weather the first wave of swarms, will have a much easier time staying put.
They will not, however, have an easy time escaping. The new swarms will be very persistent and quite difficult to shake off. On small maps, they swarms might follow their targets halfway back to the human base. All put togeher, the new system should make high level alien bases stronger, which I think is a good thing.
One might argue that the relatively long distance violates the principle of aliens being close range fighters and humans using ranged weapons. I disagree for the following reasons: The distinction is not a hard limit and we already have goon barbs and painsaws. Also, the sensor range of hives would not be (much) bigger than it is currently, so aliens wouldn't just get a rockedpot equivalent. When you comp close to the hives, however, you have a problem - and that's how I think it should be.
Open Issues
I think there should be some way to see how many insects are roughly available to a hive, but I don't know how to present that information. Any ideas?