kts.MISC_CONFIG – table of miscellaneous config settings
kts.MISC_CONFIG = { ... table of various settings ... }
The table kts.MISC_CONFIG
, defined in misc_config.lua, contains configuration variables that affect the game in various ways.
Most mods will probably not need to change any of these settings, but they are documented here for completeness.
The following fields are available:
respawn_delay
sets the number of milliseconds of delay before a knight respawns after death. walk_time
sets the walking speed of knights; specifically, it is the number of milliseconds that it takes for a knight to walk from one square to the next, at standard speed. walk_limit
sets the amount of distance (between two squares) that must be travelled before you reach the "point of no return"; after this point, releasing the movement key will make the knight continue on to the next square, instead of walking backwards to their original square. This value is measured on a scale from 0 to 1000 (e.g. 500 represents half-way between the two squares). action_delay
is the number of milliseconds that a knight has to wait after completing a standard action (such as an attack or a drop) before starting the next action. turn_delay
is the number of milliseconds that a knight has to wait after turning to face a new direction. crossbow_delay
is the number of milliseconds that a knight has to wait after shooting a crossbow. approach_offset
is how far a knight moves when "approaching" a square (like a door or a chest). This is on a scale from 0 to 1000, e.g. the default value of 250 means that the knight moves one-quarter of the way into the next square when approaching. healing_time
is the number of milliseconds between each health increase when a knight approaches their own home square. healing_amount
is the number of hitpoints added in each health increase when a knight approaches their own home square. slow_regen_time
is the number of milliseconds between each health increase while a knight has the "slow regeneration" effect. slow_regen_amount
is the number of hitpoints added in each health increase while a knight has the "slow regeneration" effect. fast_regen_time
is the number of milliseconds between each health increase while a knight has the "fast regeneration" effect. fast_regen_amount
is the number of hitpoints added in each health increase while a knight has the "fast regeneration" effect. super_regen_time
is the number of milliseconds between each health increase while a knight has the "super" effect. super_regen_amount
is the number of hitpoints added in each health increase while a knight has the "super" effect. quickness_factor
sets the effectiveness of the "quickness" effect. (This also applies to the quickness given as part of the "super" effect.) This is on a scale where 100 means no change, 200 means all actions are twice as quick, etc. E.g. the default value of 150 means that all actions take place 1.5x faster than normal. attack_threshold
is the time difference, in milliseconds, for two attack hits to be considered simultaneous. If two hits are considered simultaneous then special rules are used to resolve them: attack_threshold
milliseconds of each other), then the monster's attack is cancelled and the knight's attack takes effect. This makes the zombies slightly easier to kill, and matches the original Amiga Knights behaviour better. attack_threshold
milliseconds of each other), then it is 50-50 who "wins"; one of the attacks (chosen randomly) will succeed and the other will be cancelled. This ensures a fair result when two knights are attacking each other and each they started their attack at about the same time. melee_delay_time
is the time (in milliseconds) that a knight has to wait, after a melee attack completes, before they can start their next action. att_move_delay_time
affects the situation where a knight presses their attack button/key while still moving between squares. This will commence the attack before the knight actually reaches the new square. By doing this, players can gain a slight advantage – the blow will land slightly faster than if the player had waited until fully arriving in the new square before pressing the attack button. The maximum time advantage that can be gained by this method is att_move_delay_time
milliseconds. (This is set fairly low, so that players can gain a slight advantage by doing this, but not a particularly significant one.) att_mov_anim_time
controls the appearance of the animation in the situation where a knight presses their attack button while still moving between squares. The knight's "backswing" animation will only appear for a maximum of att_mov_anim_time
milliseconds. Note that this only affects the graphics, and does not affect the mechanics of the attack at all. parry_delay
sets the time (in milliseconds) that a knight has to wait after parrying, before they can start another action. door_closed_damage
sets the amount of damage that a knight (or other creature) receives when a door is closed on top of them (for example, this might happen when another knight activates switch or pressure plate). The default value of 1000 is another to kill any creature (except a knight with Invulnerability). knight_hitpoints
controls the number of hitpoints that a knight has. (Note that changing this might require changes to the game client code itself, because the default Potion Bottle graphics assume there will be 4 hitpoints.) item_replacement_interval
sets the number of milliseconds in between attempts to replace "important" items (such as gems) into the dungeon after they are destroyed. item_check_interval
sets the interval (in milliseconds) at which the game should check for "important" destroyed items. item_check_interval
sets the interval at which checks will take place; if a check does find that an "important" item needs to be replaced, then the game will keep trying, every item_replacement_interval
milliseconds, to find a spot to respawn it at, and these attempts will continue until the item is successfully placed. item_respawn_interval
sets the interval, in milliseconds, at which the game should check whether any item needs to respawn as part of the "Item Respawning" feature (which is controlled by kts.SetStuffRespawning). monster_radius
sets the maximum distance (in squares) from a knight that monster generation can occur at. "Monster generation" in this case refers to both zombie activity and the generation of vampire bats at pit tiles. These things do not occur just anywhere in the dungeon; in larger dungeons, they are restricted to the vicinity of players. (The intention of this is to try to make sure that monsters are not generated so far away from the players that the players only have a very small chance of actually encountering them.) monster_interval
sets the interval (in milliseconds) at which the monster generator is run. Changing this is one way to influence the monster spawning rate. (Tweaking the probability values in kts.AddMonsterGenerator and kts.SetZombieActivity would be another, and probably better way.) monster_respawn_wait
is the amount of time after a particular zombie dies, before it can be brought back to life again. This is not measured in milliseconds, instead it is measured in multiples of monster_interval
. The intention of this is to prevent the slightly ridiculous situation where a player kills a zombie, only for the zombie to immediately reanimate again (due to unlucky timing with the zombie activity timers). monster_wait_time
is the length of time (in milliseconds) a monster will wait for, if it chooses to "do nothing" (see also next item). monster_wait_chance
is the probability (between 0 and 1) that a monster will choose to "do nothing" if it has nothing else to do (e.g. if there are no knights in its current room). (The alternative is that the monster would just move about randomly in that situation.) flying_monster_targetting_offset
sets how far away you have to be from a vampire bat before it can bite you. This is on a scale from 0 to 1000, where e.g. 500 represents a distance of exactly half a square. flying_monster_bite_wait
sets the waiting time (in milliseconds) after a vampire bat attacks, before it is able to attack again. walking_monster_damage_delay
controls the timing for animations when a zombie is damaged without also being "stunned". This is a rare occurrence so this setting probably does nothing useful. control_poll_interval
sets the interval (in milliseconds) at which the Knights server will read control inputs from the player(s). Lower values would give lower input latency, at the expense of greater CPU usage. player_task_interval
sets the interval (in milliseconds) at which the player's mini-map is updated. missile_check_interval
is the interval (in milliseconds) at which missile collision detection is done. (This needs to be set relatively low, so that collisions are not missed.) blood_icon_duration
sets the amount of time (in milliseconds) for which blood effects are shown, when a knight is hit. invuln_r
, invuln_g
and invuln_b
set the colour (red, green and blue components, each on a scale from 0 to 255) of an invulnerable knight. paraylzation_msg
and required_msg
set strings for two of the in-game messages. (Note there are many other strings hard-coded into the executable; it is not particularly clear why these two were singled out to be configurable from Lua.) dagger_time_delay
sets the amount of time (in milliseconds) between pressing the "throw dagger" button, in the new control system, and daggers actually being thrown. The reasoning behind this is that the old (Amiga-style) control system required you to open a menu (which took about half a second) before you could start throwing daggers, and it would be unfair if users of the new control system could throw daggers without a similar delay being imposed. The MISC_CONFIG
is only loaded once, when the server starts up. Therefore, changes to MISC_CONFIG
mid-game, or pre-game (i.e. while players are choosing the next quest), will not affect the game at all.
This page is about the server-side MISC_CONFIG
table. There is also another MISC_CONFIG
in the Knights client settings (file client_config.lua), which configures various aspects of the game client's UI. This client-side configuration cannot be changed by Knights "mods" and therefore is not documented here. However, it should not be confused with the server-side MISC_CONFIG
(i.e. the kts.MISC_CONFIG
variable defined in misc_config.lua) which is what is being discussed on this page.
The monster_radius
setting does not quite work as described above. What actually happens is that when it is time to run monster generation, the game calculates the minimum x and y coordinates of all knights in the dungeon, and subtracts monster_radius
from those; it also calculates the maximum x and y coordinates of all knights, and adds monster_radius
. This calculation produces two dungeon positions, which become the top-left and bottom-right corners of a rectangle. Monsters can then be generated at any dungeon position inside that rectangle. What this means is that if all knights are fairly close together, then monsters will be generated only in the vicinity of the knights, but if the knights are far apart (say in opposite corners of the dungeon), then monsters will be generated pretty much anywhere in the dungeon. This is, obviously, not a critical issue, since the monsters will move about and players will find them eventually, but perhaps a future version of the game could implement some slightly more sophisticated logic for this feature.
A mod that wanted to remove the distinction between "fast" and "slow" regeneration potions, and have both potion types regenerate at the same speed, might include code like the following:
kts.MISC_CONFIG.slow_regen_time = 1400 kts.MISC_CONFIG.fast_regen_time = 1400
This sets both slow_regen_time
and fast_regen_time
to the same value (intermediate between the usual settings for these two variables).