question

alvarost1992 avatar image
alvarost1992 asked

Having problems setting up playfab and ue4

Hi Everyone,

I just discovered PlayFab and I think is a great fit for my game but I'm having some issues setting everything up.

I've downloaded the sdk and installed it . Everything compiles on the c++ side and then I jump into the editor and I set up the playFab settings by going to "Edit --> ProjectSettings --> PlayFab"

Here I set Development environment URL, production environment URL, Title Id and developer secret Key copying it from my PlayFab Account.

Then on my BP I do:

And it always returns Fail!

In order to get more info. I've gone into the c++ side and created a function that calls "StartGame" with delegates Success and Error and the message that the error always gives me is "Request Timeout or null response".

This is the code:

void PlayFabCommunicator::StartPlayFabGame()
{
	PlayFab::MatchmakerModels::FStartGameRequest startGameRequest = PlayFab::MatchmakerModels::FStartGameRequest();


	startGameRequest.Build = "";
	startGameRequest.pfRegion = PlayFab::MatchmakerModels::Region::RegionEUWest;
	startGameRequest.GameMode = "";
	startGameRequest.CustomCommandLineData = "";
	startGameRequest.ExternalMatchmakerEventEndpoint = "https://e19.playfabapi.com/";


	matchmakerAPI = IPlayFabModuleInterface::Get().GetMatchmakerAPI();


	matchmakerAPI->StartGame(startGameRequest, 
		PlayFab::UPlayFabMatchmakerAPI::FStartGameDelegate::CreateRaw(this, &PlayFabCommunicator::StartPlayFabGameSuccess),
		PlayFab::FPlayFabErrorDelegate::CreateRaw(this, &PlayFabCommunicator::StartPlayFabGameError));
}

firstplayfabtest.png (127.1 KiB)
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

alvarost1992 avatar image alvarost1992 commented ·

Note: I haven't upload any builds or created any game modes as I don't think is required at the stage I am at?

What am I missing?

Thanks! and keep up the good work :)

0 Likes 0 ·

1 Answer

·
brendan avatar image
brendan answered

Well, the first thing I can say is that no, you can't use Matchmake or StartGame without a game server build uploaded. Those API calls are specifically used to get players into games in custom game servers, as described in this doc: https://api.playfab.com/docs/custom-game-servers.

For your Blueprints case, can you get the complete text of the error response being sent back? It will contain the details of why the call failed.

4 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

alvarost1992 avatar image alvarost1992 commented ·

Hi! Thanks for the quick answer!

This is what i would like to achieve.

Players host listen server Games and other players join them. but to join them they first need to retrieve the list of available servers and then join one.

Is that possible?

0 Likes 0 ·
brendan avatar image brendan alvarost1992 commented ·

The way our matchmaker works is that we choose an available slot in an active game server instance that matches the requirements and return it. If your game design requires this, or any other custom matchmaking, we have a Matchmaker API specifically designed to give you the ability to control the matchmaking experience: https://api.playfab.com/Documentation/Matchmaker. You would need to build a matchmaker server in this case, though you could have that hosted in our service as a distinct build (use our matchmaker to get people into that server, and then use it to determine where to send players).

However, I would actually advise against displaying a list of games and having the player choose one, for two reasons. First and most importantly, players just want to get into a game as quickly as possible. Second, the time it takes a player to look at a list, make a choice, and click on it means that there will be plenty of cases where they try to join a game, but all slots are full because someone else joined while they were looking at the list.

0 Likes 0 ·
alvarost1992 avatar image alvarost1992 brendan commented ·

I agree with you.

In fact, the only reason why I would do a list of servers is because my game is something u would play with friends most of the time. and First I wanna do that right and then jump into "invite friends" and that kind of stuff. most of the time players would just create the server and invite friends, or put a password on it so only their friends could find them.

But yeah,I could just press the button to join a random game or wait for a friend invite to join his.

In any case I would need a build that basically stores players servers and redirects players to specific games submited to playfab.

Is there any guide on how to create a basic custom server?

Thanks!

0 Likes 0 ·
Show more comments

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.