Download

Where is a Real Game Example?????

UPDATE - before you read the rant…
In the First Person Shooter demo the menus don’t appear if you run it from the editor.
Turns out burried down in the C++ code is the menu code for a lot of this.
E.g. in C:\Users\MyName\Documents\Unreal Projects\ShooterGame\Source\ShooterGame\Private\UI\Menu

UPDATE 2 - Building the FirstPerson.exe does not work. Whne you run it you get a black screen.

UPDATE 3 - Ok, found the source for Unreal 4 Engine 4.7 on GitHub. For any serious development it is a fountain of sample code.
Calming down some now. lol


Ok,
We are porting from Untiy to Unreal.

We need to do the followiung, just like every other game out there.

  • Get in a main menu, go to multiplayer menu
  • In multiplayer have a button to create a game.
    • Create the game and register the session so others can find it.
    • Get in the game and play
  • Meanwhile other player run the game and click on a Join button, and get a list of games that are running and available.
    • Click on the game and join the already running Coop game.

This is very straight forward and simple, and I see in C++ how to do it in the Unreal engine
with things like CreateSession with a FOnlineSessionInfo.

In blueprints there is a CreateSession in the online section, but it is useless because it can not take a FOnlineSessionInfo.

So I want to write my own class in C++ to make my own CreateSession blueprint function and related functions (list game, join game etc.)

==== This is where I hit a wall. ====

For any but the most trivial blueprint C++ examples there is nothing. The ShooterGame has none of it.

How does one make something like the existing Create Session bluperint function, with the Success and Failure outputs flow???

How does one make a function in a blueprint in C++ that calls some net function, and then gets a delegate callback
when done, and have the box in the blueprint wait internally for the callback top happen, then continue execution of the blueprint flow???

Is any of this documented in a fashion that is useful? Obviously there is the API docs but like every other engine out there they say NOTHING about how to use them.

There are trivial examples like this https://wiki.unrealengine.com/Blueprints,_Creating_C%2B%2B_Functions_as_new_Blueprint_Nodes that show
how to call a function. But is has to be static, single shot, immediate execution with an answer.
I used that to at least get the Steam Gamertag string to the blueprint.

I tried doing a while loop to wait for a static function to return true that the session create is done,
and Unreal complains is detected an infinite loop.

In C# in Unity this would use a Yield in the function to in effect mutlitask the wait and keep the game active.

I assume there are tags and metatags you put somewhere in the blueprint C++ code to indicate waiting and multiple output paths (maybe?).

I have watched the networking tutorials about network relevance and such over and over. They are very slick and informative about
concepts but in the end are absolutly usless for someone making an actual game to ship.
The ability of the editor to run multiple players in multiple windows is amazing and cool, and great for debugging,
but that tutorial leads to a dead end when you actually want to make a game where you need to have attributes on the session
and search.

My frustration level is very high (and project schedule will soon get behind)

Maybe there is someone I can hire or someone I can pay in consulting at Unreal to get fast answers???

Is the only way to do this is via. C++ and scrap blueprints for networking in a Unreal game???

You have access to the Unreal Tournament 4 source code on Github. This is the ultimate game example, along with all the sample projects you get access to in the Unreal Engine launcher app.

There’s a lot you can usually do in blueprint that you can also do in C++. If you see a UClass with with functions prepended with UFunction that function should be exposed to blueprint. And you can also write a lot of custom C++ code for some things yourself but expose some functionality to blueprint as needed.

I too was confused about creating UI for a while but I just learned about the Widget blueprint editor that is a great way to create UI that isn’t based on Slate. You should be able to create a lot of blueprint based UI’s and still make calls to C++ as needed.