独立开发者在对接STEAM SDK之前 首先得先登上青睐之光,也就是我们俗称的“绿光”

一般要先对接G胖家的SDK,然后提交版本,最后等待审核。。。

我本身是unity 开发,对C++也是糊里糊涂..所以这里主要围绕unity说下我对接SDK的一些经历

sdk地址:http://steamworks.github.io/installation/

c#接口介绍地址:http://steamworks.github.io/gettingstarted/

steamwork使用教程视频:https://www.youtube.com/playlist?list=PLckFgM6dUP2jBeskIPG-7BVJR-I0vcSGJ

-----------------------------------------------------------------------------------------------------

第一步:

安装 Steamwork.NET(这里要感谢外国小哥)

1.下载 .unitypackage Stable (7.0.0) 或者从 Github 克隆

2.导入下载的所有文件到项目 Assets/ 目录下.

3.打开unity项目,会自动生成steam_appid.txt到项目的主目录下.

4.打开 steam_appid.txt 并将 480 修改为自己的 AppId.

5.更改脚本 SteamManager.cs 找到  SteamAPI.RestartAppIfNecessary(AppId_t.Invalid)将AppId_t.Invalid替换成(AppId_t)480" 或者 "new AppId_t(480),480改成自己的APP ID如图:

  1. if (SteamAPI.RestartAppIfNecessary(new AppId_t(55220))) {
  2. Application.Quit();
  3. return;
  4. }

6.Steam根据提示修改重启unity,保证 steam_appid.txt 已生效.

7.重启unity,保证 steam_appid.txt 已生效.

8.安装sdk完成.

如何使用

1.下载SteamManagers.cs

2.将SteamManager.cs脚本挂在GameObject上,steam会自动生成单例

3.完整C#接口请点击查看

注:需要在https://partner.steamgames.com/home下载sdk,里面有提交游戏的工具,在\sdk\tools\ContentBuilder\builder
        在https://partner.steamgames.com/home/steamworks可以查看文档
        在http://steamworks.github.io/gettingstarted/可以查看C#接口的使用方式

 
完整SteamManager:
  1. // The SteamManager is designed to work with Steamworks.NET
  2. // This file is released into the public domain.
  3. // Where that dedication is not recognized you are granted a perpetual,
  4. // irrevokable license to copy and modify this files as you see fit.
  5. //
  6. // Version: 1.0.5
  7. using UnityEngine;
  8. using System.Collections;
  9. using Steamworks;
  10. //
  11. // The SteamManager provides a base implementation of Steamworks.NET on which you can build upon.
  12. // It handles the basics of starting up and shutting down the SteamAPI for use.
  13. //
  14. [DisallowMultipleComponent]
  15. public class SteamManager : MonoBehaviour {
  16. private static SteamManager s_instance;
  17. private static SteamManager Instance {
  18. get {
  19. if (s_instance == null) {
  20. return new GameObject("SteamManager").AddComponent<SteamManager>();
  21. }
  22. else {
  23. return s_instance;
  24. }
  25. }
  26. }
  27. private static bool s_EverInialized;
  28. private bool m_bInitialized;
  29. public static bool Initialized {
  30. get {
  31. return Instance.m_bInitialized;
  32. }
  33. }
  34. private SteamAPIWarningMessageHook_t m_SteamAPIWarningMessageHook;
  35. private static void SteamAPIDebugTextHook(int nSeverity, System.Text.StringBuilder pchDebugText) {
  36. Debug.LogWarning(pchDebugText);
  37. }
  38. private void Awake() {
  39. // Only one instance of SteamManager at a time!
  40. if (s_instance != null) {
  41. Destroy(gameObject);
  42. return;
  43. }
  44. s_instance = this;
  45. if(s_EverInialized) {
  46. // This is almost always an error.
  47. // The most common case where this happens is when SteamManager gets destroyed because of Application.Quit(),
  48. // and then some Steamworks code in some other OnDestroy gets called afterwards, creating a new SteamManager.
  49. // You should never call Steamworks functions in OnDestroy, always prefer OnDisable if possible.
  50. throw new System.Exception("Tried to Initialize the SteamAPI twice in one session!");
  51. }
  52. // We want our SteamManager Instance to persist across scenes.
  53. DontDestroyOnLoad(gameObject);
  54. if (!Packsize.Test()) {
  55. Debug.LogError("[Steamworks.NET] Packsize Test returned false, the wrong version of Steamworks.NET is being run in this platform.", this);
  56. }
  57. if (!DllCheck.Test()) {
  58. Debug.LogError("[Steamworks.NET] DllCheck Test returned false, One or more of the Steamworks binaries seems to be the wrong version.", this);
  59. }
  60. try {
  61. // If Steam is not running or the game wasn't started through Steam, SteamAPI_RestartAppIfNecessary starts the
  62. // Steam client and also launches this game again if the User owns it. This can act as a rudimentary form of DRM.
  63. // Once you get a Steam AppID assigned by Valve, you need to replace AppId_t.Invalid with it and
  64. // remove steam_appid.txt from the game depot. eg: "(AppId_t)480" or "new AppId_t(480)".
  65. // See the Valve documentation for more information: https://partner.steamgames.com/documentation/drm#FAQ
  66. if (SteamAPI.RestartAppIfNecessary(AppId_t.Invalid)) {
  67. Application.Quit();
  68. return;
  69. }
  70. }
  71. catch (System.DllNotFoundException e) { // We catch this exception here, as it will be the first occurence of it.
  72. Debug.LogError("[Steamworks.NET] Could not load [lib]steam_api.dll/so/dylib. It's likely not in the correct location. Refer to the README for more details.\n" + e, this);
  73. Application.Quit();
  74. return;
  75. }
  76. // Initialize the SteamAPI, if Init() returns false this can happen for many reasons.
  77. // Some examples include:
  78. // Steam Client is not running.
  79. // Launching from outside of steam without a steam_appid.txt file in place.
  80. // Running under a different OS User or Access level (for example running "as administrator")
  81. // Ensure that you own a license for the AppId on your active Steam account
  82. // If your AppId is not completely set up. Either in Release State: Unavailable, or if it's missing default packages.
  83. // Valve's documentation for this is located here:
  84. // https://partner.steamgames.com/documentation/getting_started
  85. // https://partner.steamgames.com/documentation/example // Under: Common Build Problems
  86. // https://partner.steamgames.com/documentation/bootstrap_stats // At the very bottom
  87. // If you're running into Init issues try running DbgView prior to launching to get the internal output from Steam.
  88. // http://technet.microsoft.com/en-us/sysinternals/bb896647.aspx
  89. m_bInitialized = SteamAPI.Init();
  90. if (!m_bInitialized) {
  91. Debug.LogError("[Steamworks.NET] SteamAPI_Init() failed. Refer to Valve's documentation or the comment above this line for more information.", this);
  92. return;
  93. }
  94. s_EverInialized = true;
  95. }
  96. // This should only ever get called on first load and after an Assembly reload, You should never Disable the Steamworks Manager yourself.
  97. private void OnEnable() {
  98. if (s_instance == null) {
  99. s_instance = this;
  100. }
  101. if (!m_bInitialized) {
  102. return;
  103. }
  104. if (m_SteamAPIWarningMessageHook == null) {
  105. // Set up our callback to recieve warning messages from Steam.
  106. // You must launch with "-debug_steamapi" in the launch args to recieve warnings.
  107. m_SteamAPIWarningMessageHook = new SteamAPIWarningMessageHook_t(SteamAPIDebugTextHook);
  108. SteamClient.SetWarningMessageHook(m_SteamAPIWarningMessageHook);
  109. }
  110. }
  111. // OnApplicationQuit gets called too early to shutdown the SteamAPI.
  112. // Because the SteamManager should be persistent and never disabled or destroyed we can shutdown the SteamAPI here.
  113. // Thus it is not recommended to perform any Steamworks work in other OnDestroy functions as the order of execution can not be garenteed upon Shutdown. Prefer OnDisable().
  114. private void OnDestroy() {
  115. if (s_instance != this) {
  116. return;
  117. }
  118. s_instance = null;
  119. if (!m_bInitialized) {
  120. return;
  121. }
  122. SteamAPI.Shutdown();
  123. }
  124. private void Update() {
  125. if (!m_bInitialized) {
  126. return;
  127. }
  128. // Run Steam client callbacks
  129. SteamAPI.RunCallbacks();
  130. }
  131. }
-----------------------------------------------------------------------------------------------------
 

第二步:

如何提交游戏版本

在提交游戏之前先对内容上传软件进行配置:

1、找到sdk\tools\ContentBuilder\scripts目录,该目录下有两个配置文件名需要更改

app_build_自己的APPID.vdf,  depot_build_自己的APPID.vdf

2、假如我的APP ID 为 "55220"  ,修改app_build_55220,"appid","depots"内容如下:

  1. "appbuild"
  2. {
  3. "appid" "<span style="color:#ff0000;background-color: rgb(255, 204, 153);">55220</span>"
  4. "desc" "Your build description here" // description for this build
  5. "buildoutput" "..\output\" // build output folder for .log, .csm & .csd files, relative to location of this file
  6. "contentroot" "..\content\" // root content folder, relative to location of this file
  7. "setlive"   "" // branch to set live after successful build, non if empty
  8. "preview" "0" // to enable preview builds
  9. "local" ""  // set to flie path of local content server
  10. "depots"
  11. {
  12. "<span style="color:#ff0000;background-color: rgb(255, 204, 153);">55221</span>" "depot_build_<span style="color:#ff0000;background-color: rgb(255, 204, 153);">55221</span>.vdf"
  13. }
  14. }

修改depot_build_55221,修改 "DepotID" ,"ContentRoot","LocalPath" 内容如下:

  1. "DepotBuildConfig"
  2. {
  3. // Set your assigned depot ID here
  4. "DepotID" "<span style="font-size: 14.4px; font-family: Lato, proxima-nova, "Helvetica Neue", Arial, sans-serif; background-color: rgb(255, 204, 153);"><span style="color:#ff0000;">55221</span></span>"
  5. // Set a root for all content.
  6. // All relative paths specified below (LocalPath in FileMapping entries, and FileExclusion paths)
  7. // will be resolved relative to this root.
  8. // If you don't define ContentRoot, then it will be assumed to be
  9. // the location of this script file, which probably isn't what you want
  10. "ContentRoot"   "<span style="color:#ff0000;background-color: rgb(255, 204, 153);">D:\SDK硬盘位置\steamworks_sdk_138a\sdk\tools\ContentBuilder\content\</span>"
  11. // include all files recursivley
  12. "FileMapping"
  13. {
  14. // This can be a full path, or a path relative to ContentRoot
  15. "LocalPath" "<span style="color:#ff0000;background-color: rgb(255, 204, 153);">.\windows_content\*</span>"
  16. // This is a path relative to the install folder of your game
  17. "DepotPath" "."
  18. // If LocalPath contains wildcards, setting this means that all
  19. // matching files within subdirectories of LocalPath will also
  20. // be included.
  21. "recursive" "1"
  22. }
  23. // but exclude all symbol files
  24. // This can be a full path, or a path relative to ContentRoot
  25. "FileExclusion" "*.pdb"
  26. }

3、找到sdk\tools\ContentBuilder\content目录在目录下新增文件夹 windows_content

4、复制需要提交的游戏文件至 windows_content 目录下

5、找到sdk\tools\ContentBuilder\目录下的runbuild.bat右击编辑 更改内容如下:

  1. builder\steamcmd.exe +loginsteam用户名 密码 +run_app_build_http ..\scripts\app_build_自己的APPID.vdf
游戏测试无误的时候就双击runbuild.bat 等待上传成功了 

暂时先写这么多,后面还会更新 steamwork商店的一些配置

注:博文转自http://blog.csdn.net/tonye129/article/details/54311481

转载于:https://www.cnblogs.com/mrgavin/p/6369547.html

【转】独立游戏如何对接STEAM SDK相关推荐

  1. 贫穷中透着零基础的单人制作游戏手册之三:独立游戏怎么评估Steam市场

    (一)幸存者偏差 "看得到的都是已经活下来的." 没有什么比这句话更符合开放了直接发行后的Steam市场了. 每天十几.二十款新游戏涌入,能进入普通玩家视线中的,一天都未必有一个. ...

  2. Unity对接Steam SDK

    作者: 信天游037911 https://blog.csdn.net/qq_40654110/article/details/79310381 1. 登录开发者帐号,去steam下载steamwor ...

  3. [精华分享][Unityamp;amp;Steamamp;amp;独立游戏]如何查看steam游戏销售销量等数据

    steamspy 查看各游戏销量(总销量.各阶段销量.各地区销量.游戏时间等等):Games sales:(强力推荐) steamgraph 查看游戏在线人数统计图表:SteamGraph: stea ...

  4. 项目经理转型独立游戏人?从腾讯裸辞后,他用5个月做了款游戏登上 Steam 热榜...

    短短两分钟的游戏开发日志,竟在 B 站收获了近30万播放量?这款名为<幻想曹操传>的游戏,是从腾讯裸辞.转型「独立游戏开发者」后的桑尼用5个月时间做出来的第一个游戏,近日更是登上了 Ste ...

  5. [精华分享][独立游戏][Steam][发行商]独立游戏发行商发行平台

    (名称前后与排名无关.如有)(未完待续) ------------------------------------------------------------------------------- ...

  6. 如何不浪费青春,让游戏快速上架 Steam

    [ 玩转 LeanCloud ]开发者经验分享: 我们做的是 VR 社交产品, 叫<VR Triber>,目前已在 Steam 上线.客户端采用 Unity 开发,后端数据存储.实时通信. ...

  7. 单人制作游戏手册之四:独立游戏怎么预估收益

    (一)确定价格敏感区间 在评估市场以后,我们已经对同类游戏的定价策略和市场潜力有了一定的了解,可以开始着手准备评估游戏的预期收益了. 第一步,就是要找到我们游戏的价格敏感区间,即定价多少元到多少元之间 ...

  8. 《苏醒之路》制作人王鲲:独立游戏如何成功出海?

    由Xsolla和英礴联合主办,以"中国独立游戏的全球化探索"为主题的沙龙在上海举行.活动当天,威魔纪元的王鲲就独立游戏的出海探索进行了分享,他于2004年入行,先后参与制作过手游. ...

  9. 只工作不玩耍_不玩耍:独立游戏开发商的经验教训

    只工作不玩耍 想象一下,如果有的话,一种由激情项目及其构建者组成的文化: 挠痒痒的人创造了他们需要并想要在世界上看到的东西. 每个项目都是一项复杂而创新的技术任务,需要多学科合作. 这种文化对社区有着 ...

最新文章

  1. (ZT)大学里如何学习 ?
  2. JavaScript学习笔记(十五)
  3. 不相交集合求并的路径压缩
  4. 头发剪短了要快速生发_怎样生发效果最好最快?四个方法快速长出头发!
  5. javafx应用启动自动执行函数_JavaFx:Application start方法中的异常
  6. webpack4.0各个击破(4)—— Javascript splitChunk
  7. Linux系统原理(工作模式)
  8. Mac SecureCRT 下载、安装详细步骤
  9. linux密码忘记root密码,重置密码的方法
  10. OpenCV3历程(4)——寻找直线的十字交叉点
  11. task9-文件与文件系统
  12. MongoDB报错 -【已解决】:Error: couldn‘t connect to server 127.0.0.1:27017, connection attempt failed:
  13. 装箱单Packing list
  14. php 股票信息查询类
  15. memoized函数
  16. 自己都不坚强,又有谁会在意
  17. 【附源码】计算机毕业设计java医院管理系统设计与实现
  18. java微信jssdk开发
  19. PDF.js 分片下载的介绍2:分片下载demo
  20. 生产环境的数据库规划

热门文章

  1. zz Android像素换算
  2. ProxmoxVE 6.4-13 (PVE) 硬件直通-核显/网卡/硬盘
  3. (Windows,ten2.0)python0-9数字识别系统搭建(MNIST数据集)
  4. 哈尔滨理工大学软件与微电子学院第八届程序设计竞赛同步赛(高年级)A-小乐乐的组合数+
  5. linux看10g文件,Linux 查看文件和文件夹大小
  6. java中p表示什么意思_javap -c命令关键字的含义
  7. *** glibc detected *** ./Simple_Sound_Recording: free(): corrupted unsorted chunks: 0x0001c8a0 ***
  8. 看雪论坛chrome浏览器无法登录
  9. 数影周报:美联邦机构被曝数据泄露丑闻,嘀嗒狗完成数千万元融资
  10. html5css设置链接颜色,html超链接颜色设置