Brendan commented · Oct 07, 2015 at 06:30 AM
quirkster
started a topic on Thu, 23 April 2015 at 12:30 PM
There are lots of features to help users connect and interact with friends they already know. But a big challenge exists around helping new users find their first friends to play with as part of the on boarding process.
While random matchmaking is a great tool here, it would also be great to suggest potential friends to users based on whatever criteria is appropriate to the game.
I don't see any server calls to search and return a subset of the user base. Since downloading the entire user base to the client would be expensive, I'm hoping for some shortcuts that we could use in cloud script. For example, from generic to specific...
GetRecentPlayers(#) could download the most recent players that logged into the game. This alone would be a great starter list for newbie matchmaking or any real-time games
GetActivePlayers(#, timespan) could download the players with the most logins over the timespan. These folks would likely make good ambassadors
GetFrequentPlayers(#, timespan, PlayerData variable) could download players with the most matches played of a certain game type as stored in PlayerData, etc.
There are lots of ways to skin the cat here, just as long as we had some tools to query the user base based on some set of criteria and get PlayfabIds in return.
Thanks!
Brook commented · Jun 22, 2018 at 07:12 AM
Hi, Bredan
I was try to implement the friend suggestion list.
What I have done is that I create a cloud script that call GetPlayersInSegment and the segment I request is the segment which filter Level in Static value and last login time. The problem is I try to call this function via https://api.playfab.com/documentation/client/method/ExecuteCloudScript but the result is that "Error": "CloudScriptExecutionTimeLimitExceeded" look like the request is taking more than 7 second and it exceed time limit. What you suggestion?
below is the cloud script code
handlers.getSuggestionPlayer = function(args) { //segment for lvl less than 10 var segmentID = "B55456521E8845C9"; var result =server.GetPlayersInSegment({ "SegmentId": segmentID, "SecondsToLive": 300 , "MaxBatchSize": 10 }); return result; }
The GetPlayersInSegment call does a full re-evaluation of the Segment, so it's really not something I could recommend using in a Cloud Script. For any non-trivial player population, it's very likely you'll be hitting the script execution time limit.
Can you describe what the logic is you're trying to use to determine what players to recommend as potential friends?
Brook commented · Jun 25, 2018 at 02:24 PM
I want to have the player that has level close to player and still active in a week, from what I read I found "GetLeaderboardAroundPlayer" function which solve the first bit but what I need is that those player is still active such as their last login is less that a week.
Raf commented · May 13 at 07:43 PM
The way i solved it was by creating a leaderboard using a number based on the time of login and fetched the top of the list. I also don't post the "score" if the player has maxed their friend slots. (so they don't show up when you fetch the leaderboard)
in my case i used minutes passed since Jan 1, 2022 as the "score"We would love to know what you need. Submit your ideas and upvote others to help us prioritize.