bwapi 4.2.0 目测必将太监的个人研究

我的操作环境:Windows7 64bit

以下是安装过程,出了很多错,建议直接看最后面的总结。 

 

英文好的自行看英文教程,我刚看到,操……:http://www.teamliquid.net/blogs/485544-intro-to-scbw-ai-development

 

bwapi 文档地址: https://bwapi.github.io/ 

准备使用C++整,那下载地址是: https://github.com/bwapi/bwapi/releases,可以下载setup安装文件和7z文件,不推荐下载,下面再讲下载地址。

按说明要安装如下东西:

Install Visual Studio 2013
Install StarCraft: Brood War
Update StarCraft: Brood War to 1.16.1
Install BWAPI

bwapi 4.1.0 beta说是可以用vs2013 express for windows desktop版本,那我就用这个,结果bwapi 4.2.0 要求是vc++ 2017,应该装vs2017,页面上明晃晃写着“Update to VC++ 2017”,我还以为是新的C++语言版本,不是VS版本,干,傻傻用VS2013整了半天。

星际1.16.1啊,这他妈去哪里下?  下载地址:http://www.yxdown.com/SoftView/SoftView_134236.html 

日他妈,下载后不是源文件,解压后还要用自带的小程序解压,去你大爷,找到一个文件“#YouXun#”,直接改成1.rar,打开,直接解压,干他娘。

运行后,屏幕很小,还花屏,我日,难道要我去找XP?

搜索后有个方案。

HKEY_LOCAL_MACHINE------SYSTEM------ControlSet001-------Control-------GraphicsDrivers-------Configuration------
然后右键点击Configuration,选择查找,输入Scaling,在右框内即可看到scaling,可能会有两个scaling,右键点击scaling选择修改,其中一个的值为ff,另一个值为4.把那个4改成3,再玩游戏

然而有多个Scaling,我全改为3了。运行后,全屏了,花屏就先不管他了。

记得运行"setup.exe“注册星际,然后安装bwapi 4.2,记住bwapi的安装目录,下面有个sln文件,是vs的项目文件。

 

接下来是编译

Open ExampleProjects.sln in the BWAPI install directory
Build the ExampleAIModule project in RELEASE mode
Copy ExampleAIModule.dll to bwapi-data/AI inside the StarCraft install folder

  

安装vs2013 express for windows desktop,然后打开要求的的“ExamleAIModule“项目

错误 1 error MSB8020: The build tools for v141 (Platform Toolset = 'v141') cannot be found. To build using the v141 build tools, please install v141 build tools. Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting "Upgrade Solution...". C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.Cpp.Platform.targets 64 5 ExampleAIModule

v141是vs2017的吧?还是vs2015,改成v120,结果还是报错

一开始就是C2071错误,奇葩,搜索一下,有同样的人提了同样的问题: https://github.com/bwapi/bwapi/issues/737

我操,要用VS2017??FCK

卸载了VS2013,又装了VS2017,下载地址:https://www.iplaysoft.com/vs2017.html, 装了社区版,免费,个人开发者,没毛病。

 

然后再次编译,SDK目标平台10.XXXX,工具集版本V141,编译ExampleAIModule,又报错

错误 C1047 对象或库文件“..\lib\BWAPI.lib”是使用比创建其他对象所用编译器旧的编译器创建的;请重新生成旧的对象和库 ExampleAIModule C:\Users\Administrator\BWAPI\ExampleAIModule\LINK 1

 

在https://github.com/bwapi/bwapi/issues/737 里继续找答案,发现这个:

elibc commented on 19 Dec 2017 •  edited 
I've managed to work around this problem by cloning the whole BWAPI repository in a separate folder, building the solution, and then copying the output files from the lib folder in the cloned BWAPI folder to the lib folder used for building the ExampleAIModule.
Afterwards I've managed to successfully build the ExampleProjects solution in Release configuration and run the AI.

 

同时,该帖上面也有说可以在DEBUG模式下生成,我试过也可以,但要求是Release模式下编译,所以我没用。

但这里的意思是,要我下载全新的BWAPI源代码,用VS2017编译出BWAPI.lib文件,然后再去编译ExampleProjects项目

……

真的烦……

 

然后看到下面又有个回复:

heinermann commented on 1 Jan
Does using the latest build artifact work?

按里面说的链接,去到 https://ci.appveyor.com/project/heinermann/bwapi/build/4.2.0.90/artifacts ,才发现这里好像是说修复了一个BUG,然后重新打包了,我他妈……

然后下载了BWAPI.7z,把里面的BWAPI.lib替换之,编译成功

 

……

FCK

从头来一次,在这个链接里下载了新的BWAPI 4.2.0.90  setup安装文件和7Z,手动删除BWAPI文件夹,再安装新的,再编译,成功了,日哦……

看这个页面,似乎有人不停地build最新版本?我不是很懂,看样子到4.2.0.93了。LOOK:https://ci.appveyor.com/project/heinermann/bwapi/history

不管他,先用这个4.2.0.90试试行不行,反正Release模式下编译成功了,继续往下走,Copy ExampleAIModule.dll to bwapi-data/AI inside the StarCraft install folder, 照做之

Run StarCraft through Chaoslauncher
Run Chaoslauncher.exe as administrator
Chaoslauncher is found in Chaoslauncher directory of BWAPI install directory
Check the BWAPI Injector x.x.x [RELEASE]
Click Start
Make sure the version is set to Starcraft 1.16.1, not ICCup 1.16.1
Run a game against Blizzard's AI
Go to Single Player -> Expansion
Select any user and click OK
Click Play Custom, select a map, and start a game

 

NICE,新建了个地图打电脑,然后看到他自动玩了……虫族只会造农民和房子……

 

总结一下:

一、BWAPI官网的介绍有坑,MOTHER FCK。

二、先安装SC,要1.16.1版本的。

三、去https://ci.appveyor.com/project/heinermann/bwapi/history下载他们打好的安装包,不去BWAPI官网。当然,正确的方法是自己编译官网的所有代码,但我懒。在ARTIFACTS链接下。有setup和7z文件,免得麻烦。其实直接setup就行了,记得先安装SC,并运行setup.exe将SC的安装目录写入注册表,不然4.2可能安装不成功。

四、BWAPI 4.2使用VS2017,可以使用免费的社区版。4.1.X使用VS2013。5.0支持重制版,开发中,不管,这不是重点。

 

 

接着就是看代码怎么写了,下一篇的事。

转载于:https://www.cnblogs.com/adamfh/p/8453889.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值