This extension adds Epic Games achievements support to Ren’Py. Ensure that you have accepted the usage conditions for the Epic Games SDK on the Epic Games Dev Portal before using this extension.
In the future, the extension will be updated to cover more EOS features such as authentication. The end goal is to provide a thin ctypes wrapper around all EOS functions as well as helpers for the most commonly used features.
-
Download the latest release (The file’s name is
epic_eos.zip
) -
Unpack the release archive in your game’s directory
-
Create a new
game/epic.rpy
file with the following information:
# Get all attribute values under "Product Settings" -> "SDK Download & Credentials" at dev.epicgames.com
# You may need to create an EOS client for your game in "Product Settings" -> "Clients"
define config.epic_product = '0123456789abcdef0123456789abcdef'
define config.epic_client = 'AbCdEfGhIjKlMnOpQrStUv0123456789'
define config.epic_clientsecret = 'OT60Kvx3QM0ivZTncg8+yypmnNC1bcawfmQQ5C+8AGX'
# Game Deployment ID, may be overwritten by epic when running from the store
define config.epic_deployment = '456789abcdef0123456789abcdef0123'
# The client's policy should have the following Achievements features:
# findAchievementsForLocalUser, unlockAchievementForLocalUser,
# findAchievementDefinitions, readAchievementDefinition
#
# The client's policy should have the following Stats features to use stats:
# findStatsForLocalUser, ingestForLocalUser,
# findStats, readStats
define config.enable_epic_achievements = True
# The requested permissions. See EOS_EAuthScopeFlags for potential value
define config.epic_scopes = 0x0
init -1499 python:
achievement.backends.insert(0, epicapi.EpicBackend())
-
Start epic at the start of your
splashscreen
label (or create one if you don’t have any):
label splashscreen:
if 'epicapi' in globals():
$ epicapi.init()
return
-
Add the library files to your packaging rules file (usually
game/options.rpy
):
init python:
## Epic support, none of those files may be in an archive
# Epic extension
build.classify('game/epic_eos.rpe', 'linux mac windows')
# Epic libs
build.classify('libs/EOSSDK-Win*-Shipping.dll', 'windows')
build.classify('libs/*/xaudio2_9redist.dll', 'windows')
build.classify('libs/libEOSSDK-Linux-Shipping.so', 'linux')
build.classify('libs/libEOSSDK-Mac-Shipping.dylib', 'mac')
-
Follow the wiki’s instructions to configure your game in Epic’s web interface
Loading the Epic DLL on windows requires that the player has the Visual C++ Redistributable installed.
When developing with the EOS SDK, additional downloads are required to ensure that your game behaves as expected:
-
Download the EOS SDK on the Epic Games Portal
-
Extract the Epic Games EOS SDK dev Authentication tool from the SDK (under
SDK/Tools/EOS_DevAuthTool-*.zip
in the archive) -
Run the authentication tool
-
Configure a port when prompted (if in doubt, set it to
6547
) -
Authenticate with a valid account in the authentication tool and set its key (if in doubt, set it to
username_key
) -
Create a new
game/01epic_dev.rpy
in your game with the following content (edit it if you did not use the recommend values before):
define config.epic_sandbox = 'abcdef0123456789abcdef0123456789' # Game Sandbox ID, provided by epic when running from the store
define config.epic_userlogin = 'localhost:6547' # Dev auth tool address:port
define config.epic_userpassword = 'username_key' # The username key configured in the dev auth tool
define config.epic_authtype = 'developer' # Enable dev auth tool usage
#define config.epic_report_achievements_status = False # Do not use Epic when checking achievement status
init python:
# Remove dev file from release
build.classify('game/01epic_dev.rpy', None)
build.classify('game/01epic_dev.rpyc', None)
-
Run the game you’re developping
Note that the authentication tool should always be running and configured during development or your game won’t be able to connect.