[KAG] BUILD 1337 – Back on Track

This build marks a return to progress on KAG – it’s been a few months between releases, and I’ll give a refresher on why that’s been the case later, but first, a warning: KAG has had a LOT of changes in the past hundred days and a lot of engine-side stuff has happened, probably more than we can test completely. Please bear with us and calmly report any bugs in the thread and we will fix them as soon as we can.

Without further ado, let’s jump right into what’s changed this time around, as there’s a lot of it! Buckle up!

Prepare to see a little more of this going on!

  • Crash Fixes
    A long-term crash in the camera system (causing a common crash on rejoining servers) was found and fixed. This should dramatically improve the game’s long-term replayability. Be sure to let us know if any other crashes on rejoin persist! A few other miscellaneous crashes including a hard-to-trace one in one of the network synchronisation routines were also fixed.
  • Archer Changes
    • Inventory Management
      Archers no longer automatically pick up a full inventory of arrows, so you’ll have some space left over for special ammo.
    • Less Slippery
      Archers are slowed more when charging arrows, making it a little easier to catch that backpeddalling nuisance archer, and a little easier to aim while running.
  • Knight Changes
    • Increased Shield Angles
      Shield angles have been slightly increased to help deal with fighting through lag.
    • Increased Glide Time
      Shield glide time has been increased to about two seconds, allowing longer jumps and bigger falls without injury.
  • Builder Changes
    • Decreased Spike Damage
      Spikes must be dropped from a higher place to deal insta-kills, damage ramps up with distance.
    • Added nicer building sounds
      Lots of blocks now have individual building sounds.
    • Fixed “buggy” ladder rotation blocking stuff
      Ladder rotations have long caused incorrect blocking of tiles, that’s fixed.
  • Health Changes
    Swapping class can no longer be used for “free heals” as health is kept in proportion each swap. Archers are still cheaper to heal to full health but the added inconvenience should prevent most of the abuse.
  • Inventory Fixes
    A hard-to-track bug causing all your arrow stacks to go missing right when you needed them has been fixed. Items are also automatically taken from the smallest stack in your inventory, rather than the first one found, meaning picking up small stacks off the ground clogs your inventory for less time.
  • Inventory Interface Improvement
    Archers and Knights start with their cursor over their inventory after pressing F – builders start with it over their tiles. The rationale here is that knights and archers can easily swap weapons by tapping F and want precision access to any auxilliary items in their inventory, while builders are more likely to want to swap tile types quickly.
  • Balancing Changes
    Auto-Balancing should be less “mean” to any one person, and is based on the median score rather than the mean.
  • Maploader Changes
    A small set of changes but important for some specific mods and maps, community member jackitch has updated the png map loader to include specific colours for the two types of trees, various mossy tiles, and fixed a bug where the purple team spawn was the same colour as the necromancer.
  • Votekick changes
    We’re actually on the fence about these changes, but the community have been pushing for something, and norill contributed changes. Votes can no longer be inconclusive, the vote gui has changed, enemy team cant vote unless it’s a hacker, and map votes use a global cooldown to prevent spam. Voting is now done via the O and P keys, and the box is much smaller. Leave your thoughts in the thread.

A lot of engine changes from work on Trench Run also makes it back into KAG with this release for modders to play with and for future use in KAG. However – this does mean that there’s a body of changes so wide that we’re unlikely to have tested everything! Let us know quickly about any drastic bugs and we’ll get onto them asap! Here’s a small run-down of the most exciting changes:

  • Post-Processing Shaders!
    Shaders can be used for postprocessing both before and after gui rendering, with multiple shaders able to be set up and layered on each other. Shader options are significantly extended, including per-shader variables (and textures!) to be set from script.
  • Gamepad Control Extension
    Gamepads and the foundations needed for local multiplayer have been added – modders should not consider this part of things stable, but it does open up possibilities for local multiplayer (perhaps co-op? sandbox?) and gamepad play (for those allergic to mice).
  • GUI code exposed
    This paves the way for new menus for KAG, and nicer, less rigid in-game menus in mods.

There are a lot of miscellaneous fixes as well, check the full changelog for the details there.

Custom Heads

The following generous donors have received custom heads in-game:

  • Guro
  • Gurin
  • Duke_Jordan

Still to come:

  • Sasquash

Congratulations to the generous!


The delay between builds has been due to wide-sweeping changes in our code-building and repository system. These changes allows us to work on multiple games utilising the same engine (in this case, KAG and Trench Run) while neatly feeding relevant changes from one into the other. While we’ll be “off work” over Christmas and new year, this will allow us to get back to timely development on KAG throughout the coming season!

Have Fun!


[added] storage now stores items instead of making you drop them
[added] CerberosRift CTF map
[removed] JTG Mines map
[fixed] stuck arrow and bush blocking building construction
[fixed] some animal brain bugs
[fixed] shark always goes right on land
[added] shark is player-compatible
[added] shark loses target more easily (to avoid it getting "stuck" on fish and ignoring players too long)
[added] eatothers re-hits things its stuck colliding with (so sharks gib bodies and move on)
[script][added] bindings for various time functions - local and UTC seconds + day/month stuff in UTC.
[script][modified][modding][warning!] onRestart not called for CRules on first round - call it in onInit if required!
[modified] voting changes - thanks Norill
	- failed votekick doesn't kick initiator
	- vote passes if yes > no
	- removed inconclusiveness
	- made rendering less obtrusive
	- made LESS noob friendly by removing buttons - uses keys instead
	- enemy team can't vote in case of griefer/AFK/TKer
	- added mark_any_team, mark_player and map_vote support
	- map votes use global cooldown instead of per player
[fixed] ballista bolt does weird things after going to space and back
[modified] pickup is a little better, still rough but changes with direction in a predictable way.
[fixed] rotated ladders blocking things badly
[added] a bunch of nice per-block sounds for builder construction
[fixed] balance teams not working due to onRestart change (not called in onInit)
[added] new scripts menu UI
[fixed] blobs not falling after trap block triggers
[fixed] background tiles being created in some spurious cases by
[fixed] ladder sprite not being set to background
[added] runlocalhost.bat (and .sh) for modders that runs a local server and joins it
[fixed] knocked not expiring in vehicle
[added] knocked interface is more consistent + allows getting knocked value without modifying it, allows checking isKnocked safely, has better function names, etc.
[modding] check if you have used Knocked anywhere (actor/class code), things have changed!
[modified] base PNG loader - thanks Jackitch!
 - added specific tree type pixels for forced type trees
 - added mossy tiles
 - fixed purple spawn is same as necromancer (lol)
[modified] inventory menu offsets improved - builder is over tiles (starts over "ladder" with CTF blocks), archer and knight over inventory for easy item use
[fixed] "cheating" healing by swapping to archer with >2 hearts and swapping back - now keeps a proportion of HP
[added] archer doesn't auto-pick up more than 60 normal arrows.
[fixed] some archer stuff not getting updated appropriately
[added] misc other changes from Norill
    - fixed balancing same guy over and over
    - fixed can't autopick team in tdm
    - removed shittons of boilerplate
    - added adjustable autobalance threshold
    - changed "doesnt suck" condition from >average score to median (its really "top half" now)
    - decreased "OGM TEAMS IMBA" spam further
    - fixed zombie-shark
[modified] spike drops have damage falloff
[modified] archer slower when shooting arrows (70% of normal speed, was 85%)
[modified] knight shield angles increased
[modified] knight shield glide time increased to almost 2 seconds
[added] bool engine_floodlayer_updates to CRules for controlling if blobs do their flood layer updates at all (check in fire/water, skim on water, shoot particles on water, etc)
[fixed] missing tiles at some map edges
[fixed] the glitchy "Recompiling script..." screen
[script][fixed] CMap::getMapName returning nil
[fixed] starter buttons
[fixed] renaming of KAG exeacutable on OSes other than windows.
[fixed] typo in hooks
[fixed] chat key interferring with script menus
[script] added LateLoadRules to load rules on next tick (avoid crashes in some cases)
[script] added hook void onRulesRestart( CMap@ this, CRules@ rules )
[added] u8 mat_water_layer_alpha to gamemode.cfg/CRules for controlling alpha rendering of water front layer
[fixed] crashes in dedicated server on join
[modified] default cl_name removed (fixes all new players being called "Peasant")
[modified] default maximum ping reduced to 350ms
[script] binded joystick keys
[script][added] CShape::RemoveShape( int index )
[script][added] bool CRules::chat exposed (disable chat window)
[fixed] wrong starting directory when using KAG:// links
[fixed] creating double accounts on borrowed game
[modified] duke jordan head disabled until payment
[modified] reflecting build changes in TW script, changelogs
[added] duke jordan head to engine
[fixed] doubled news
[fixed] twitter links not opening on some rare occasions
[modified] camera target cleared on deleting net objects
[fixed] "rejoin" crash
[fixed] installers for KAG
[fixed] a couple of things that meant the last tile of the map was hidden/inaccessible
[modified] nicer flash screen
[script] added: int getScreenFlashAlpha()
[script] added: SetScreenFlash( SColor color, f32 fadeAmount )
[fixed] precache loading Mods and old files
[script] moved SetScoreboardVars from CBlob to CPlayer
[fixed] getLocalPlayer returning null when not first player playing
[added] getLastKeyPressTime to CControls
[script] added global function getDistanceToLine
[script] exposed onmap in shape vars
[script][fixed] commands received in script in first tick after being removed
[fixed] onBlobDie and onDie being called twice on SetDead
[doc] [added] partial documentation for CSprite
[doc] documented the rest of CPlayer
[doc] added documentation for scoreboard functions on CPlayer
[doc] added documentation for CPlayer player info and started on scoreboard
[script] added CBlob::getMyPlayerIndex
[fixed] bans being limited to 5555 minutes
[added] local multiplayer possible with gamepads oh yeah B^)
[fixed] weird bug with inventory items vanishing from hands
[script][added] u16 CBlob::getMaxQuanity(), analogue for getQuantity().
[fixed] typo for security file
[fixed] HUD shaders wiping previous HUD shaders
[added][script] SetShaderFloat and SetShaderInt
[added] engine supports HUD+game post-processing
[modified] high level map rendering
[fixed] typo in high level node code causing impossible searches
[modified] a few optimisations and simplifications in high level map code
[script] added debug()
[added] CMap::getTileFlags(u32 offset)
[added] sending extra texture to shader
[script] added CControls::getActionKeyKeyName and CControls::getActionKeyKey
[fixed] font loading (won't work in mod folders)
[fixed] chat console dissapearing without cursor on
[script] chat = false in gamemode.cfg disables chat console
[script] controls return last key pressed to script (lastKeyPressed)
[fixed] seclevs going crazy when auth_login is null
[script] binded APIPlayer and APIServer
[added] void OnRequestList(CRules@ this) hook
[script] exposed QuitGame()
[added] Guro, Gurin, Duke_Jordan heads - congratulations!
[script] added hooks: void OnOpenMenu(CRules@ this) void OnCloseMenu(CRules@ this)
[fixed] blob->Sync crash in bool
[script] added maxChatBubbleLines and isChatBubbleVisible() to blob
[script] added SetChatBubbleFont and chatBubbleOffset for blo

Attention modders – breaking script changes:

If your mod breaks with this version it is most likely one of these changes:
* onRestart isn’t called automatically now after onInit (solution: call onRestart manually in onInit)
* key_zoomin and key_zoomout are no longer part of blob controls (solution: you can still access these buttons from controls like this
* weird sounds? – disable effects in script: s_effects = false

Leave a comment

Social Media

Stay up-to-date with our latest news - make sure to follow us on Social Media!