SDK Tips and Tricks (Killing Floor 2)

From Killing Floor 2 Wiki
Revision as of 22:47, 10 September 2019 by Simplecat (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Introduction

This is just a compilation of miscellaneous tips and tricks from mappers when using the SDK. These range from the novice to the advanced to the very obscure. It is worth giving it a read through as you may encounter one of these situations during your development.

Hotkeys

Hotkey Function
~ Toggle between World and Local space
Spacebar Toggle between Movement/Rotation/Scaling
G Toggle Game view mode in Viewport
H Hide selected actors
Shift + H Hide all but selected actors
Ctrl + H Unhide all actors
N Toggle Path Nodes
P Toggle Paths
T Toggle Landscape/Terrain
O Toggle Volumes
B Toggle Builder Brush
Ctrl + Left Click Multiple Select
Right Click + Scroll Wheel Change movement speed around the viewport
Ctrl + number Set a bookmark
number Snap to bookmark
F4 Open Actor Properties
[ Increase Grid Snap Size
] Decrease Grid Snap Size

There are a lot more hotkeys for the editor, these are the main ones people usually have issue with when first starting out. You can check for others here: https://sites.google.com/site/lessonsdarrenmckinsey/udk-hotkeys

General Usage

General Mapping

  • NEVER use groups - the map will always crash when you attempt to play it in the Base game.
    • In the same regard, try not to use Prefabs. They do work and will not crash the Base game, however they have caused SDK crashes and even whole Map corruptions.
  • Where possible try and do the majority of your movement, rotation and scaling in World space.
    • Rotations in Local space are not accurate, they are very prone to rounding errors. Rotating a mesh even by 90° will not truly be rotated by 90°, it will always be off by a couple of decimal points
      • You can observe this, rotate a mesh back and forth a couple of times and watch the Rotation properties, they will always have bizarre decimal places.
      • Although small, are large enough to offset the entire mesh if you plan to repeat their placement (eg: like with the Modular Set).
    • It should be stressed that if working with the Modular Kit Set - ALWAYS use rotations and transforms in World space.
      • This makes sure everything is tightly organised and no tiny gaps appear from the above issues using Local space.
  • Try not to mirror non-symmetrical meshes.
    • Mirroring an object on an axis will not mirror its RigidBody collision. You will still be able to walk over it normally, but buggy behaviour will still exists with gore, bodies and any other RigidBodies that will seem like they clip into the mirrored mesh.
  • Be careful not to accidentally place or convert meshes to InteractiveFoliageActors
    • The option is very easy to do as it is positioned right underneath StaticMeshActors in the context menus
    • Foliage actors have additional collisions and bounds that can have unwanted interactions with weapons and projectiles
    • If you suspect you have some, check your Scene window to see if any exist.
  • Sometimes when building a map you may see weird behaviours, like nodes not being connected or bullet shots being instantly hitting invisible walls in front of you when playing in the editor. This is usually caused by a builder brush that is very large, and you may be inside of it. Sometimes these can just happen by accidentally misclicking and not realizing. You can get rid of all brushes in the scene by going to the Content Browser and selecting the 'Scene' tab at the top of the window. From here delete any Brush actors in the scene and do a geometry rebuild. This should remove all those unwanted behaviours.
    • Its also recommended to remove all Brush actors before publishing as well.

Lighting

  • ALWAYS turn off Dynamic Shadows for PointLights
  • Lighting is usually the major cause of performance hits in maps; specifically PoinLights. The larger the radius of the point light, the large the performance hit, and these get exponentially worse with size and density of point lights in proximity.
    • Try and make sure all point lights are at their optimal smallest size to give the desired effect.
    • You can often achieve the same lighting effect with a smaller light with a LightFalloff of 1 instead of default 2.
      • In some cases you can go from a 700 radius PointLight to a 500 one while still retaining the same lighting effect with the falloff set to 1.
  • This is a fringe case issue but can have some major performance hits. Meshes that use complex translucent materials, such as the Tank Glass from Biotics Lab when combined with lighting that use material functions, like the Water Caustics (also from Biotics) should have all shadow and lighting options turned off. In some cases you can save up to 5 to even 15fps depending on how complex the scene is or how large the radius of the light is.
    • There will be no visual change as the material is emissive and lighting is usually non-observable on translucent materials.
  • The SDK does have separate Lighting Draw Distances than the Game.
    • If your lights start disappearing at long distances this could be the cause.

Miscellaneous Issues

  • The further you drift from the origin of the map, the more rounding errors occur for things like collision and lighting.
    • Collisions end up not being smooth. eg: clipping on smooth/flat surfaces, character sliding when standing still.
    • Lighting can cause shadows to flicker
    • Staying <80,000uu from the origin is recommended to avoid the above.
  • If you see Zeds/Players disappear behind glass this is due to Visibility Collisions
    • You can turn this off by going to the Mesh Properties > Static Mesh Component > Collision > RBCollide With Channels and disabling VisibilityCollision
    • Turning off Visibility Collision will not work for Precomputed Visibility however. If you get undesirable culling its usually caused by a non-translucent materials.
      • Even materials that are transparent (such as additive ones) will cause PCV culling. PCV only ignores translucent materials.
  • You can set the Translucency Sort Priority under the Render settings in an actor's properties. Useful if you have multiple layered translucent materials.
    • Sorted High to Low, Higher will take priority.
    • Flickering splat maps can be fixed by increasing priority on translucent materials.
    • You can set priorities to negative (eg: -1).