Sunday, November 17, 2024

Encoding a Video With Alpha for Unity, Using FFMPEG

It took a surprisingly long time to track down a working combination of arguments for this, so here's one that's known working in an actual project.  This is using Unity version 2022.3.36 and FFMPEG version 7.0.x.  Allowing the asset to re-encode worked fine on all platforms we tried, including all consoles, except the SteamDeck somehow.  We ended up disabling re-encode on PC for that reason.

ffmpeg -framerate 30 -i Frames\Blink\Blink_%%02d.png -b:v 8M -c:v libvpx -pix_fmt yuva420p -metadata:s:v:0 alpha_mode="1" -auto-alt-ref 0 Videos\Blink_VidAlpha.webm

Friday, September 27, 2024

Astrea: Six Sided Oracles

A beautiful deck-building game that makes use of dice instead of cards, Astrea is a Unity based project that we helped bring to consoles!  Choose one of six unique Oracles, expand your collection of dice, cleanse or corrupt your enemies, and gather artifacts to save your star system!


Astrea is now available on Switch, PlayStation, and Xbox!  (or Steam, of course)

Friday, August 30, 2024

Valfaris: Mecha Therion!

Do you like retro shooters?  Do you like heavy metal?  How about sweet artwork and lengthy geysers of blood?  Well, today may be your lucky day, because we brought Valfaris: Mecha Therion to consoles!

Now available for Switch, Xbox, and Playstation!  Runs at native 4K on the Series X and PS5, too.

Tuesday, August 6, 2024

Hello Cruel World!

 Hello Cruel World is a first-person VR puzzle game with heavy horror themes, and it's now available on both Meta Quest and SteamVR!  As an urban exploration live streamer, take your chat with you into the biggest find of your career, and discover forgotten secrets below the carcass of an abandoned restaurant.


We helped with performance, hand presence, locomotion, and many other interactivity elements!

Tuesday, June 11, 2024

Unreal Build Tool Command Line Arguments

We've been exploring some of the ways we can use command line parameters to allow different types of builds on the same platform in Unreal.  If you're building from the command line or using the Project Launcher, you can specify extra build arguments with the -ubtargs switch.  There's a very good explanation of how to set things up here:

https://greenforestgames.eu/article/Building-Unreal-projects-with-UAT-1605886728

In brief, you can create a class member in your game's Target.cs build file and give it the [CommandLine] attribute.  If you run the build with -ubtargs=-customarg, that class member will be set appropriately, and you can read it and respond to it as desired.

using UnrealBuildTool;

// Required for CommandLine attribute
// (if UE4.27, using Tools.DotNETCommon;)
using EpicGames.Core;

public class UBTExampleTarget : TargetRules
{
    [CommandLine("-targetsetting")]
    public bool bTargetSetting = false;

    public UBTExampleTarget(TargetInfo Target) : base(Target)
    {
        // ...
        // Existing code
        // ...

        if (bTargetSetting)
            // Do something if command line arg is present
    }
}

Then run the command line with -ubtargs (the argument must match the value in the [CommandLine] attribute):

<Unreal Engine location>\Engine\Build\BatchFiles\RunUAT.bat BuildCookRun -project=<project path> -platform=Win64 -clientconfig=Development -build -cook -pak -stage -ubtargs=-targetsetting -archive -archivedirectory=<archive path>


The limitation here is that you can only get the command line arguments in a Target.cs file.  You have to use other means to communicate that information to individual module Build.cs files where it may actually be useful for setting preprocessor defines or including specific libraries.  However, you can actually access the command line arguments in a module Build.cs file by using .NET and Unreal Build Tool systems.  Specifically, you must create a CommandLineArguments object and pass it System.Environment.GetCommandLineArgs(), then call .ApplyTo() on the module.

using UnrealBuildTool;

// Required for CommandLine attribute and CommandLineArguments
// (if UE4.27, using Tools.DotNETCommon;)
using EpicGames.Core;

public class UBTExample : ModuleRules
{
    [CommandLine("-modulesetting")]
    public bool bModuleSetting = false;

    public UBTExample(ReadOnlyTargetRules Target) : base(Target)
    {
        CommandLineArguments commandLineArguments =
            new CommandLineArguments(
System.Environment.GetCommandLineArgs());
       
commandLineArguments.ApplyTo(this);


        // ...
        // Existing code
        // ...

        if (bModuleSetting)
            // Do something if command line arg is present
    }
}

This technique will work in module Build.cs files that are in the main game, and it will also work for modules in plugins, in case you want your plugin to read the command line and respond to it without having to do extra work in each project you add it to.

You also do not have to apply the command line arguments to a target or module.  You can create a custom object and apply values directly to it.

using UnrealBuildTool;

// Required for CommandLine attribute and CommandLineArguments
// (if UE4.27, using Tools.DotNETCommon;)
using EpicGames.Core;

public class UBTExample : ModuleRules
{
    private class UBTExampleCommandLineData
    {
        [CommandLine("-examplesetting")]

        public bool bExampleSetting = false;
    }

    public UBTExample(ReadOnlyTargetRules Target) : base(Target)
    {
        UBTExampleCommandLineData ubtExampleCommandLineData =
            new UBTExampleCommandLineData();

        CommandLineArguments commandLineArguments =
            new CommandLineArguments(System.Environment.GetCommandLineArgs());
        commandLineArguments.ApplyTo(ubtExampleCommandLineData);

        // ...
        // Existing code
        // ...

        if (ubtExampleCommandLineData.bExampleSetting)
            // Do something if command line arg is present
    }
}

Examples of all of this are provided for both Unreal 4.27 and Unreal 5.4.

https://github.com/JBurkeKF/UBTExample

One extra item: if you want to set up a Project Launcher profile that uses build arguments, you can do a bit of a hack.  In the "Additional Command Line Parameters" field in the Build section, use double quotes to escape the entry and add -ubtargs for building.  For example (this time including quotes!) " -ubtargs=-targetsetting".



Tuesday, June 4, 2024

Rolling Hills: Make Sushi Make Friends!

Run a friendly neighborhood sushi restaurant, make friends and become a part of the community.  As a state-of-the-art sushi robot, make your creators proud by proving yourself the best sushi chef anywhere!  We helped with performance, and brought the game to both Xbox and Windows Store!



Now available on Xbox and Steam!