查看: 318|回复: 7

[编程指南] 【Online Subsystem Steam | Unreal Engine】

[复制链接]

1

主题

273

帖子

7万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
73036
发表于 2016-6-26 02:02:11 | 显示全部楼层 |阅读模式


本页面的内容:

      
Basic Setup
Installing the Steamworks SDK
INI Configuration
Module Setup
Steam Overlay on Mac
     
Information contained here pertains specifically to the Steam implementation.   Any additional setup steps, tips  tricks, and workarounds can be found here.

The Steam module implements most of the interfaces exposed through the online subsystem and supports most of what Valve offers through the Steamworks SDK.

Steam Interfaces

Matchmaking (Lobbies / GameServer APIs)

Leaderboards

Achievements

Voice

UserCloud

SharedCloud

External UI

All games must have a valid Steam App ID.   During development, this App ID is exposed to the SDK via a file called steam_appid.txt which must reside in the same directory as the executable.  The file is generated by Unreal Engine at launch and deleted during graceful shutdown of the engine.   This makes it unnecessary to launch the game via the Steam client (although it must be running).  The file should not be included in any Steam images.

In shipping builds, the engine will also check to make sure the logged in user is properly subscribed to the game and will shutdown the engine if not.  This is but one way to help secure the game.  Using Steam DRM (see the Steamworks SDK) should further protect the game from tampering.
Basic Setup
The Steam subsystem requires some additional setup through Valve.   Contact Valve and use their documentation to make sure you are setup on their end before attempting to use Steam in the Unreal Engine.

Installing the Steamworks SDK
For legal reasons, using Steam requires downloading the latest SDK from Valve.   Currently this is v1.29a, but any future update should be a straightforward change to the path name.  See Steamworks.build.cs in the ThirdParty/Steamworks directory

Using Steam against the precompiled version of the engine should only require copying some of the DLLs from Valve's SDK into the appropriate places.  If you intend to recompile the engine against the source, putting the SDK in the right place is required as well.

The SDK needs to be unzipped/copied to this path

/YourUnrealEnginePath/Engine/Source/ThirdParty/Steamworks/Steamv130/sdk

Find the following binaries from the /redistributable_bin/ directory of the SDK and copy them to their noted locations.  

Note: Some of the 64bit dlls can be found in your normal Steam client directory. Valve for some reason does not include all of them in the SDK.

/YourUnrealEnginePath/Engine/Binaries/ThirdParty/Steamworks/Steamv130/Win64

steam_api64.dll

steamclient64.dll

tier0_s64.dll

vstdlib_s64.dll

/YourUnrealEnginePath/Engine/Binaries/ThirdParty/Steamworks/Steamv130/Win32

steam_api.dll

steamclient.dll

tier0_s.dll

vstdlib_s.dll

/YourUnrealEnginePath/EngineOrGameFolder/Binaries/Mac/YourGame.app/Contents/MacOS

libsteam_api.dylib (from /redistributable_bin/osx32 - single dylib has both 32 and 64 bit support)

If you are compiling the entire engine, you will want to modify the following line in OnlineSubsystemSteam\Private\OnlineSubsystemSteamPrivatePCH.h

define STEAM_SDK_VER TEXT("Steamv130")

to make sure it references the new SDK directory location / version

INI Configuration
Turn on some settings in the game's DefaultEngine.ini</code>.



The SteamDevAppId of 480 is Valve's test app id, shared by everyone.   You will need your own app id eventually, but most features of Steam should work before then.
[/Script/Engine.GameEngine]+NetDriverDefinitions=(DefName="GameNetDriver",DriverClassName="OnlineSubsystemSteam.SteamNetDriver",DriverClassNameFallback="OnlineSubsystemUtils.IpNetDriver")[OnlineSubsystem]DefaultPlatformService=Steam[OnlineSubsystemSteam]bEnabled=trueSteamDevAppId=480[/Script/OnlineSubsystemSteam.SteamNetDriver]NetConnectionClassName="OnlineSubsystemSteam.SteamNetConnection"
Module Setup
Make sure to include the Unreal Engine Steam module as part of your project. (see 虚幻引擎编译系统的目标文件 for additional help)

Adding the following should be enough to make sure that the Steam module is built along with your game.  It goes inside the constructor of mygame.build.cs
DynamicallyLoadedModuleNames.Add("OnlineSubsystemSteam");
Steam Overlay on Mac
Contrary to Windows, Steam Overlay on Mac requires game to be launched using Steam client. For this you first need to add the game to your library using "Add a Non-Steam Game to My Library" option from Steam's Games menu.
回复

使用道具 举报

0

主题

900

帖子

2960

积分

vip会员

Rank: 1

积分
2960
发表于 2016-7-2 19:25:45 来自手机 | 显示全部楼层
很想看看看了
回复 支持 反对

使用道具 举报

0

主题

858

帖子

2835

积分

vip会员

Rank: 1

积分
2835
发表于 2016-7-3 23:15:26 来自手机 | 显示全部楼层
不错,我喜欢这个,看看多少金币哦
回复 支持 反对

使用道具 举报

0

主题

839

帖子

2755

积分

vip会员

Rank: 1

积分
2755
发表于 2016-7-4 08:10:38 | 显示全部楼层
这个支持了呀,不错,顶顶帖拿拿钱
回复 支持 反对

使用道具 举报

0

主题

840

帖子

2855

积分

vip会员

Rank: 1

积分
2855
发表于 2016-7-17 23:57:43 来自手机 | 显示全部楼层
我又来了,太贵了,我盯着你好久了。
回复 支持 反对

使用道具 举报

0

主题

851

帖子

2822

积分

vip会员

Rank: 1

积分
2822
发表于 2016-7-19 17:17:20 来自手机 | 显示全部楼层
不错 可以下来研究研究
回复 支持 反对

使用道具 举报

0

主题

852

帖子

2807

积分

vip会员

Rank: 1

积分
2807
发表于 2016-7-20 07:50:33 来自手机 | 显示全部楼层
楼主真是好人吖~~非常感谢
回复 支持 反对

使用道具 举报

0

主题

864

帖子

2850

积分

vip会员

Rank: 1

积分
2850
发表于 2016-7-21 19:01:06 | 显示全部楼层
全部吗,谢谢啦
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | enginedx注册

本版积分规则

 
 



邮件留言:


 
返回顶部