bwapi 4.2.0 目測必將太監的我的研究

個人操做環境:Windows7 64bithtml

如下是安裝過程,出了不少錯,建議直接看最後面的總結。 c++

 

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

 

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

準備使用C++整,那下載地址是: https://github.com/bwapi/bwapi/releases,能夠下載setup安裝文件和7z文件,不推薦下載,下面再講下載地址。express

按說明要安裝以下東西:小程序

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整了半天。windows

星際1.16.1啊,這他媽去哪裏下?  下載地址:http://www.yxdown.com/SoftView/SoftView_134236.html api

日他媽,下載後不是源文件,解壓後還要用自帶的小程序解壓,去你大爺,找到一個文件「#YouXun#」,直接改爲1.rar,打開,直接解壓,幹他娘。app

運行後,屏幕很小,還花屏,我日,難道要我去找XP?ide

搜索後有個方案。

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,新建了個地圖打電腦,而後看到他自動玩了……蟲族只會造農民和房子……

 

總結一下:

1、BWAPI官網的介紹有坑,MOTHER FCK。

2、先安裝SC,要1.16.1版本的。

3、去https://ci.appveyor.com/project/heinermann/bwapi/history下載他們打好的安裝包,不去BWAPI官網。固然,正確的方法是本身編譯官網的全部代碼,但我懶。在ARTIFACTS連接下。有setup和7z文件,省得麻煩。其實直接setup就好了,記得先安裝SC,並運行setup.exe將SC的安裝目錄寫入註冊表,否則4.2可能安裝不成功。

4、BWAPI 4.2使用VS2017,可使用免費的社區版。4.1.X使用VS2013。5.0支持重製版,開發中,無論,這不是重點。

 

 

接着就是看代碼怎麼寫了,下一篇的事。

相關文章
相關標籤/搜索