0 Members and 1 Guest are viewing this topic.
##### What is Smart Spawn:Smart Spawn modifies spawn points on the server throughout the game such that players are more likely to spawn close to their allies, and less likely to spawn close to their enemies.##### What is Spawn Merger:Spawn Merger modifies the spawn points once at the beginning of a new map such that the team spawn points are merged. What this means is, with the exception of the first respawn, will be capable of respawning whereever anybody else was able to respawn at.This script comes with Spawn Merger built in, and is enabled by default.##### Configuring the script:It is possible to configure the script by modifying config.ini. Under the [Defines] category, adding any of the following text will change the bahaviour by the description provided:SPAWNMERGEREnable Spawn Merger. If this is not set, Spawn Merger will not be in use, and all the other related configurations will be ignored.SPAWNMERGERDMInclude team 0 in the list of teams to merge spawns with.SPAWNMERGER2Include only teams 1 and 2 (and 0 if SPAWNMERGERDM is set) in the list of teams to merge spawns with, independant of the gamemode. This is particularly useful if the gamemode it a team deathmatch, but only teams 1 and 2 are in use.SP_WELCOMEMESSAGEWelcomes players into the server. This will inform joining players simply how Smart Spawn changes the server.SP_UPDATEONKILLUpdates the spawn points right after somebody is killed.SP_UPDATEONAFTERRESPAWNUpdates the spawn points right after a player respawns. This is used to make it less likely for enemies to spawn at the same spawn point as you or near you right after you spawn. Similarly, this makes allies more likely to spawn at the same spawn point as you or near you.Warning: When developing this script, errors were encountered when using this. It is advised not to use this.SP_HIDEWARNINGSIt is possible that the number of spawn points allowed in the server at a given time reaches its maximum. When this happens, the script writes to the console a warning message saying that so more spawn points are available. Enabling this will remove this warning from appearing.SP_DEBUG1Used for debugging purposes. Every time the spawn points are updated, this will write to the console showing how many spawn points there are for each team. This compares how many spawn points the script expects and compares that to the actual number of spawn points. If they do not match, an error is shown.SP_DEBUG2Used for debugging purposes. Every time the spawn points are updated, this will write to the console stating whether new spawn points are needed to be made, or existing spawn points are needed to be removed.SP_DEBUGEnables SP_DEBUG1.DEBUGEnables SP_DEBUG1.##### More advanced configuration:It is possible to modify or replace the default spawn probability calculation formula. The calculation is a two-step process:1) Calculate weights for each spawn point, later normalized. The default method is:The current method for calculating weights (1) is:Weight = FoeFactor / FriendlyFactor, whereFriendlyFactor = (sum(Distance^2) + SP_Smoothing^2) / FriendlyCounter, where Distance is the distance between the spawn point and each friendly player, and FriendlyCounter is the total number of allied playersFoeFactor = (sum(Distance^2) + SP_Smoothing^2) / FoeCounter, where Distance is the distance between the spawn point and each enemy player, and FoeCounter is the total number of enemy players2) Calculate the number of server spawn points per spawn point. The default method is:Floor(SP_Offset + SP_Gain * Weight)The constants SP_Smoothing, SP_Offset, SP_Gain, SP_VDistGain, SP_HDistGain can be found in smartspawn.pas. The default values are with a description:SP_Smoothing = 25.0;Used in calculating weight. Smooths out the distance formula such that not only spawns that you are on top of but ones that you are near are also more likely.SP_HDistGain = 1.0;Used in calculating weight. The gain for horizontal (x) distances. Typically this is a value near one.SP_VDistGain = 0.6;Used in calculating weight. The gain for vertical (y) distances. Typically this is a value near one. Lower values are better for maps with a lot of horizontal spread and multiple paths on top of each other, such as Arena2. An example value of 0.4 means vertical distances are treated 2.5 (1/0.4) times larger than they appear. Imagine stretching the map vertically by that much.SP_Gain = 5.7;Used in calculating server spawn points. The multiplier for the weight (a number between 0 and 1).SP_Offset = 0.8;Used in calculating server spawn points. The offset number of spawn points. When this is 1, all spawn points will have at least one server spawn point, making the weight a little less effective.To replace the method for calculating the weight, store a function pointer in SP_CalculateWeight. Similarly, to replace the method for calculating the number of server spawns, store a function pointer in SP_CalculateSpawnCount. The following types are defined for each variable, respectively:SP_TCalculateWeight = function(const Team, Index: byte): double;SP_TCalculateSpawnCount = function(const Team, Index: byte; const Weight: double): byte;#### Special notes:This script was made in Script Core 3 in server versions 2.6.4 and 2.6.5.The formula used for calculating the weights and server spawn points are not ideal for gamemodes with no teams on large maps. The reason this is the case is because the formula is designed purely to make it so you will spawn near allies and far from enemies. In a deathmatch game, there are only ememies. On large maps, this means it may take a while before you find an enemy. A better formula might be for higher weights for medium distances, and lower weights for close and far distances. If you plan on using this script on large maps for a gamemode without teams, consider modifying the formulas; refer to section `More advanced configuration` for further information on how to do so.