How to Deal Damage to World Actors With GAS

Clock icon 2 Min. read

While working on The Bug Squad I run into a situation where I needed to apply damage to world actors — in my case explosive barrels — using the Gameplay Ability System.

Early explosive barrel implementation using GAS.

The standard way to do this in UE is to set bCanBeDamaged to true on the actor and override the TakeDamage function and/or related events. This, however, doesn’t work with GAS where damage is applied via gameplay effects.

A quick search in the Unreal Slackers Discord showed the common practice is to give an AbilitySystemComponent to these actors. Apparently, this is also the approach Epic uses in Fortnite for world objects that can be destroyed such as rocks, trees, walls, etc.

Read more...


How to Customize the UE5 Place Actors Panel

Clock icon 1 Min. read

While working on a project or a custom plugin in Unreal Engine it can be useful to add custom actor classes to the Place Actors panel. This is my custom panel for The Bug Squad, which I’ll be using as an example for this post:

A screenshot of the custom category in the UE5 editor

First, the PlacementMode module should be added as a dependency in the editor module’s build.cs file. Here’s mine:

BugSquadEditor.build.cs
using UnrealBuildTool;
 
public class BugSquadEditor : ModuleRules
{
    public BugSquadEditor(ReadOnlyTargetRules Target)
        : base(Target)
    {
        // [...]
 
        PrivateDependencyModuleNames.AddRange(new[]
        {
            "BugSquad",
            "Core",
            "CoreUObject",
            "Engine",
            "PlacementMode",
            "SlateCore",
        });
    }
}

Read more...


The Bug Squad: An Update

Clock icon 2 Min. read

A lot has happened on The Bug Squad over the past few months and I’m quite happy about the progress so far. Here’s how things look:

Progress!

My original plan was to aim for an arcade gameplay built on top of procedural levels and hordes of monsters, but I gradually pivoted to a more story-driven experience. This gave me the perfect excuse to go back doing level design work (which I haven’t done in ages) and also allowed me to code a quest system (which I’ve never done before).

Procedural generation tests

I still made some quick tests with procedural generation and with Poisson Disk Sampling in particular. The algorithm is effective at procedurally placing objects such as monsters, objectives, decorations, etc. I’ve tried to use it to generate lumps of terrain as well.

My implementation is based on this one and could be expanded to use disks of different sizes to make the object distribution more interesting. I have to say Unity is really good to make quick tests thanks to C# and the OnDrawGizmos event for debug visualization.

Read more...


Migrating My Website to Astro

Clock icon 3 Min. read

During the past couple of weekends I took a break from The Bug Squad (more on that soon!) and migrated my website to Astro.

It’s been a (mostly) stress-free and enjoyable process. This setup supersedes my previous homebrewed solution built on top of Gulp, a bunch of plugins and some duct tape.

The Astro logo, an 'A' with a flame underneath resembling a rocket

Over the years my website has grown from only a couple of portfolio pages to roughly ~240 assets (including pages, images, stylesheets, scripts, etc.), which I guess was just too much for my simple custom setup to handle.

Build times were starting to get out of control. Even previewing a simple change had started to take a considerable amount of time, making iteration — on blog posts in particular — a real pain.

Read more...


The Bug Squad: Dash Ability

Clock icon 4 Min. read

After a couple of weeks of break spent in the south west of France — great sights, food and drinks, highly recommended! — let’s get back to work.

I’ve started implementing a basic dash ability that can be used to quickly escape from dangerous situations. The ability will be shared by all mechs in The Bug Squad. At some point I’d like to make it upgradable to make it deal damage too — we’ll see. This is how things currently look:

Implementing the dash movement

The first step to implement the ability was creating the actual dash movement. When dashing, I want mechs to be driven at full speed for some time, with players being able to steer, but not stop before dashing is over.

Mechs in The Bug Squad use the standard UCharacterMovementComponent (CMC) provided by the engine. This is a powerful (and comple😆 component that supports movement prediction on the local owning client to reduce perceived lag, as well as reconciliation with the server, interpolated location updates on remote clients, etc.

Read more...