Let’s continue to study the breakdown of Dishonored by Calvin Simpson.
This week’s focus (alongside writing my progress report & producing concept art) has been on building and polishing up the groundwork for the level design pipeline, where this means I have been refining and setting up blueprint actors to help speed up that process. Alongside that, I have also been refining the mechanics and values so that the level design process is smoother and easier to test with a framework already laid down for the character controller.
Dynamic Crouching & Sliding
My previous approach to allowing the player to crouch under objects was to utilize volumes to adjust the capsule height to fit inside the volume – this, however, was very inefficient and temperamental. To replace this I have added a dynamic crouching system which checks for the height of the space in front (and at the player’s position if nothing is found to check if they are already underneath something) and then smoothly adjusts the capsule height to match.
This works extremely well (and is limited by the capsule radius so the player can only crouch to a certain height) and goes hand-in-hand with the sliding system which makes the player crouch and pushes them along – meaning they can slide underneath obstacles without any hitches.
This section of the script is being executed every frame to constantly find and interpolate between the previous crouch height to the target crouch height – this allows for smooth movement and for it to remain dynamic.
Dynamic Crouching Code.PNG
Inside the GetCrouchAdjustmentHeight() function – a raycast (line trace) to first check if there is anything in front of the player (i.e. don’t try to adjust the crouch height if crouched in front of a wall out in the open), then check the space in front (raycast from bottom to the player’s default crouch height), and if that fails then check with a spherecast to check if the player is underneath anything already. This returns whether the hit was successful and the height at which to adjust if it is.
Dynamic Crouching Adjustment.PNG
Locational Damage & Pistol Damage Mapping
I also laid the groundwork for applying location-based damage multipliers on the enemies through the standard damage system in order to allow for more tactical damage (which fits into the immerse sim style of gameplay). For example, hitting the head will vastly increase the damage caused, whereas shooting the foot will cause significantly less damage. This system uses scene components which store the necessary data I need and allows me to attach this data to the enemy’s skeleton bones via the socket attachment system, meaning I can also tag which bones can be dismembered (only on death currently to avoid having to create variations of animations).
This is the code which uses the built-in function for finding the closest bone to a location which I can then pass to my own function to find the closest bone up the hierarchy which has the locational based damage data. As usual, my scripting is standardized into re-usable functions (which also allow to abstract functionality into local scope) and exposed via an event to allow for execution latency and to pass in the required data I need (i.e. base damage, location hit, impulse to apply on death for visual feedback etc).
This system also adds support for blood splatters which basically extend the base particle and decal actors to allow me to spawn decals which internally handle the animation of blood, as well as spawning blood decals from particle collisions.
Locational Damage System.PNG
The pistol has also been reworked to utilize this overhauled system, as well as added features such as bullet penetration (for hitting multiple targets & adjusting damage accordingly), a damage curve to remap the damage to over the firing range, and applying an impulse to enemies upon death. This also utilizes sphere-casting to emulate the spread of the pistol and to feel the most responsive (as projectile-based can cause problems).
Pistol Damage Curve.PNG
Building Tiler & Improved Material Overrides
The reworked building tiler system now allows for a lot more control than before so that I can easily block in spaces using existing assets, provide variation easily in a controllable manner, and override materials. I also reworked the system to tile walls, corners, and whole buildings with an option to spawn in a procedural floor & roof section at the top – this will help to add vertical gameplay into the level blockout.
With that system in place I was able to create to create these 2 buildings incredibly fast (the second one was built around the existing interior). Creating the red building took approximately 3 minutes with all the systems set in place to generate as it was incredibly easy for me to adjust and line up everything – doing this by hand with just individual static meshes would take incredibly longer and would be a lot more difficult to apply changes to – this allows me to be very free in the look-dev stage.
The material override system has also been reworked to help accommodate these changes as I’ve begun to test the pipeline further. Such problems I found were that as the previous system relied solely on the order of materials it meant I had to keep everything in the same material IDs – and some modular pieces would break this pattern if they didn’t require a material, unfortunately.
To combat this I instead created a new struct which stores the material to find (this is stored as an array of MaterialOverride types), and a list of materials which can replace it, along with an index to pick which material to replace the material that was found. For example, inputting a metal trim would allow me to very easily replace all instances of that metal trim with any other variation of metal trim I have (i.e. navy, black, white, rusty, clean etc) – this goes hand-in-hand with my environment production pipeline which involves heavy use of material instancing.
Material Override Panel.PNG
Building Pieces & Pipeline
I have developed a fair few modular building pieces of a higher level of architectural complexity now the pipeline has been tested and solidified. Chopping and changing these pieces has never been easier thanks to the use of tiling materials, trims, and my pivot tools and batch exporter scripts (written prior to this project).
Pivot tools allow me to quickly move and copy pivots across different meshes which is incredibly handy for modular pieces.
Also here is a visual representation of my art pipeline – it’s extremely important to note how optimal it is due to automation and removal of multiple software packages which would otherwise cause bottlenecks. As a technical artist keeping this pipeline optimal but powerful is one of my prime duties and thus I felt it was important to show this as well as note that there is a lot of back and forth between UE4 and 3ds Max for the modular pieces pipeline.