Character Updates, Sound FX Generator, and More!

Aug
20

Character Updates, Sound FX Generator, and More!

It’s that time again: another development update! Tomorrow (or possibly later tonight) I will be pushing the next release, v0.3.2-alpha, to itch.io for those who are participating in Founder’s Access, so I thought I would discuss the major changes that I have been working on recently. These changes include some functionality relating to characters and a few new features to support sound effects.

Character Idle Animations

Previously, characters were static when not walking since the game would just default to showing frame #1. In this next release, you’ll be able to specify idle animations for your character to remedy this and add a bit of life to your games! Taking advantage of this new feature is fairly straightforward. In the Voxel Editor, simply define a looping animation for your character with the name “idle” (all lowercase). That is all you need to do! The game will take care of triggering the idle animation when the character is not moving. This applies to player characters, NPCs, and enemies.

In the future, I plan to allow for more control over features like these (for example, allowing multiple idle animations that play randomly, or a special animation that plays after the character has not moved for a certain length of time), but for now I think this small change will have a lot of visual impact.

Character Movement Speed

Another new feature relating to characters is the new “Movement Speed” property that can be adjusted in the Voxel Editor. By default, characters move at a rate of 30 voxels per second. It made sense to allow for varying speeds (for example, a human should cover ground a lot faster than a snail) and it was a quick change, so I went ahead and implemented this functionality to accompany the other character updates. The quad bikes below were adjusted to move at a speed of 45 voxels/sec and 80 voxels/sec.

Movement Areas for NPCs

Movement areas can now be defined for NPCs to restrict their movement. Previously, if an NPC was placed into a map, they could eventually wander anywhere on the map due to the nature of their random movement. This new feature makes use of the “group” functionality in the Map Editor. You can simply define a group of tiles and then, in the Properties dialog of a character, specify this tile group for the “Movement Area”. For example, you could confine a group of slimes to a certain area by the lake as shown below.

Once the movement area has been configured for each of the slimes, in the game they will only move onto tiles that are in the group that was specified for their movement area. This can be useful in a lot of situations! Another example could be a house where you want to limit an NPC’s movement to only tiles within that house (or even a certain floor within the house).

Sound FX Generator

I am excited to say that a sound effects generator tool has been added to RPG in a Box! Originally, this sort of feature was quite far down the roadmap, but after I recently came across the sfxr tool that was created by Tomas Pettersson (Drpetter.se). He was kind enough to make the source code for sfxr available under the MIT license, and I was able to fairly easily integrate the back-end code for generating sound effects into a UI that was modelled from his, including presets for general sound types such as explosions, pickups, etc.

Check out the video below for a preview of the Sound FX Generator. This video is just an overview of what can be created by only using the preset buttons. All of the sliders under the manual settings section can also be adjusted to create a wide variety of sound effects for your game. 🙂

Sound Scripting

To support the other new features around sound effects, a new “Play Sound” scripting function has been added. This will simply trigger the specified sound effect to be played once, and is useful for scenarios such as the player opening a door or a treasure chest. In a later version, I will be adding another function to support looping a sound effect.

I am also brainstorming other instances where custom sound effects could be defined, for example the “speaking” sound effect for an NPC, or even attaching a sound effect to an object’s animation so it is triggered whenever the animation plays.

Importing WAV Files

If you’d like to import your own sound effects from the file system for use in your game, you can use the existing “Import Resources” tool on the main toolbar. The tool was updated to recognize WAV files in the selected source folder. Any WAV files selected to be imported will be automatically converted into the .smp file format used by the engine.

Other Updates

A couple of other updates worth mentioning involve changes to the Voxel Editor. Firstly, the view will now automatically switch between Front, Left, Back, and Right views if you continue to drag and rotate to the left or right with the right mouse button down. This should make building models a bit more efficient, as previously you would have to use the “View” dropdown to switch between these views.

Also, when importing from a PNG file into the Voxel Editor, the image will now be oriented based on the current view instead of always facing towards the front side. Eventually, I plan to add some additional options when importing PNG files, for example the option to specify a thickness of the model that is generated.

Thanks for reading! 🙂 The full list of changes included in the next release can be found below.

Full Changelog for v0.3.2-alpha

New Features:

  • Sound FX Generator for creating custom 8-bit sounds for your game. This feature can be accessed from the main toolbar. Saved sound effects will appear under the “Sounds” folder in the Game Explorer.
  • Sound effects can now be imported from WAV files into your game project using the “Import Resources” toolbar button.
  • Added a new “Play Sound” scripting function to trigger a sound effect.
  • Idle animations for characters are now supported – simply define an animation with the name “idle” (all lowercase) for the character in the Voxel Editor.
  • Movement speed can now be adjusted for characters. This value can be set from the Properties panel after opening the character in the Voxel Editor and is measured in “voxels per second”.
  • Movement areas can now be assigned to NPCs to restrict their movement to a specific group of tiles.

Bug Fixes:

  • Fixed an issue where the tab name would not update to reflect the new name after using the “Save As” functionality in the Voxel Editor.
  • Fixed an error that could occur in Place mode if a resource was deleted while currently selected in the resource selection panel.
  • In first-person mode, the player can now properly interact with objects that are on the player’s current tile.
  • Changes to certain properties (such as character name, animations, etc.) will now be automatically reflected in the game without the need to re-save maps containing that resource before exporting
  • Fixed an issue where the appropriate dialog would not appear when attempting to delete certain file types/extensions from the Game Explorer.

Other Changes:

  • When editing a model in the Voxel Editor, the view will now automatically switch between Front, Left, Back, and Right views if you continue to drag to the left or right with the right mouse button down. This should make building models a bit more efficient, as previously you would have to use the “View” dropdown to switch between these views.
  • When importing from a PNG file into the Voxel Editor, the image will now be oriented based on the current view instead of always facing towards the front side.
  • Animations in the Properties panel are now collapsed by default when opening a resource in the Voxel Editor.
  • Added clarification on unit (frames per second) to the Animation Speed property tooltip in the Properties panel.

About Justin

Creator of RPG in a Box