UEFN Blog: A Breath of Fresh Air, from CTO Jay Pecho

UEFN Blog: A Breath of Fresh Air, from CTO Jay Pecho

Welcome to our first blog post at Look North World!

For this post, I want to start from the beginning.

We started a company to build experiences within Fortnite. Why am I so excited about this? What’s it like working in UEFN compared to working on a multi-million dollar AAA mobile game? Do I miss working in a “real programming language” like C++? Let’s get started!

So, how are things different from AAA dev? First, the scope of what you can build (right now) in UEFN is just more limited. I find this to be the titular breath of fresh air. Coming off of a 6+ year project that was never globally released, the idea that we could build a fun experience in only a few months is extremely exciting. Not to mention, there are hundreds of millions of Fortnite players out there that are looking for new experiences within the game. As a software engineer and game designer, I find that constraints fuel creativity. 

One of my first successful projects as a game developer was “Where’s My Water?” The constraint for that game was to build a level-based physics puzzler in the vein of “Angry Birds” or “Cut the Rope.” The game should be playable without scrolling and with a single input (i.e. your finger). That quickly eliminated a lot of genres and allowed our team to focus our creativity on one type of game. The same is true of UEFN. Right now, you can’t build “Where’s My Water?” or anything else that is a huge departure from the traditional “Fortnite” gameplay, and I find that invigorating.

Another difference comes from how game logic is built. UEFN introduced scripting into the Fortnite Creative ecosystem via the Verse programming language. While I’ve never used Haskell or Swift, Verse seems to take a lot of syntax and ideas from both languages (one of the creators of Verse also created Haskell, so that makes sense).

Coming from C++, there is a lot I like about Verse. The syntax is different and takes some getting used to but once you are used to the idiosyncrasies of the language, you really start to fly. This could be a whole ‘nother blog post but the way Verse handles concurrency is pretty interesting. Also, with Verse in UEFN, there are no “update” functions. You use the latent/concurrency features of the language to handle anything that requires periodic updates.

Building game logic in UEFN is like gluing puzzle pieces together. You have to find the right puzzle pieces, and then you use Verse to glue those pieces together.

Let me give you an example from Outlaw Corral. You may have noticed while spectating someone who wins a match that the weapon spawners are switching weapons (as in the video above). We wanted to pick a random weapon every round and didn't want those weapons to repeat between different rounds in the same tournament. In a traditional game engine, we could simply code that logic - create an array of weapons, pick a random index in the array, mark that index as used, and spawn the one we picked. 

In UEFN, it’s a bit more complicated. The weapon spawner takes an array of items it will spawn but you can’t randomly index into it. There is an API to go to the next item but it doesn’t do anything unless the item is spawned. So in order for us to achieve our goals, we have to connect a few devices and some custom logic together. First, we have a Verse device that “tracks” the current index in the array of the item spawner. Because we actually have to spawn the weapons and we don’t want them to just be sitting there in the level, we also need a mutator zone that gives pickups a very short lifetime. So we iterate to the index we randomly pick, spawning and despawning all of the weapons along the way. This may seem cumbersome, and it is, but it’s also fun to figure out how to achieve your goals with the puzzle pieces you have.

While UEFN has been a positive development experience for us, there are a few things on my wish list. One of the main things that I’m hopeful for is that Epic will continue to improve upon its debug facilities. Currently, there are two main ways to debug problems in your game. First, there is a Verse API for debug drawables. The API will be familiar to developers who have experience in Unreal Engine. You can draw colored wireframe shapes anywhere in the world. The second way to debug, which many programmers will hold near and dear to their heart is print debugging. I recently saw a debate on twitter where people said they don’t need anything more than print debugging, while the other side said it’s impossible to debug without a debugger. I’m in the camp of: “You don’t need a debugger until you do.” There are certain classes of problems that are just easier to debug with an actual debugger. That aside, UEFN print based debugging works just fine… most of the time.

In my opinion, there are a few improvements to be made here. First, the logs are streamed to the editor from the server hosting the creative session. If you have too many log statements, they get throttled and some logs may be lost, so making sure logs do not get lost would be a huge improvement. Second, logs are only available in creative sessions attached to the editor. Private and public island codes do not have accessible logs or other debug information. Some bugs may only occur in a live environment or at scale so having access to live debug info would be beneficial to most teams. For example, live logs could have a different log level and/or could be throttled so as not to affect the experience.

As it is, we’ve resorted to putting some relevant information on the screen in semi-transparent text so as not to distract players. You can see this text in the top left corner of the screen. This way if players took screenshots of a bug, we could get some information about the state of the world. We felt the trade off of having some “weird” text visible to the player was worth maximizing our ability to address bugs in live.

I’m super excited about the future of UEFN. Like any new platform, there are lots of things that can be improved upon. The cadence of updates from Epic and the excitement within the community have me looking to the future with enthusiasm for the adventure ahead. If this post has piqued your interest in developing on UEFN, drop us a line and keep an eye out for future job openings here at Look North World.