Some bug fixes. Another improvement to the way this selects its spawnpoints. Added code to put the mutator to sleep if no players are connected to the server.
*Update v1.2 - Bug fixes and some code optimizations. 1 new example ini file.
Inspired by some of the code in the TWT_Zombies mutator that controlled the spawning of the zombie hordes.
I liked the way it built its list of spawnpoints, the way it tries to spawn the creatures out of sight of the player if possible, and the way it would maintain the desired number of creatures in the map as they were killed.
While I was doing the Zombies5 rewrite, I suspected that the code involved in the actual spawning of the swarms could be optimized considerably, but didn't get around to trying any changes to those functions during that project.
I also wanted to see if I could adapt that to spawn swarms of any class of pawn.
This is the result.
Copy SwarmSpawn.u, SwarmSpawn.int and SwarmSpawn.ini into your UnrealTournament/System folder. *Default ini included will only spawn a lot of SkaarjWarriors. You need to edit the ini to make this do what you want. *EDIT. Recommend you edit the ini file and change the SDS value for the 1st few swarms if you are going to use this on small maps. v1.1 crashes if it can't locate any spot on the map for oversized pawns it seems. This will be corrected in next update.
For servers, same. SwarmSpawn does not need to be a serverpackage. *If you have it spawning pawn classes that are not default UT classes, those will need to be in the ServerPackages section of your ini.
Basic usage features:
Spawns up to 64 different swarms.
Optionally change the size of the pawns in the swarm.
Advanced usage features:
Optionally adjust up to 16 settings for each swarm.
Able to adjust class default settings for each swarm prior to spawn, and then restore the original default value.
Able to adjust any pawn class default settings.
Configuration for this is via editing the SwarmSpawn.ini file.
Recommend editing your files with other names such as the ones in the example ini files provided, and copying/renaming the one you currently wish to use to SwarmSpawn.ini
CheckRate is how often the mutator will check to see if any pawns need to be spawned, and spawn them as needed. 1 swarm will be checked each CheckRate, so the best value will depend upon how many swarms you have defined, how fast they are getting killed etc.
Recommend starting at default value, and adjusting up or down as required for your current needs. Keeping this value as high as possible will help with performance if you are running lots of other mutators with it. No checks made on the value. Recommended range = 2 - 60.
Note, if the mutator checks all the swarms you have defined, and none of them need anything spawned, it will automatically throttle back the checks to CheckRate * 4. Soon as it detects any swarm needs a pawn spawned, it will return to the default CheckRate, or the rate you have set in the ini file.
If nothing spawns except 12 double-sized NaliCows, your ini file is either missing or the first class you have in SwarmInfo is invalid.
If true, the mutator will log considerable info in the UnrealTournament.log file. Recommend leaving at default value of False unless you are testing or chasing a problem with a setting that is not functioning the way you want.
If True, mutator will attempt to spawn all the defined swarms into the map as soon as the map is loaded. If False, mutator will spawn each swarm 1 at a time at the current CheckRate.
Each SwarmInfo line needs at least 2 values set:
SwarmClass: The class name of the pawn you want to spawn. Needs to be enclosed in quotes. Qty: How many to spawn in this swarm. No quotes needed.
These values, and any optional ones, must be enclosed in parentheses.
You can have up to 64 SwarmInfo lines in the config file. Note: Each of them MUST be 1 line with no breaks. Recommend setting WordWrap OFF in your favorite editor when working with these ini files.
Don't be alarmed, the SwarmSpawn.ini file need only be as complex as you make it.
I attempted to make the configuration as simple and user friendly as possible.
Everything is basically optional. (Other that specifying at least 1 valid class...)
If the mutator encounters a bad class in the ini file, it will stop loading it at that point. It will however run with anything it was able to load from the ini file prior to the error.
Here is a bare minimum example that will spawn 1 pawn into your game: (A Titan in this case)
*Included example file SwarmSpawn_Skaarj02.ini is basically the same as the above except with much larger numbers in each swarm. (And the 3 largest swarms have green blood....) It also has bSpawnAtStart set to False as I was using it to test if there was any spawn lag.
This example shows how to spawn some TWT_Zombies into your game. (72 of them) This of course requires the Zombies5 package is available.
I decided right from the start to handle processing for DrawScale differently than the other optional settings.
Discovered while testing and writing this that even more values should be scaled in conjunction with DrawScale for things to work right. More than I was adjusting for re-sized pawns with the Dropper mutator or the Random Monster Sizer mutator.
For example, if you are spawning giant Zombie5 pawns with the Dropper, or adjusting their size with the Random Monster Sizer, it breaks their attack as neither of those scales the MeleeRange variable.
This mutator fixes that.
Here is a list of all the other default Pawn variables that will also be adjusted in addition to DrawScale when the SDS variable is present for a swarm:
Mass GroundSpeed WaterSpeed AirSpeed AccelRate JumpZ MaxStepHeight MeleeRange BaseEyeHeight EyeHeight Health Buoyancy
CollisionRadius & CollisionHeight also get adjusted via a call to the SetCollisionSize() function.
If the pawn happens to be a ScriptedPawn and has a shadow, the DrawScale for the shadow is also adjusted.
You can override any of these changes via the optional settings for each swarm if needed.
Note, some of these values might be over-ridden by other mutators, or the pawn code itself. For example, the unreali.bird1 class and classes that extend it (NewBirds_Beta1...) have code that resets the AirSpeed variable back to default. Possible ways around that explained a bit later in this document.
For each Swarm, you can optionally specify up to 16 settings for most any variable the pawn has that can be changed either via direct assignment to each spawned pawn or to the pawn class before the swarm is spawned.
It will spawn 2 double sized Titans, 40 mini-brutes, and the mini-brutes will have green blood.
SSet0 is the 1st of the 16 optional settings you can have for each swarm. Note it also needs to have its unique variables enclosed in parentheses. Both the setting name, (SName), and setting value, (SVal), need to be in quotes regardless of the data type.
You can have up to 16 of these in each SwarmInfo[n] line. i.e. ,SSet0(),SSet1(),....,SSet15())<-- Closing right parentheses for the SwarmInfo line.
Here is another example using the Zombies5 pawns. In this case, all the zombies have green blood, and the female zombies are giants. bDebugMode is enabled for this example.
This next example requires that you have the NewBirds_Beta1 package installed.
It spawns 3 swarms of the Bird3 class that will attack players and bots, and 3 of the Bird2 class that just fly around. In various sizes and colors. Also adjusts the CircleRadius and bCircling variables for the 2 of the swarms.
This example introduces the bPS variable. (bPreSpawn - boolean)
You should set this True in cases where the value has to be set in the class before the pawn is actually spawned. The mutator does restore the original class default value after the swarm has been spawned.
This is the same as the previous example, except it has bDebugMode True and contains an extra line that adjusts the default AirSpeed variable for the NewBirds_Beta1.Bird2 class globally. (SwarmInfo) Note that line has both Qty=0, and bPS=True. Both of those must be set for a global change to take effect. No pawn is spawned in this case.
Since the Bird pawn source contains code that resets the pawns AirSpeed based on the default class value, this is the only way to make that happen. (That I could find....)
If you need to have settings of this nature adjusted, but don't want to globally adjust the value for all pawns of that class, you are at the point where you need to copy, rename and re-compile the class, and your problem will be solved. (I think...)
Then you can just place your new setting in the defaults of your new class, and still have the option to adjust it or other settings via this mutator without disturbing the settings for the original class you started with.
Recommend trying settings with bPS=False at first. (or just absent from the line. bPS.default = false)
If that doesn't work, or you know it is a setting that needs to be set before the pawn spawns, then try with bPS=True.
Only use the global class setting option as a last resort, or in cases where you are intending to change that value globally for all pawns of that class.
I think that is it for version 1.0 of this.
More testing is needed, but I dont know if anybody has time to test all the possible configurations. I have been doing a crazy amount of tests during development, but have only scratched the surface.
This is not intended as a replacement for either the Dropper mutator or MonsterSpawn. It spawns in a different way than either of them, and has different optional settings.
It should be able to run at the same time with either or both of them, in any configuration you can come up with.
RE: The Source Code.
Source code is included in the Classes folder for informational purposes only.
I request that nobody change or redistribute this in any form other than this original zip file.
2 main reasons.
1. Still have some ideas for the next version if there is any interest in this. 2. It breaks easily. Bad things could happen. (The horror.......)
Last note. The testing with this has pretty much all been with various ScriptedPawns and FlockPawns.
(Ran some Blob swarm tests. Spider Physics are cool. Blobs climbing up the walls. They are still basically unusable in real games, so those ini files were not included. Blob & BlobParent need a rewrite...)
Did a couple of tests with it spawning class BotPack.TMale1Bot, with ugly results. Very mean, skinless bots show up and they spam the log file with a lot of warnings and errors.
Recommend against using this with bot classes, unless of course you can figure out settings to specify that will make them work correctly with this.
Sorry for coming back after such a long time, but i think have realized what is the problem. The dropper doesn't work correctly with pawns spawned by swarmspawner when the SwarmDrawScale parameter is used (the rescaled pawns don't drop any items).
Note. This will not work with U1. I compiled it with Botpack as an edit package. DERP!!!!
RC2, will work with U1 and UT. It will most likely also fix the errors inherited from the Fly code that occasionally cause the warnings in the log. (State TacticalMove. Function PickDestination craps....)
The default sightradius for the zombies is set at 8200, but if you use the SwarmSpawner mutator instead of the mutator included in the Zombies5 package, I think you can adjust that. (Haven't testing adjusting that specific setting yet,....)