- Spatial audio. The volume and direction of a sound effect is now based on the player’s distance and facing direction relative to the sound effect. Previously, volume was properly adjusted based on distance, but the direction that the sound came from was wrong. Direction was based on the player’s location on the screen. If there was a fountain to the left of the player and the player was facing the fountain, the sound came from the left side instead of in front of the player. Fixing the direction of the sound took some thought but was ultimately very simple to implement. I added a transparent child GameObject to the player GameObject that rotated based on the direction the player was facing, and I moved the Audio Listener component from the parent GameObject to the child.
- Interaction sound effects overhauled. Interactions, such as a sword slashing flesh, or an axe chopping wood, used to be defined at the item level. For each weapon, the audio clip played had to be defined for each physical material. This was a lot of work. And, it was redundant because sound effects aren’t unique to items; they’re unique to combinations of the weapon material, the damage type (slashing, chopping, bludgeoning, etc.), and the target material. I moved the sound effect configuration out of items and into a new configuration object that defines sound effects for each combination.
- Usable items configurable by class. Classes can now have limitations on the items they can use, for example: knights can no longer use scrolls.
- Minor improvements
- Bats can now fly over objects.
- Braziers added to many rooms with active actors.
- Bug fixes
- Unable to cancel player movement along a path.
- An error occurs when a Vampire appears.
- Crystal shards don’t stack in inventory.
- Fountains and shrines can be placed inside corridors, blocking access to the other end of the corridor.
- Items can be thrown through boarded up doorways.
Next week, I’ll add more sound effects and continue testing, bug fixing, and refining.
Leave a Reply