My game is on Steam now with a page and a demo!

Hey guys, if you are curious how the game project has worked out and what ol’ UDK can do in a topdown shoot 'em up format, then check it all out. Let me know if you have any questions or advice.

For now I’m still struggling a bit with some Steamworks features like joining games through the friends list but I’m sure I’ll figure that out before release.

2 Likes

Wow~~ That’s cool~~
Congratulations. :clap::clap::clap:
I’m getting the demo of your game.

1 Like

Thanks! I hope it’s a fun time.

1 Like

Rather than relying on the players needing to forward ports for multiplayer (few will bother), use steam sockets: https://docs.unrealengine.com/udk/Three/OnlineSubsystemSteamworks.html

UDK is already setup for this, you just need to update your NetworkDevice in DefaultEngine.ini.

2 Likes

The background is very cool. I think the effects are good. All the planes are well designed. I enjoyed this game.

However, it is a pity that there are no items in the game. In particular, I think that items that increase the plane speed and items that refill the shield energy are definitely needed. Also, I wish there were more attack methods.

I hope it gets better. Keep up the good work. :clap::clap::blush:

I certainly saw that bit about Steam Sockets. I guess we just couldn’t figure it out, basically we can’t even get the Join Game or Invite buttons to appear on the Steam Friends UI, so it seems like something is broken with the game sessions or server advertisement?

1 Like

Thanks for giving the demo a go! I’m glad you had fun with the game. I’m not sure though if I can also add items along with the graze and variable systems, I will have to see about this and the game balance and difficulty in general.

1 Like

I’ve been trying to help @ciox with the multiplayer, but the documentation is not great.

I tried all of the functions in the API that looked like they might help, but still couldn’t get the “Join Game” option to appear no matter what I did.

These all appear to complete successfully:

  • CreateOnlineGame
  • StartOnlineGame
  • RegisterPlayer

I see my account logging into Steam and they all return success, but I don’t get a Join button or Invite button in the Steam friends list.

I also tried FindOnlineGames, but couldn’t get it to return anything, and so didn’t have the required information to use JoinOnlineGame either.

There’s also mention of Steam lobbies, but as near as I can tell that needs re-compiling UDK?

Any pointers would be greatly appreciated.

1 Like

Before you call CreateOnlineGame(), set your callback for OnlineGameComplete:

gameInterface.AddCreateOnlineGameCompleteDelegate(OnGameCreated);

gameInterface.CreateOnlineGame(class'UIInteraction'.static.GetPlayerControllerId(0), 'Game', CurrentGameSettings);

...
function OnGameCreated(name SessionName, bool bWasSuccessful) 
{
}

When the online session has been created you will see a unique Steam id in your console. This is the id you will use for your client to connect to the session (essentially will route the client to the server without needing to connect using their specific ip or needing to have ports open etc).

Then in your OnGameCreated() for your host you can actually launch your listen server:

function OnGameCreated(name SessionName, bool bWasSuccessful) 
{
    ConsoleCommand("start YourMapName?listen?steamsockets");
}

Then try connecting to your hosts session steam id (the one generated from calling CreateOnlineGame()) on the client side (from the in-game console):

start steam.123456789

Once you have that working you are now hosting and connecting using Steam sockets rather than using specific ips and worrying about opening ports etc.

After that you can tackle the game advertising. One easy way to do this, which i do with my game Subsistence is to just use ReadFriendsList() in OnlineSubsystemSteamworks.

When it calls back (use AddReadFriendsCompleteDelegate), you can use GetFriendsList() to pull a list of their online Steam friends then call GetFriendJoinURL() to get the unique steam id for the session they are hosting (or playing on).

So basically when the joining client is sitting in your in-game join MP game UI, just poll their friends list and check for friends hosting a session for your game.

2 Likes

Thanks a lot for the info, Coldscooter! we’re still bumbling around with setting up Steamworks multiplayer but at least we have some good pointers now.

1 Like

Some useful information there about the Steam IDs, though I’m not sure how much of that I can use because unfortunately Variator doesn’t use Unreal’s networking, it uses direct UDP connections.

The Steam equivalent of that would be SteamNetworkingMessages, which the UDK Steamworks subsystem doesn’t seem to support.

Getting UDP to work was already a huge ordeal. I had to write my own DLL to handle it, and UDK’s DLL binding has serious problems when you’re using the 64-bit version (it needs crazy workarounds because it can’t pass 64-bit pointers properly.)

I did try to see if I could get my DLL to load the Steamworks DLL, but UDK just refused to call any bindings on the DLL when I tried that. I don’t know if it would maybe have worked if I got the headers for the ancient version of Steamworks that UDK uses, or if the idea of UDK loading a DLL that calls another DLL is just a non-starter altogether.

1 Like

Wow, setting up your own UDP solution sounds like a lot of work. I’m curious why you didn’t want to use epic’s networking in the engine, as it is excellent in my opinion. I feel that relying on players to manually open ports (rather than using the Steam client) will prevent the majority of players from playing the MP mode.

Yes, using DllBind is tricky with the 64bit version, however you can setup a translation function to handle the pointers. You basically need to zero out the high 32bits. I am actually loading a more recent version of the Steam SDK, which I load alongside the old dll that UDK uses. Although this was not straightforward to setup.

1 Like

The game runs on deterministic lockstep, which as I understand works a lot better with UDP. Anyway, @Ciox had already written all the networking (using an existing 32-bit-only library) before I started looking at this - I was mainly helping him get it working in the 64-bit version, and ended up writing a new UDP library for that.

Absolutely agree that requiring the host to manually open a port is a huge burden. Steam would be far preferable.

Is zeroing the high 32 bits reliable? I’d have thought that could fail depending on how much memory the game is using and where it’s placing that memory.
The workaround I went for is frankly insane, I basically made it send one byte at a time to avoid having to use string pointers at all. That’s done through a DLL function that takes one byte (it does buffer a full line before sending over the network),

1 Like

If you look at the public documentation for DllBind in Unrealscript, they give you an exact example of how to handle strings when passing between unrealscript and c++:

https://docs.unrealengine.com/udk/Three/DLLBind.html

You just have to create a struct in unrealscript to match what c++ expects (with the string, the bytes num and bytes max).

Yes, zeroing the high 32 is fully reliable. You just have to be conscious of how you are passing values back and forth between unrealscript and c++. For instance if you want to pass an int64 to unrealscript, you will have to break it down and wrap it in whatever struct to hold both the low and high 32bits.

Take a look at the " Supported Parameter Types" section of the documentation i sent. It is very useful.

1 Like