LiveOps Demo
This demo showcases how you can use the Unreal SDK's Announcements Subsystem to notify players of events while providing claimable gifts that'll end up in the player's inventory.
Aside from our BeamableCore
Plugin, here's what the sample contains:
BEAMPROJ_LiveOpsDemo
Unreal Plugin.: Contains the UE implementation for the sample's client. The core code is insideLiveOpsDemoMainMenu.h
and part of the implementation is done through BPs inside the folderUI_BPs
folder of theBEAMPROJ_LiveOpsDemo
project.Microservice/LiveOpsDemo
Microservice: Microservice containing code that's used by the sample for various inventory and stat related things.
To set up this sample you'll need a a Beamable Account and a Realm. To configure the repo for the sample:
- Set the BeamProjOverride.txt
to BEAMPROJ_LiveOpsDemo
.
- Re-generate your project files.
Setting up the Beamable Realm¶
To set up an organization and realm to run this sample, follow the steps below.
- Go to the Beamable Portal and create a new Beamable realm called
liveops-demo
- Compile and open the
BeamableUnreal
editor project. - Sign into your Beamable account and go to the
liveops-demo
realm.- Hit
Apply to Build
after the realm change is done.
- Hit
- Open the
Content
window.- Ensure there's an
item
content with the namesample_item
. - Ensure there are 2
currency
contents with namesgems
andcoins
- Click
Publish
to publish this new content to the realm.
- Ensure there's an
- Go back to the Beamable Portal.
- Choose
liveops-demo
realm from Beamable portal. - Go to
Communicate->Campaigns
. - Click on Create Campaign.
- Initialize the campaign scheduling, content, and the gifts it provides and save it.
- Make sure the type is
Announcement
. - In the
Content
section, add a Gift that gives some amount ofcoin
to the user. Optionally, you can also gift them an instance of thesample_item
with a property calledlevel
set to1
. - You can leave the rest as the default.
- Make sure the type is
- Choose
Running the Sample in PIE¶
Now you're set up to run the sample.
- Open the Unreal editor.
- Go to the
Microservice
window.- You should see the
LiveOpsDemoMS
service there. Select it. - Click
Run
and wait until you see theService ready for traffic
log line (and the running icon in the Microservice's card to change). - After you're done with the sample, don't forget to come here and stop the service.
- You should see the
- Open the
LiveOpsDemo
Level.- You can find it inside the
BEAMPROJ_LiveOpsDemo Content
folder. - If you can't see plugin content in your content browser, you can change the settings of the UE
Content Browser
to display it.
- You can find it inside the
- Reset PIE Users.
- Open PIE.
At runtime, the sample works in the following way:
- Every time you run the demo, it will initialize the player inventory with 3 sample items that have the an item property called
level
set to1
.- It'll also initialize a
sample_stat
with the value1
.
- It'll also initialize a
- In the announcements menu, you'll find all the announcements you configured via the portal (provided the schedule you put in makes it active).
- You can click on any announcement.
- Doing so, shows its content and all the gifts that could be claimed through this announcement (if any).
- You can claim the gifts inside the announcement by clicking on the claim button.
- You can see each of the
sample_item
instances the player has and their level at the right portion of the screen.- You should be able to upgrade the item level using the upgrade button.
- You can also click the button next to the
sample stat
stat to increment it.
What can you do with this sample?¶
This sample is NOT a template you can start your own repository from.
However, its Beamable code components are free for you to copy and use in your own project. Here's what these are:
- The LiveOpsDemoMS Microservice : located inside Microservice/LiveOpsDemoMS
- Beamable code and blueprints inside BEAMPROJ_LiveOpsDemo plugin