Skip to content

TheMagicWorlds/MagicWorldsUnreal

Repository files navigation

MagicWorlds

Have a magical experience within the Worlds with the Magical Bots!

Using Unreal Engine version 5.6

Env variables

Note: ignore this section if you didn't do the Epic Games Developer Portal setup yet. Go to the Multiplayer section and then go back here after all is done.

You must set up environment variables on Windows to use properly this project. Expected variables (Prefix MW so we know the var is from MagicWorlds. Note that the vars that contains DEV are for when using the DevAuthTool for testing MP locally):

  • MW_APPLICATION_ID
  • MW_CLIENT_ID
  • MW_CLIENT_SECRET
  • MW_DEV_CLIENT_ID
  • MW_DEV_CLIENT_SECRET
  • MW_DEPLOYMENT_ID
  • MW_SANDBOX_ID

All of the IDs can be found at the Developer Portal. Gather the IDs (if you don't have two clients setup at the portal, just ignore the DEV IDs and change the DefaultEngine.ini file to use the environment vars that don't have the DEV prefix.) and execute the setup-env.bat script to configure the environment variables.

Multiplayer

In order to test the multiplayer, first change the variable bIsInLobby to true (this controls whether the UI for creating a room and joining should appear or not). Note that currently there is only a setup to test if it works, so the join room functionality only looks for the first room created and joins that room.

Currently the application only works with connections using the DevAuthTool. There is not much configuration that need to be done, besides the configs at the Developer Portal. Just in case, I'll put here what is needed at the Portal in order to the multiplayer works

Creating Organization and Product

First access the Epic Games Developer Portal and sign in with the Epic Games account that Magic Worlds will use for development.

When logged in, you must create an organization. After creating it, you then need to create a Product, which will be the MagicWorlds page for accessing all of the Epic Games services available, inlucuding the EOS for online connections.

After creating the product, your organization page should look like this: Developer portal

Creating a Client

Now that you have the product created, we need to create a client so we get the ClientID. I recommend creating two Clients, one for local testing and another for production (that's what I did).

At the sidebar on the left, go to Product Settings. You will see the EOS SDK Credentials, which is the page you where you will get the IDs for the environment variables. If you scroll down a bit, you'll see that the Clients section is empty, and there is a link that send you to the page to create a CLient. Click on the link, accept the terms (needs to scroll all the way down to be able to accept it). It will get you back to the settings page, just scroll down again and click again on the link.

Settings no client

At the Clients page, you need to create a Client policy. If you just want to have something ready to go asap, just copy what I did. We will create two clients and two policies.

Developer

  • Click on the "Add new client policy" button.
  • Give any name for the policy (e.g "Developer")
  • Set Client policy type as Custom
  • Check only the following: User required; Lobby; Sessions; Voice
  • Save

Production

  • Click on the "Add new client policy" button.
  • Give any name for the policy (e.g "MPV_Policy")
  • Set Client policy type as Peer2Peer
  • Save

Probably when change to dedicated server you will want to review the Production policies. But for now it suits very well.

It will look like this when you setup: Client policies

Now we can create the Clients. At the same page, go to the section Clients and let's create two clients

Development

  • Add new client
  • Set client name (e.g DevToolClient)
  • Select the client policy for development (in my case it's "Developer")
  • Add new client (you can leave the rest in blank)

Production

  • Add new client
  • Set client name (e.g Unstrusted Client)
  • Select the client policy for development (in my case it's "MVP Policy")
  • Add new client

Now that the client is configured, there is one last step so you can use the online services.

Epic Account Services

At the sidebar on the left, go to "Epic Account Services" and accept the terms. Here it's needed to create another Application so it's possible to use Epic Games accounts in order to access the online services.

  • Click on the "Create Application" button
  • You can ignore the "Brand Settings" section, it's not needed for development.
  • Click on the "Permissions" button (at the top right of the page).
  • Click on Save changes, the default settings are fine. The button of Permissions should have a green text saying it's configured.
  • Click on Linked Clients
  • Go to "Select Clients" and select the Production client.

All done! If you don't do this step you won't be able to test the multiplayer with other computers.

IDs

Now that everything is configured, go again to the Product Settings page (at the sidebar on the left), scroll down a bit and get the following IDs:

  • Product ID
  • Client ID (for the development Client)
  • Client Secret (for the development Client)
  • Client ID (for the production Client)
  • Client Secret (for the production Client)
  • Application ID
  • Sandbox ID (Live)

Note: When I tested for the first time I only had the Live Sandbox type, for some reason now it gives me two new types: Dev and Stage. I suppose it's better to use the Dev one for testing, if it appears to you.

When you have it all setup, get the IDs I listed and run the setup-env.bat script. It will asks for all those IDs, pay extra attention because the script sets fixed env vars, so if you mess up you will need to change manually the variables.

Dev Auth Tool

After running the setup-env.bat script and compiling the project (I suppose it's needed to compile it at visual studio, but I'm not sure), make sure to edit the dev-auth-tool.bat script to have the right path to the DevAuthTool binary. After editing the variable inside the script, you can just run the script to open the tool (nice time saver).

Note: You must have two Epic Games Account to properly test the tool. I'll record a video on how to use the tool, it's very simple.

The port the program asks is the same that is at the DefaultEngine.ini, if you want to change it, just change the variable value there

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published