Alan Edwardes

Cloud Software & Game Development
  • About
  • Projects
  • Blog

Most Used Tags

  • stream
  • level
  • raspberry
  • mesh
  • light
  • estranged
  • docker
  • git
  • application
  • camera
  • unreal
  • lfs
  • code
  • file
  • data
  • blueprint
  • engine
  • actor
  • dns
  • lambda
  • command
  • pi
  • script
  • repository
  • game

Posts in 2023

  • Running Rocket Chat on an Intel Celron CPU in 2023 on 25th of Mar
  • Running Rocket Chat on a Raspberry Pi in 2023 on 15th of Mar
  • Fixing UE5 Actors Disappearing when Building Lighting on 1st of Jan
  • Fixing UE5 Level Sequence Assertion on 1st of Jan

Posts in 2022

  • Raspberry Pi 4 with Docker on 30th of Dec
  • Fixing UE5 Chaos Events at Runtime on 27th of Dec
  • Scam Warning on 26th of Nov
  • Casting Video to VLC via Home Assistant on 20th of Nov
  • Advanced Git LFS and Jenkins on 16th of Nov
  • Baking Ambient Occlusion using Blender on 2nd of Oct
  • Live GivEnergy PV Inverter Data in Home Assistant on 10th of Apr
  • Useful ffmpeg Recipes on 31st of Jan
  • Force Refresh Rocket.Chat Snap SSL Certificate via Caddy on 29th of Jan

Posts in 2021

  • Pushing to Public AWS Container Registry with GitHub Actions on 23rd of May
  • Graphing Sensor Data from a Raspberry Pi with Grafana on 22nd of May
  • Create Meshes from Height Maps using Blender on 16th of May
  • Recording Camera Animations for UE4 with a Phone on 15th of May
  • The Art of Mirror's Edge on 11th of Apr
  • Serving Static Websites Using Lambda@Edge on 20th of Mar
  • Thread Safe Random in C♯ on 16th of Mar
  • Spotting Fake Indie Game Key Requests on 11th of Mar
  • Jenkins Library for Unreal Engine 4 on 13th of Feb
  • Three Approaches to Readable Materials in First Person Games on 7th of Feb
  • Cheap Synthetic Monitoring with AWS Lambda on 24th of Jan

Posts in 2020

  • Generating Mipmaps for Render Targets in UE4 on 24th of Dec
  • Routing DNS over HTTPS Using Raspberry Pi on 6th of Oct
  • Tips for Building Games with Unreal Engine 4 on 3rd of Oct
  • Serving Localised Assets from S3 Using Lambda@Edge on 17th of May

Posts in 2019

  • Automating macOS Notarization for UE4 on 23rd of Nov

Posts in 2018

  • ISO Country Code to Unicode Flag in C♯ and JavaScript on 22nd of Jul
  • Serverless Git LFS for Game Development on 6th of Jan
  • Adding Custom Map Checks in UE4 on 3rd of Jan

Posts in 2017

  • Building and Deploying a React App Using AWS Lambda on 24th of Dec
  • Git HTTP Username and Password in Environment Variables on 22nd of Dec
  • Capturing and Uploading Screenshots in UE4 on 20th of Dec
  • Using Capsule Shadows on Large Objects in UE4 on 8th of Dec
Featured: Create Meshes from Height Maps using Blender
Featured: Recording Camera Animations for UE4 with a Phone
Featured: The Art of Mirror's Edge

Running Rocket Chat on an Intel Celron CPU in 2023

šŸ“… March 25th, 2023 šŸ”– cloud-software ā²ļø 7 minutes to read

I previously wrote about Running Rocket Chat on a Raspberry Pi in 2023, and ended the post by saying I was emulating the x86_64 build of Rocket Chat on the Pi's ARM CPU (you may want to skim it for context).

As you may have guessed from the title of this post... emulation didn't work out, it was too unstable. I could deal with slowness, but not unreliability. I figured, I'll go the route of least friction, and buy a cheap x86_64 Intel CPU. I landed on hardware with a Intel Celeron N4505 , released Q1 2021.

I shifted everything over to this machine, and it all worked great! The latest version of Rocket Chat (6.x at the time of writing) worked fine, and I stuck with version 4.4.15 of MongoDB. When I did try upgrading that, it crashed. I didn't think much of it, but little did I know this was yet another rabbit hole.

Continue Reading »

Running Rocket Chat on a Raspberry Pi in 2023

šŸ“… March 15th, 2023 šŸ”– cloud-software ā²ļø 2 minutes to read

I run a private Rocket.Chat server on a Raspberry Pi 4. I previously installed it using Snapcraft on Ubuntu, using the official repository. I hadn't noticed it update for a while, and decided to investigate why.

Continue Reading »

Fixing UE5 Actors Disappearing when Building Lighting

šŸ“… January 1st, 2023, updated February 7th, 2023 šŸ”– game-development ā²ļø 1 minute to read

In Unreal Engine 5.1.0 and 5.1.1, if you create blueprint actors which contain lights, they will disappear when you try to build static lighting under certain circumstances:

This is due to the command MAP REBUILD ALLVISIBLE being run automatically by the editor (and this command is completely broken in 5.1.0 and 5.1.1 - try running it in the console). We need to find a way to stop this command being run.

Continue Reading »

Fixing UE5 Level Sequence Assertion

šŸ“… January 1st, 2023 šŸ”– game-development ā²ļø 1 minute to read

I was getting the following assertion in Unreal Engine 5.1.0 which made my game fail cooking:

Ensure condition failed: ThisNode.Range.Overlaps(InTimeRange) [File:D:\build\++UE5\Sync\Engine\Source\Runtime\MovieScene\Private\Evaluation\MovieSceneEvaluationTree.cpp] [Line: 222]

The line of code in question: MovieSceneEvaluationTree.cpp#L222

This was caused by level sequences, and via trial and error with the debugger, I traced it back to two instances of the same problem.

Continue Reading »

Raspberry Pi 4 with Docker

šŸ“… December 30th, 2022, updated February 26th, 2023 šŸ”– iot ā²ļø 3 minutes to read

I use Raspberry Pi 4s to host services for my home network, with Docker to keep things manageable in containers. Each Pi has a USB SSD as its boot drive running Raspberry Pi OS.

There's often a bit of boilerplate I need to keep track of to set up a new one, so I am documenting all of the snippets here for my future self.

Continue Reading »

Fixing UE5 Chaos Events at Runtime

šŸ“… December 27th, 2022 šŸ”– game-development ā²ļø 1 minute to read

This is the normal way to receive Chaos events in Unreal Engine 5.1.0, via the editor:

However, if you want to enable these events (OnChaosBreakEvent, OnChaosRemovalEvent, OnChaosCrumblingEvent) programatically without checking them in the editor, you need to do one of the following.

Continue Reading »

Scam Warning

šŸ“… November 26th, 2022, updated December 27th, 2022 šŸ”– game-development ā²ļø 2 minutes to read

There are one or more users impersonating me on Discord and other platforms in order to scam people.

If your Steam account has been stolen:

  1. Contact Steam Support directly at help.steampowered.com
  2. If the scammer contacted you via Discord, report the account to Discord Trust and Safety

Here are some simple tips to help identify scammers:

  • I will not communicate with you via Direct Messages on any platform
  • I am Alan Edwardes#3608 on Discord, and only communicate via discord.gg/estranged and the Steam forums for the Estranged games
  • If you are added by a Discord profile with my name, it is an impersonator, and the account should be reported to Discord via https://support.discord.com/hc/en-us/articles/360000291932-How-to-Properly-Report-Issues-to-Trust-Safety
  • If you are added by a Steam profile with my name, it is an impersonator, and the account should be reported to Steam Support via https://help.steampowered.com/en/faqs/view/4D07-D139-587C-2080
  • I do not work for Valve (Steam), and will never ask for account passwords, or money (I will not send a direct message to you in the first place)
  • See the contact page for a list of my official accounts.

I also posted similar messages to the Estranged: The Departure Steam Community, Estranged Discord and Twitter.

Continue Reading »

Casting Video to VLC via Home Assistant

šŸ“… November 20th, 2022, updated January 4th, 2023 šŸ”– iot ā²ļø 2 minutes to read

Home Assistant offers an integration with VLC via Telnet. It uses VLC's telnet capabilities to control it. However, the integration is geared towards VLC being run on the command line in headless mode, for audio only applications.

I had a different problem to solve: I have a Raspberry Pi running the VLC GUI on a full blown desktop, and want to be able to "cast" videos to it using the Media Player built into Home Assistant.

This essentially allows you to make the device running VLC with a screen attached a Chromecast-like media player, with the most powerful media player out there as its driver.

Continue Reading »

Advanced Git LFS and Jenkins

šŸ“… November 16th, 2022 šŸ”– cloud-software ā²ļø 2 minutes to read

I use Jenkins to build Estranged, with Git + LFS.

Recently, I upgraded Git, LFS, and Jenkins, and things stopped working. The checkout strategy I use for Estranged is:

  1. Check out the Git repo, do not perform an LFS pull
  2. Set up Git LFS to use a shared LFS cache
  3. Set up Git LFS credentials to obtain objects not in the cache
  4. Perform the LFS pull

This stopped working when I upgraded the components involved. Read on for the retrospective write-up of the problems and how I fixed them.

Continue Reading »

Baking Ambient Occlusion using Blender

šŸ“… October 2nd, 2022 šŸ”– game-development ā²ļø 2 minutes to read

Ambient occlusion is the shadow caused by the mesh itself, so for example in the corners of the mesh. Here's a sample of a crate mesh with only its ambient occlusion texture visible:

Below is the crate mesh with the same ambient occlusion texture combined with the diffuse texture:

Continue Reading »

Live GivEnergy PV Inverter Data in Home Assistant

šŸ“… April 10th, 2022, updated December 30th, 2022 šŸ”– iot ā²ļø 2 minutes to read

I recently had solar panels installed, which included an inverter from GivEnergy.

If you want to analyse your usage, the GivEnergy portal allows you to do that, with graphs to explore the data over time. However, it has one big limitation: the data in the web portal is sent every 5 minutes from the inverter, meaning you can't get live data out of the system.

GivEnergy do publish a tool which you can run inside your home network, which will connect to the inverter over TCP, then forward any data it sends to an MQTT broker.

Continue Reading »

Useful ffmpeg Recipes

šŸ“… January 31st, 2022 šŸ”– tools ā²ļø 1 minute to read

A few ffmpeg commands I find useful, so I don't need to keep reading the documentation.

Contents

  1. [Convert to mp4]
  2. [Concatenate]
  3. [Speed Up]
  4. [Seek and Crop]
  5. [Resize]

Continue Reading »

Force Refresh Rocket.Chat Snap SSL Certificate via Caddy

šŸ“… January 29th, 2022 šŸ”– cloud-software ā²ļø 1 minute to read

I use Rocket.Chat installed via Snap on a Ubuntu VPS instance. The instance automatically manages its own SSL certificate via Caddy, using Let's Encrypt as the certificate issuer.

It has been working well for a few years, however today I opened up the web interface and was greeted by this error:

SEC_ERROR_REVOKED_CERTIFICATE

Fortunately I remembered the following email from Let's Encrypt, which I had completely ignored at the time:

Please immediately renew your TLS certificate(s) that were issued from Let's Encrypt using the TLS-ALPN-01 validation method and the following ACME registration (account) ID(s):

Continue Reading »

Pushing to Public AWS Container Registry with GitHub Actions

šŸ“… May 23rd, 2021 šŸ”– cloud-software ā²ļø 1 minute to read

I wanted to push a Docker container I use for some automation tasks to my own public container registry, because it would mean I didn't need to deal with authentication on the consuming end (since the code was public in GitHub anyway).

The Dockerfile is at the root of my repository, and steps prior build the code (in this case it's a C# application).

Continue Reading »

Graphing Sensor Data from a Raspberry Pi with Grafana

šŸ“… May 22nd, 2021, updated December 30th, 2022 šŸ”– iot ā²ļø 4 minutes to read

For a weekend project I picked up an Enviro + Air Quality board with a particulate monitor. My goal was to start recording this data and feed it into Grafana for viewing.

The board itself, with the display showing temperature, humidity and pressure

The particulate graph as an example of the output

There's various other sensor data: temperature, pressure, humidity, light, gas and noise. I'm sampling the data every second and sending it to Graphite hosted in docker container on a Ubuntu VPS, which is consumed by Grafana.

Continue Reading »

Create Meshes from Height Maps using Blender

šŸ“… May 16th, 2021 šŸ”– game-development ā²ļø 3 minutes to read

Here's an example mesh created by the technique I'll outline in this post, from a heightmap using Blender.

Height maps are textures which represent the height of geometry as a black and white image - black means "low" and white means "high".

Part of a pebble floor surface heightmap Ā© Epic Games

These heightmaps can be used in conjunction with a shading technique called tessellation, which subdivides geometry on the graphics card to increase the triangle density. A height map can then be applied to the surface to raise and lower the vertices of the generated triangles, and the result is a detailed surface.

Continue Reading »

Recording Camera Animations for UE4 with a Phone

šŸ“… May 15th, 2021, updated May 31st, 2021 šŸ”– game-development ā²ļø 2 minutes to read

Here's the final result in UE4, captured by me crawling around on the floor with my iPhone 8.

A camera sequence from one of my unannounced projects

I used the app VirtuCamera for iOS, which connects via WiFi to Blender or Maya and transmits the camera movements live for recording onto an animation track. It will also broadcast the viewport back to your device, meaning you can see your 3D environment on the phone's screen whilst recording the animation.

Continue Reading »

The Art of Mirror's Edge

šŸ“… April 11th, 2021 šŸ”– game-art ā²ļø 3 minutes to read

One of my favourite games is Mirror's Edge (2008) because its art stands out above all else. I would not recommend it for its gameplay or story, but it has served as an inspiration for me in terms of environment art and level design.

This post takes a walk down memory lane into Mirror's Edge, with lossless 1440p screenshots taken straight from the Steam copy of the game (no processing). I also wanted an easy-accessible record of the level art for my own archives, since it's mostly a showcase of what great artists can achieve with standard rendering tech.

Cityscapes

Probably one of the most iconic features of the game are the broad cityscapes. These typically consist of rooftops with a lot of verticality provided by ledges and HVAC systems.

One thing that really sells these scenes for me is the scale of everything - the low-poly distant buildings blend right in with the detailed foreground. In addition light and shadow plays a big role, with buildings obscuring sunlight and objects on rooftops casting massive shadows.

Continue Reading »

Serving Static Websites Using Lambda@Edge

šŸ“… March 20th, 2021, updated April 4th, 2021 šŸ”– cloud-software ā²ļø 3 minutes to read

A typical approach to static websites on AWS involves a CloudFront distribution pointed at an S3 bucket.

One drawback to this approach is that in the event of a cache miss, CloudFront must retrieve the content from S3. If the bucket is in Ireland and the edge cache is in Australia, this will mean a round trip between those points.

In reality this latency isn't really a problem since it's only evident on a cache miss, but (more as as an experiment than anything else) I decided to write a proof of concept to serve static content entirely from the edge cache.

Continue Reading »

Thread Safe Random in C♯

šŸ“… March 16th, 2021 šŸ”– c-sharp ā²ļø 1 minute to read

The C♯ class to generate random numbers, System.Random is not thread safe. If you share the same Random instance across threads things start to break.

Microsoft offer some solutions for this (for example locking), but if you just want to generate some random numbers and don't need them to follow a predictable stream, there are simpler (and safer) solutions.

Continue Reading »

Spotting Fake Indie Game Key Requests

šŸ“… March 11th, 2021, updated October 12th, 2021 šŸ”– game-development ā²ļø 2 minutes to read

If you're an indie game developer, you will very likely see key requests from bad actors trying to get game keys to sell. It's par for the course unfortunately, but it's increasingly difficult to distinguish genuine review requests from fake ones (especially when juggling a game release).

I recently released a game on Nintendo Switch after releasing it on Steam a year prior, and I noticed a big increase in how sophisticated the illegitimate requests were for the Switch release.

Continue Reading »

Jenkins Library for Unreal Engine 4

šŸ“… February 13th, 2021 šŸ”– game-development ā²ļø 1 minute to read

For Estranged: The Departure, I released on Steam many hundreds of times, all at the push of a button using a tool called Jenkins.

At its core, Jenkins is a job scheduling system, where a job consists of some commands to run. You can define the job in the Jenkins interface or, as I prefer, in a Jenkinsfile which lives at the root of your source control repository.

I won't explain how to get a Jenkins server and attach a Windows build machine to it as there are better resources out there to explain that:

  • How to Install Jenkins on Ubuntu 20.04 | DigitalOcean
  • Jenkins Open Source Automation One-Click App | Marketplace | Linode
  • Step by step guide to set up master and agent machines on Windows

This post outlines the general-purpose Jenkins library I developed for Estranged. The library can be found here:

  • https://github.com/alanedwardes/Jenkins.UnrealEngine.Builder

Continue Reading »

Three Approaches to Readable Materials in First Person Games

šŸ“… February 7th, 2021 šŸ”– game-development ā²ļø 4 minutes to read

In Estranged: Act I (2014) and Estranged: The Departure (2020) a lot of the storytelling was via newspapers and interactive screens, using different approaches in each game. In this post I will document those approaches and discuss the benefits and drawbacks of each.

  1. [Full-Screen Take Over]
  2. [First Person Camera]
  3. [Cut-Scene Camera]
  4. [Conclusion]

Continue Reading »

Cheap Synthetic Monitoring with AWS Lambda

šŸ“… January 24th, 2021 šŸ”– cloud-software ā²ļø 1 minute to read

I have a few miscellaneous services which I host for various personal things; MediaWiki, Jenkins, Grafana, Rocket Chat, etc. These are usually hosted on VPS machines with Docker, which means a "one size fits all" monitoring solution is hard.

If I were operating as a business, I would just opt for an off-the-shelf synthetic monitoring solution with a support contract and call it done, but in a personal capacity I don't particularly want to pay.

I had a few criteria:

  • Cheap/free
  • Ability to write synthetic checks using HTTP requests (not a headless browser, that is a bit OTT)
  • Synthetic checks preferably in C#
  • Alerting via email for when the checks fail
  • Hosted redundantly & managed (e.g. AWS, not on a VPS)
  • Low/zero maintenance

Continue Reading »

Generating Mipmaps for Render Targets in UE4

šŸ“… December 24th, 2020 šŸ”– game-development ā²ļø 1 minute to read

TLDR; use UTextureRenderTarget2D::UpdateResourceImmediate after updating your RT. Ensure you set bAutoGenerateMips to true on your render target instance.

When you create the RT, you pass it a UCanvasRenderTarget2D derived class; so you can blueprint this class and set bAutoGenerateMips on it in the editor, rather than doing this in code.

Continue Reading »

Routing DNS over HTTPS Using Raspberry Pi

šŸ“… October 6th, 2020, updated January 4th, 2023 šŸ”– iot ā²ļø 4 minutes to read

DNS is a protocol from the late 1980s, and today at its core DNS is still exactly the same. When it was conceived, there wasn't the same privacy focus as there is today, and one of the main drawbacks with the protocol is that queries and responses are not encrypted nor tamper proof when sent over the internet.

DNS over HTTPS is a newer take on the original DNS protocol, which routes queries over secure HTTP connections. While this is seeing some support (namely in Firefox and Windows 10), many devices on your network will continue to send DNS queries over UDP for years to come.

Continue Reading »

Tips for Building Games with Unreal Engine 4

šŸ“… October 3rd, 2020 šŸ”– game-development ā²ļø 18 minutes to read

I have released Estranged: The Departure on 3 platforms, Windows, macOS and Linux, and I will be bringing it to the Nintendo Switch and other platforms in the coming months.

This blog post covers my experiences as a solo developer, working with Unreal Engine since 2014 (without access to the UDN), and what to look out for if you are new to the engine.

I intend to keep this post updated (a living document).

Continue Reading »

Serving Localised Assets from S3 Using Lambda@Edge

šŸ“… May 17th, 2020 šŸ”– cloud-software ā²ļø 3 minutes to read

Using Lambda@Edge, you can route users to different assets depending on their browser language, country or device (to name a few). In this post I am going to focus on the Accept-Language header, to detect the user's locale.

Demo

Example image served using this technique:

The text 'GB' for users visiting from the UK, 'US' from the US, 'CA' from Canada, 'EN' for other English speakers and 'GLOBAL' for anyone else.

Depending on your browser language, you will see:

  • "GB" for "English (United Kingdom)" (region-test.png.en-GB)
  • "US" for "English (United States)" (region-test.png.en-US)
  • "CA" for "English (Canada)" (region-test.png.en-CA)
  • "EN" for "English" (region-test.png.en)
  • "GLOBAL" if set to anything else (region-test.png)

Continue Reading »

Automating macOS Notarization for UE4

šŸ“… November 23rd, 2019 šŸ”– game-development ā²ļø 4 minutes to read

One of the trickier requirements introduced with macOS Catalina was the requirement that all applications must be notarized, for any kind of distribution.

Xcode does have tools to do this for you, but when you're building software that is bootstrapped by its own build process (such as a game), or you automate the build and deployment of your app, you need to use the custom workflow.

This post will discuss the entire notarization process for an Unreal Engine 4 game, but the process is the same for any app bundle.

Continue Reading »

ISO Country Code to Unicode Flag in C♯ and JavaScript

šŸ“… July 22nd, 2018, updated March 15th, 2021 šŸ”– c-sharp ā²ļø 1 minute to read

The Unicode 6.0 spec defines Regional Indicator symbols, which includes a set of flags. Here are the founders of NATO, if your system supports the flag characters (Windows 10 doesn't yet):

šŸ‡§šŸ‡Ŗ šŸ‡ØšŸ‡¦ šŸ‡©šŸ‡° šŸ‡«šŸ‡· šŸ‡®šŸ‡ø šŸ‡®šŸ‡¹ šŸ‡±šŸ‡ŗ šŸ‡³šŸ‡± šŸ‡³šŸ‡“ šŸ‡µšŸ‡¹ šŸ‡¬šŸ‡§ šŸ‡ŗšŸ‡ø

To create a flag, take the country ISO code (for example GB), and offset it to the flags Unicode block.

Continue Reading »

Serverless Git LFS for Game Development

šŸ“… January 6th, 2018, updated July 24th, 2022 šŸ”– cloud-software ā²ļø 3 minutes to read

For Estranged, I needed a simple, cheap way of storing binary files. All solutions I tested required me to host a server, or me to pay someone to host a server. I wanted to avoid the flat fee for a constantly running server, and use something completely serverless with a pay-for-what-you-use model.

I settled on using a GitHub private git repository (free) and an LFS (large file storage) backend using Amazon Lambda, Amazon S3 and Amazon API Gateway.

This write-up is a follow up to my older YouTube video covering the manual setup. This guide uses a template for a 1-click deployment of all resources mentioned in the video.

Continue Reading »

Adding Custom Map Checks in UE4

šŸ“… January 3rd, 2018 šŸ”– game-development ā²ļø 2 minutes to read

The map check function in UE4 offers level designers an insight into things that are going wrong inside their levels - for example a static mesh actor with no mesh.

Two errors in the Unreal Engine 4 map checker output, against two actors which have null static meshes.

You can also harness this power in your own project to run anything in the game world through a custom set of rules specific to your content.

For example, in Estranged, all surfaces in all levels need to have a physical material assigned to them.

This assignment has various functions, but most importantly dictates the footstep sound when the player walks on the material, and the bullet decal and particle effect to spawn when the surface is shot.

Continue Reading »

Building and Deploying a React App Using AWS Lambda

šŸ“… December 24th, 2017 šŸ”– cloud-software ā²ļø 2 minutes to read

If you use React with a static frontend web app, the deployment steps may comprise of the following:

  • Run npm install
  • Run npm test
  • Run npm build
  • Deploy build folder to Amazon S3 & invalidate CDN cache

The first part of the build only requires node.js & npm, and the second part can be written in JavaScript too as a package.json script (I'll go into that more below).

Since node and npm are both available on Lambda, we can write a Lambda function invoked using a post-commit webhook (from GitHub or BitBucket), which builds and deploys the React application.

A few advantages to doing this:

  • You don't need any orchestration infrastructure (Jenkins) or cost overhead of BitBucket pipelines and similar solutions
  • Since the environment is completely managed, the only changes you may need to make are updating the Node.js runtime version as Amazon release newer versions
  • Access to the S3 bucket is controlled using IAM roles, no access key/secret

Continue Reading »

Git HTTP Username and Password in Environment Variables

šŸ“… December 22nd, 2017 šŸ”– cloud-software ā²ļø 1 minute to read

Sometimes when automating the use of the git command in scripts against GitHub or BitBucket, you may need to supply a username and password using environment variables.

One example is when using a Jenkinsfile groovy script in a Jenkins pipeline build, where you'd like to use credentials from the Jenkins credentials store.

Fortunately this is possible using a custom git credential helper, in this case a simple bash script (however you can use whatever language you like).

Credential Helper Shell Script

The shell script simply needs to echo a username and password back to git. The below script takes the $GIT_USERNAME and $GIT_PASSWORD environment variables, and prints them in a format git understands.

#!/bin/bash
echo username=$GIT_USERNAME
echo password=$GIT_PASSWORD

Save this as credential-helper.sh

Continue Reading »

Capturing and Uploading Screenshots in UE4

šŸ“… December 20th, 2017 šŸ”– game-development ā²ļø 1 minute to read

For Estranged, I wanted the ability to capture the contents of the frame buffer, compress it, and upload it to a REST API. This allows users to attach screenshots to an in-game feedback window, to simplify the bug reporting process.

Unreal Engine 4 has APIs around all of those pieces, and in this post, I'll cover sticking them all together.

The full header and source file from the Estranged code is available as a GitHub gist. Below are the important excerpts.

Capturing a Screenshot

This is a two step process. First, you need to register a callback for when the screenshot is captured, then you request a screenshot:

void UEstScreenshotTaker::RequestScreenshot()
{
    GEngine->GameViewport->OnScreenshotCaptured().AddUObject(this, &UEstScreenshotTaker::AcceptScreenshot);
    FScreenshotRequest::RequestScreenshot(false); // False means don't include any UI
}

void UEstScreenshotTaker::AcceptScreenshot(int32 InSizeX, int32 InSizeY, const TArray<FColor>& InImageData)
{
    // See below
}

Continue Reading »

Using Capsule Shadows on Large Objects in UE4

šŸ“… December 8th, 2017, updated November 26th, 2022 šŸ”– game-development ā²ļø 1 minute to read

Capsule shadows are a great feature of Unreal Engine as they allow characters to cast soft shadows even with a game which relies on only static lighting.

The Last of Us 1 used this to great effect, as levels had a lot of areas which didn't receive dynamic lighting, and characters still felt grounded in the world using the capsule shadow technique (below).

Continue Reading »

Æ

© 2023 Alan Edwardes