From King Arthur's Gold Wiki
Revision as of 15:07, 9 January 2013 by Splittingred (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

The gamemode.cfg file is what loads the "rules" of the game mode currently in effect. It must be loaded before the map is loaded.

NOTE: When editing .cfg and .gm files, make sure to copy them to a separate Rules/ subfolder with your own gamemode. Otherwise, they will get automatically overwritten during KAG updates.


Customizing the gamemode is fairly simple, and can be done by editing configuration variables.

Making Bedrock Indestructible

To make the bedrock in the map indestructible - useful for parkour maps or high-bomb gamemodes, you must set two configuration variables:

map_indestructible = yes
map_bedrock_indestructible = yes

Note that map_indestructible does not make the entire map indestructible like it says, as of build 590. Only bedrock is made indestructible.

Limiting to 1 Team

To limit to one team, simply set the teams list to only one team (replace MODE with your mod folder):

teams = Rules/MODE/team1.cfg;

Adding a Warmup Period

This will add a warmup period, or a time when there is a red barrier preventing teams from moving past a certain area, for 30 seconds at the start of the round:

break_time_static = .5
warmup_barrier = 1

If we wanted a more dynamic warmup time, you could set break_time, rather than break_time_static, to dynamically set the time period based upon how many players are in the server:

break_time = 5
warmup_barrier = 1

This would set the number of seconds for the warmup to (# of players * 5 seconds). So, for 8 players in the server, the warmup time would be 40 seconds.

Configuration Variables

The following are variables that can be set in gamemode.cfg:

Variable Type Default Value Description
output_history bool true
player_light_radius u8 32 Distance that a player automatically (without a light source) illuminates the tiles around them.
minimap bool true Toggles the display of the mini-map.
max_zoom_out u8 2 Up to which zoom_lvl can be used. Maximum value is 3.
zoom_level_1 f32 2.0 Maximum viewing scale. ("Zoom-in")
zoom_level_2 f32 1.0 Default view scale.
zoom_level_3 f32 0.5 Minimum view scale. ("Zoom-out")
water_levelchange_time s16 0 Test this for time increment. Rate at which water level (defined in map file) will change. >0 = increase, <0 = decrease, 0 = no change.
water_suddendeath bool false Toggles water level change during sudden death (no units left). Based on water_levelchange_time.
teams string ARRAY References to locations of team configuration files (.cfg), delimited by semi-colon ';'
gamemode_name string "Default mode" Name of the gamemode to display in server browser and in-game.
gamemode_info string "Mine or steal gold" Additional info to be displayed in server browser and in-game during warm-up time.
match_time_formula_a u8 0 Determines match time based on the formula m*(a*sqrt(b*x)) where x = number of players in team, m = map size 0.8<=m<=1.2
match_time_formula_b u8 0 Determines match time based on the formula m*(a*sqrt(b*x)) where x = number of players in team, m = map size 0.8<=m<=1.2
match_time_override s16 0 Length of game in minutes. Overrides match_time_formula if set to non-0.
daycycle_speed u16 0 Amount of minutes full cycle of day / night. *Gold servers only.
daycycle_start f32 0.5 Day/Night cycle position at start of match. 0.5 = noon. 0/1 = midnight. *Gold servers only. Values of the order 0.01 work.
timepassed_teamwin s8 -1 Defines which team wins when time-limit is reached. -1 means no team wins, draw occurs. 0 for Blue, 1 for Red.
break_time u16 0 Defines warm-up time in minutes as a multiple of current players.
break_time_static s16 -1 Warm-up time in minutes. Overrides break_time.
minimum_players_inteam s8 -1 Amount of players on each team needed to start match. -1 to always start when a player joins.
autoassign_teams bool false Distributes players evenly amongst teams when connecting.
autoassign_classes bool false Assigns players a class when connecting based on current class distribution.
do_ingame_autobalance bool true Periodically reassigns player teams during match, if the teams become unbalanced.
autobalance_tolerance f32 0.15 Percentage of team balance that will be tolerated by do_ingame_autobalance. Higher makes for a more tolerant balancer.
red_team_size_ratio f32 1.0 Allows team 2 player-count to be disproportionate to team 1 by a defined factor. Higher increases disproportion.
swap_team_cooldown s32 1800 Amount of time required to pass before player can swap teams (value / 30 = seconds).
balance_teams_on_nextmap bool true Distributes players when starting a new match based on their kills.
playerrespawn_seconds float 3.0 Amount of seconds to wait before respawning dead player.
nearspawn_multiplier float 3.0 Value multiplies playerrespawn_seconds if player dies near their spawn.
death_points s16 0 Amount that player score should be changed upon death (usually negative).
kill_points s16 0 Amount that player score should be changed upon killing something (player / ai).
selfkill_points s16 0 Amount that player score should be changed upon killing oneself (usually negative).
attackdamage_modifier float 0.5 Base value for calculating damage increments. Set higher for more damage!
falldamage_modifier float 1.0 Multiplies base fall damage value. Set to 0.0 for no fall damage.
falldamage_threshold float 7.0 Speed threshold to get stunned (not damaged) from a fall. Smaller value = lower speed.
falldamage_constant float 5.0 Speed needed to get damaged from a fall. Smaller value = lower speed.
friendlydamage_modifier float 0.0 Multiplies base damage value when attacking player on same team (0 = no team damage).
map_indestructible bool false Makes the map immune to almost all damage if true. Currently does not work as of build 590.
map_bedrock_indestructible bool false Makes bedrock tiles immune to all damage if true
builder_hit_damage float 0.5 Damage done by builders on hit.
knight_jab_damage float 1.0 Damage done by knights when jabbing
knight_slash_damage float 1.5 Damage done by knights when slashing
stomp_vel float Sets to falldamage_constant if not set The velocity at which an actor can stomp another. Set to 0 to prevent stomp damage.
stomp_weak_damage float 1.0 Damage done when weakly stomping, and damage taken by the stomper when strongly stomping someone.
stomp_strong_damage float 2.0 Damage when strongly stomping.
wall_hit_damage bool false Toggles application of fall damage when player slams into a wall at a high velocity.
support_factor s32 24 The total support given by structures (-> larger numbers = more skybridges)
support_added_vertical s32 1 The amount of support gained vertically.
support_cost_ladder s32 8 The amount of support taken by a ladder horizontallly
support_cost_bridge s32 4 The amount of support taken by a bridge horizontallly.
support_cost_castle s32 4 The amount of support taken by a castle block horizontallly.
support_cost_wood s32 3 The amount of support taken by a wood block horizontallly
no_shadowing bool false / true Toggles darkness/shadows. *Gold servers only.
build_speed s16 8 Limits placement of blocks based on time passed. Smaller value = faster action. Note: Changing this will cause hacking warnings and kicks.
builder_hitspeed s16 14 Base value which determines attack / gather rate. Varies according to target type that's being 'hit'. Smaller value = faster action.
knight_drawtime s16 1 The amount of time slashes take to charge for a knight.
knight_maxthrow s16 120 Unknown.
knight_maxpower s16 28 Unknown.
knight_speed s16 13 Base value which determines attack / gather rate. Varies according to target type that's being 'hit'. Smaller value = faster action.
shield_stomp_velocity float 5.25 Minimum velocity that is needed to initiate a 'shield-stomp'.
max_bombs s16 3 Maximum amount of bombs that can be carried by a player.
build_arrow_speed s16 25 Rate at which arrows are created when gathering from trees. Smaller value = faster action.
archer_dig_speed s16 30 Rate that archers can 'dig' through 'dirt' tiles. Smaller value = faster action.
archer_drawtime s16 19 Required delay before player is able to shoot.
sword_knockdown s16 12 Amount of time victim is stunned after a successful 'slash'.
small_sword_knockdown s16 0 Amount of time victim is stunned after being 'jabbed'.
arrow_knockdown s16 0 Amount of time victim is stunned after an uncharged arrow attack.
charged_arrow_knockdown s16 12 Amount of time victim is stunned after an fully-charged arrow attack.
resupply_time s16 180 Amount of time you can swap classes and still get proper materials on the tent. Stepping off tent cancels it.
knight_reset_timer_on_hit bool false If true, sets knights "attack" charge to reset when they are hit.
archer_maxpower s16 66 Determines amount of time required to charge arrow shots. Smaller value = faster action.
archer_nodamage_vel float 1.0 Minimum arrow velocity required for to apply damage to target.
archer_max_vel float 15.0 Maximum velocity an arrow can achieve when fully charged. Also determines arrow travel distance.
archer_slow_arrow_damage float 0.5 Amount of damage dealt when arrow is traveling slowly. Based on attackdamage_modifier.
archer_normal_arrow_damage float 1.0 Amount of damage dealt when arrow is traveling at a medium pace. Based on attackdamage_modifier.
archer_charged_arrow_damage float 1.5 Amount of damage dealt when arrow is traveling at at it's fastest pace. Based on attackdamage_modifier.
archer_shoot_arrow_ondeath bool false Allows a dying archer to release a previously charged arrow upon death.
min_shieldbash_horiz_vel float 1.15 Minimum horizontal velocity required to apply shield-bash stun to victim where 1 = running speed.
max_shieldbash_push float 3.5 Maximum velocity applied to victim after being successfully shield bashed where 1 = running speed.
shieldbash_push_factor float 2.0 The amount that a shieldbash pushes.
shieldbash_uppysidey_ratio float 0.5 The angle of the push, between 0 (all up) and 1 (all side) (I think)
shieldbash_knockdown s16 5 Amount of time victim is stunned after being successfully shield bashed.
clientside_shieldbash bool false Toggles whether shield bash happens on client or on server. Leave at server; changing to client can cause issues.
can_shieldbash bool false Toggles the shield bash ability.
collide_when_crouching bool false Toggles entity collisions when player is in crouched position. If false, entities can walk past crouched players.
can_glide_when_bombjumping bool true Toggles ability to shield glide after successfully bomb jumping.
bomb_jump_scale f32 1 Scales the base "jump" velocity when bomb jumping.
mapresource_thickstone u8 4 Amount of stone given to player per hit when gathering from 'thick stone' tiles.
mapresource_stone u8 2 Amount of stone given to player per hit when gathering from 'stone' tiles.
mapresource_tree u8 6 Amount of wood given to player per hit when gathering from 'tree' tiles.
mapresource_arrow u8 1 Amount of arrows given to player (archer) per hit when gathering from 'tree' tiles.
mapresource_gold u8 2 Amount of gold given to player per hit when gathering from 'gold' tiles.
unlimited_resources bool false Toggles inventory reduction of materials from player when placing tiles.
unlimited_ammo bool false Toggles inventory reduction of arrows and bombs from player.
switch_teams_onrestart bool false Automatically swaps all players team association when a new match starts.
new_sacks_in_tent bool true Makes tents not give resources during warm up according to resource_warmup at builder.cfg, knight.cfg, archer.cfg. This variable could be read as “tent_doens't_give_resources_during_warmup”. Also if set to yes, resource_default at builder.cfg, knight.cfg, archer.cfg will have no effect.
heart_fallout_probability u8 2 Toggles hearts appearing when a player dies. 0 - no hearts; 1 - every death; 2.. - randomly probability of 2...
flags_count u8 0 Amount of flags that spawn at tent for each team. Never set to more than 1.
flags_score u8 1 Amount of score given to a team when an enemy flag is successfully captured. (doesn’t work)
flags_respawn bool false Respawns flag to spawn point if it exits the battlefield.
flags_return bool false Returns flag to spawn point of touched by a friendly player.
spawn_tent_onstart bool true Spawns a tent, with flag, at points defined by map (and map generators).
restartmap_onlastplayer_disconnect bool true Starts a new match when there are no players on server.
nocollapsing_nearspawn bool true Toggles the prevention of tiles surrounding spawn-point being broken by a 'friendly' player (same team). AKA Anti-grief.
mirrormap bool true Toggles horizontal reflection of the left side of a generated map.
coins_death_drop_percentage u8 20 Amount of coins a player will drop upon death, as a percentage of total.
coins_damage_enemy u8 5 Amount of coins player will receive when player attacks an enemy successfully.
coins_build_percentage u8 20 Amount of coins given to player when placing tiles based on percentage of material used.
room_config string "Entities/Rooms/CTF_Room.cfg" Reference to the configuration file that defines workshops and their functions.
zombie_portal_config string Reference to the configuration file that defines zombie portals (spawners).
party_mode bool false Enables migrants and functionality for followers. Overrides unit-count variables.
warmup_barrier bool true Enables one barrier from ⅓ to ⅔ of map that prevents movement during warmup.

See Also

See also