Some general questions about UEFN

Hello, I have some general questions about UEFN and how to structure my project. I have come from Roblox Studio so my understanding of development is somewhat restricted to how things are done there.

I would say I am a casual beginner developer. I don’t play Fortnite as a game, so forgive me if some of these questions seem obvious or non-applicable.

I am very interested in learning UEFN as the games look a lot better quality, but I don’t have the expertise in programming to fully wrap my head around transferring any skills from a different environment.

Any insight would be greatly appreciated as I work through the documentation and tutorials.

  • Roblox Studio uses a client/server model where you can send things to the client for just the local player, or to the server for the whole game session to see.

How does the client/model apply to UEFN?

  • In Roblox Studio you can insert a script into just about anything (e.g. a model of a floor) and then that instance of that floor will do whatever the script says (e.g. move back and fourth between 2 coordinates).

How does scripting specific objects in your game apply in UEFN?

  • In Roblox Studio you can store assets into something called ReplicatedStorage and then reference those assets when you need them basically creating an instance. For example, if a player has an inventory of thousands of pets and they want to spawn a team of 5 pets, they will need to reference the assets to spawn for the player.

How are those meshes brought from the game’s storage of assets and instanced to the player?

  • In Roblox studio, you can write scripts just in the general scope of your project (not directly inserted into a model/asset and then reference an asset for that script to manipulate later on.

How does it work referencing assets from a script that’s not directly linked to the asset?

  • In Roblox studio, you create a function in any script you choose called “onPlayerAdded” that handles when a player joins the session and when a player leaves the session (“onPlayerRemoved”).

Are there similar built in functions for UEFN?

I am not an expert, but let me kick off the discussions, and others can correct me.

Creating in Fortnite started with Creative, a game mode that allows you to set-dress one of few pre-made islands. Functionality is added through Devices which make it possible to customize the experience. New Devices are being added and old ones revised every now and then to expand what’s possible to make. Obviously, experiences closer to a 3rd-person shooter are easier to make, because they are closer to the original Fortnite.

To give creators more control, UEFN (Unreal Engine for Fortnite) was made. It’s a special, stripped-down build of UE. It gives access to Landscape editing and advanced set-dressing tools.

Custom Devices can be made through the use of a new language called Verse (for the Metaverse). These can interface with the Fortnite Devices and/or call Unreal Engine, Verse, and/or Fortnite APIs. We still don’t have full coverage, though.

The newest addition is Scene Graph. It’s a way to represent scenes and assets. It introduces concepts like entities, components, and prefabs (prefabricated assets). Entities contain components which can be prebuilt or custom (Verse components).

By default, logic is run on the server. There are ways to do custom things per player, though. This highly depends on what you’re trying to do, so it’s better to ask on Discord when you have a specific thing you want to implement.

The closest thing to this are Verse Components. You can add your component to almost any entity. Please note that Scene Graph is still underdevelopment. If the logic you want is already provided by a device, you’re better of using it. Components are lower-level building blocks that can also come with the functionality you need. Some assets also have functionality built in.

Islands are allowed storage for their custom assets and are expected to not exceed certain run-time memory limit to accommodate for all devices Fortnite can run on. Additionally, we have access to the Fortnite library of assets which mostly do not add to the project size. You import custom assets into the project and can place them directly in the level or spawn them.

Verse Devices are probably the closest thing. If these assets are props placed in the level, you can directly reference them through editable fields. You can also find them (useful if they are spawned) using tags. A similar workflow should be possible using Verse Components with prefabs.

There are many events that custom functions can subscribe to. The player added and removed events exist under the Playspace.

I suggest to start here. This links to the documentation which covers pretty much everything. The topics are listed on the bottom left. You can also filter down to what you need. Note that some pages can be a little outdated.

If you feel lost or don’t know whether something is possible, you can ask the Developer Assistant. It’s usually good. It links to sources at the bottom of the answer (usually documentation pages), so it can help you figure out what you need to read.

2 Likes

Wow, thank you for the detailed reply. I’ll be sure to reference this post and check out the links you provided.

I just have one query regarding this part:

when I added a mesh into the project, it already appears in the world permanently. Can you actually store these things inside the project but only spawn them into view for the player when needed (e.g. spawning a follower for the player)? I obviously wouldn’t want hundreds of meshes under the game world ready to move when a player wants to physically see them.

Everything else you said made complete sense, so thank you. I’ll definitely dive into devices and have already played around with basic Verse syntax.

This last one is something I’m still not understanding.

1 Like

That doesn’t sound right. Can you verify that you followed these steps to import the asset?

Spawning them into the level is possible. You need to make a prop out of the asset first. The steps are explained here.

I asked the Developer Assistant, “I created a prop. How do I spawn it into the level?”, and it gave me the following code (which works).

using { /Verse.org/Simulation }
using { /Verse.org/Assets }
using { /UnrealEngine.com/Temporary/SpatialMath }
using { /Fortnite.com/Devices }

# Example device to spawn a prop at a specific location
prop_spawner_device := class(creative_device):
    # Reference to the prop asset in your project
    @editable
    PropAsset : creative_prop_asset = DefaultCreativePropAsset

    # Location to spawn the prop
    @editable
    SpawnLocation : vector3 = vector3{X := 0.0, Y := 0.0, Z := 0.0}

    # Rotation for the prop
    @editable
    SpawnRotation : rotation = rotation{}

    OnBegin<override>()<suspends>:void =
        # Spawn the prop when the device starts
        SpawnResult := SpawnProp(PropAsset, SpawnLocation, SpawnRotation)
        if (Prop := SpawnResult(0)?):
            if (SpawnResult(1) = spawn_prop_result.Ok):
                Print("Prop spawned successfully!")
            else:
                Print("Failed to spawn prop")

It’s better that you ask it yourself, because it explains the solution and how to implement it (which I didn’t include).

You can also ask it about how to make the prop follow the player. It’s a bit more complicated, but you basically teleport the prop every frame (or move it every few frames). In Scene Graph, it is easier, since we can attach entities to the player entity now. However, the process to spawn assets is different in Scene Graph. I don’t have a lot of experience to offer a solution. You can try to ask the Developer Assistant.

2 Likes

I’m so grateful for your replies. I’ll start to use the AI assistant. If I knew how to mark your post as answered, I would.