[Released] Unreal CloudSave for specific Gamesparks Integrations

NOTICE I currently do not provide support for the implementation of Character Creator and Gamesparks. However, you can read a basic setup below, and ask here for support questions, i will try to answer them. Hence, I can currently not recommend buying the linked Gumroad package. However, it should still showcase a basic outline of the implementation (besides the Gamesparks part not working, due to server side changes on Gamesparks end).

This project offers a general outline of the setup for Unreal projects with Gamesparks.com cloud data storage.

Provided is a basic multiplayer layout for Gamesparks data storage (usable for soloplayer games as well), with functions for the implementation of the following optimized 3rd party packages:

Character Creator https://www.unrealengine.com/marketp…racter-creator
Action RPG Inventory System https://www.unrealengine.com/marketp…ventory-system

Besides offering example blueprint code for cloud storage with Gamesparks, this offer includes support for customers.

REQUIREMENTS
Unreal Engine 4.16
Gamesparks for 4.16

SCOPE
Implementing Inventory, Stash, Hotbar/Skills, Character data with gamesparks (load and save).

IMPORTANT
This is a nonfunctioning project, it requires advanced knowledge of working with Unreal Engine’s blueprint nodes, and 3rd party content.

HOW TO
If a customer needs specific directions for setting up Gamesparks backend (NoSQL runtime data, and EVENTS with CloudCode), let me know your questions. Same for further explaining the details and obstacles of integrating ARPGIS or Character Creator.

Project at Gumroad

FAQ

How to setup a Stash Container with CloudSave and ARPGIS?
This and similar questions will be addressed in video, if there is an interest for it.

How to setup the Gamespark Backend for Events, Gamespark Cloud Code, and Runtime Collection?
https://forums.unrealengine.com/comm…28#post1448228

This version is working with 4.18.3 for storing and loading character releated ARPGIS data. However, the stash isn’t working in the current version, this will be investigated soon, the culprit is unclear, could be due to Gamesparks changes, UE changes, or CloudSave code missing related updates. Planning to update the release in April.

Notice that the recently updated Character Creator addon has some issues, and at this point I do not plan to use it in the next version, going to skip character creator until other game development roadmap tasks are finished. The current code will remain in place.

However, the Character Creator code is still working, but there are some component related issues (the new male model is without eyes per default, compared to the female model, and the interface was for some reason not properly displayed, after UE upgrade to 4.18.3 from 4.16). These issues might be resolved in an upcoming component update by that developer, or can manually adjusted for. Storing and loading of character data should therefore be unaffected, and still work with the current version of CloudSave for the male character. The female model possibly has some additional values to be stored.

I am requesting documentation/video for the gamesparks backend setup.

Also as a note to anyone else working with this or GameSparks in general, I have found that for my purposes in making an MMO it is best to place the main connection to Gamesparks in the Game Instance as it is persistent across all levels and use the GSObject instead of GS Component. I also found that it is a much simpler solution to call your login widget from a separate Game Mode, lets call it LoginGameMode and have a LoginLevel with a blank map, then once you switch maps have another Game Mode that you use for the rest of your game. I have found if you place the call to the login widget anywhere else that it will keep calling it everytime you change maps/levels.

Hi Spectre Studios, in the following the backend setup.

Content

  1. EVENT SETUP

  2. SETUP EVENT SPECIFIC CLOUD CODE

  3. SETUP + ACCESS RUNTIME COLLECTION

  4. EVENT SETUP
    Login to Gamesparks backend, and navigate to the Events panel.

Next click the ADD button to create a new Event.

Now we create a new Event. In this example an event to access Player Settings.

  1. SETUP EVENT SPECIFIC CLOUD CODE
    The next thing we need to do is adding some Cloud Code. For this we navigate to Configurator - Cloud Code.

Then click on Events, a drop down list of all our created Events appears. Here we choose the PLAYER_Settings Event we just created.

Inside the Event PLAYER_Settings we past the following Cloud Code.


// ====================================================================================================
//
// Cloud Code for ACTIVE_Character, write your code here to customise the GameSparks platform.
//
// For details of the GameSparks Cloud Code API see https://portal.gamesparks.net/docs.htm            
//
// ====================================================================================================
var playerDataList = Spark.runtimeCollection("PlayerData"); // this will get the collection of player data
    var ID = Spark.getPlayer().getPlayerId(); // first we get the id of the current player
    var playerSettings = Spark.getData().SETTINGS;
    var currentPlayer = {
        "playerID": ID,
        "playerSettings": playerSettings
    }; // we construct a new player from the data we are about to input into the player data
    playerDataList.update({
        "playerID": ID
    }, //Looks for a doc with the id of the current player
    {
        "$set": currentPlayer
    }, // Uses the $set mongo modifier to set old player data to the current player data
    true, // Create the document if it does not exist (upsert)
    false // This query will only affect a single object (multi)
    );

Our Cloud Code uses the PlayerData collection of data, which will be used at runtime to load and store most parts of the player data we want to preserve. For highscores, Gamesparks has an inbuilt system called Leaderboards, which have their extra collection - setup during Leaderboard creation.

  1. SETUP + ACCESS RUNTIME COLLECTION

To create our PlayerData collection, or the name for the runtime collection you want to use (needs to be same as in our Cloud Code above), we browse to the Data Explorer panel and click the Add button (with runtime selected), and then type our collection name to create a new Runtime Collection.

Here we called our Runtime Collection (RC) PlayerData. With a click on the Runtime Collection at the sidebar, we can now access it. The Find button loads all the stored runtime data from our selected collection (PlayerData).

Entries in the RC can be modified and deleted manually if required. Our RC Entries are created or modified during the game (at runtime) if we call our Events. We set our Event to Used in Scrypt, and setup the corresponding Cloud Code scrypt to go hand in hand with our Unreal Engine game Blueprint setup. The Blueprint setup for accessing our Events are part of CloudSave.

Interesting, however using the GameMode works in my setup if you set a GameInstance variable for PlayerLoggedIn?, will check on this back later.

If you use Blueprint code to verify the current *MyPlayerState *- for instance with a enumarator setup to switch between states (PlayerLoggedIn, PlayerInMenu, PlayerCreateCharacter and so on), or simple variables, you can prevent the LoginWidget from loading. However, there are many approaches how to setup this kind of game logic, but it probably won’t hurt to have different GameModes - to keep stuff separated.

Ah looks like none of the Runtime stuff will work anymore if you didn’t already have an older project. This feature is disabled for new users.

Important! If you’re working on a new game that was created after the new Game Data Service was launched in January 2018, you won’t be able to create new Mongo Runtime collections in the Collections panel and you’ll get an error if you try to do this or if you try to create a Runtime collection using Cloud Code. If you’re working on a game that you started to develop before the Game Data Service was launched or if you’ve copied a Snapshot of a game you started to develop before the Game Data Service was launched into a new game, you’ll be able to create Mongo Runtime collections. For details on how to work with Mongo collections, see NoSQL Explorer.

Okay, they migrated to Game Data Service on February 1, 2018 https://www.gamesparks.com/blog/game…e-data-service
At this point it is unclear if upgrading to GDS makes sense, or keep using runtime NOSQL collections. Though, I won’t migrate yet.

GDS Howto
https://docs.gamesparks.com/document…game-data.html

Also, they just got acquired by Amazon o.O
https://www.gamesparks.com/blog/gamesparks-joins-amazon

Unit23, I now found this forum thread of yours. Again i seem to be following your tracks with gamesparks. I still am unable to figure out how my cloud code should look compared to yours since I am not using Mongo. Any updates on what the people that are new to gamesparks should do?

Specifically this bit:

"$set": currentPlayer     }, // Uses the $set mongo modifier to set old player data to the current player data     true, // Create the document if it does not exist (upsert)     false // This query will only affect a single object (multi)     );

Spectre did you ever figure this out?