跟随Deepmind使用AI玩《星际争霸2》
近来人工智能的火爆,deepmind已经开始研究玩《星际争霸2》了,这个游戏比较复杂,是否可以像围棋一样超越人类呢?要想学习这个,可以到DM的开源网站下载源码:https://github.com/deepmind/pysc2我这里介绍一下在win10下怎么安装,在CMD窗口里使用:pip3 install pysc2在这之前你应该安装libsdl和pygame。这个安装目录如下:AppData\
近来人工智能的火爆,deepmind已经开始研究玩《星际争霸2》了,这个游戏比较复杂,是否可以像围棋一样超越人类呢?
要想学习这个,可以到DM的开源网站下载源码:
https://github.com/deepmind/pysc2
我这里介绍一下在win10下怎么安装,在CMD窗口里使用:
pip3 install pysc2
在这之前你应该安装libsdl和pygame。这个安装目录如下:
AppData\Local\Programs\Python\Python36\Lib\site-packages\pysc2
然后就可以到网易上下载《星际争霸2》,这个安装目录如下:
F:\game\StarCraft II\Versions\Base56787
然后再下载地图:
https://github.com/deepmind/pysc2/releases/download/v1.0/mini_games.zip
和到网站
https://github.com/Blizzard/s2client-proto#downloads
里下载相关的地图。
由于在windows上运行,原来的源码有些不能运行,需要作一些修改:
找到文件Python36\Lib\site-packages\pysc2\run_configs\platforms.py, 作如下修改:
class Windows(LocalBase):
"""Run on Windows."""
def __init__(self):
super(Windows, self).__init__(
"F:/game/StarCraft II/"#os.environ.get("SC2PATH", "F:/game/StarCraft II"),
"Versions/Base56787/",
"SC2_x64.exe")
然后再修改文件lib.py:
def map_data(self, map_name):
"""Return the map data for a map by name or path."""
temp_name = map_name.split('\\')
map_name = '/' + temp_name[0] + '/' + temp_name[1]
filePath = self.data_dir + 'Maps' + map_name
print(filePath)
with gfile.Open(filePath, "rb") as f:
#with gfile.Open(os.path.join(self.data_dir, "Maps", map_name), "rb") as f:
#with gfile.Open('F:/game/StarCraft II/Maps/DefeatRoaches.SC2Map', "rb") as f:
return f.read()
就可以打开地图文件了。
地图解压放在目录:
F:\game\StarCraft II\Versions\Base56787\maps\mini_games
接着在CMD窗口下就可以运行:
python -m pysc2.bin.agent --map Simple64
运行结果如下:
Python游戏开发入门
你也能动手修改C编译器
纸牌游戏开发
http://edu.csdn.net/course/detail/5538
五子棋游戏开发
http://edu.csdn.net/course/detail/5487
RPG游戏从入门到精通
http://edu.csdn.net/course/detail/5246
WiX安装工具的使用
http://edu.csdn.net/course/detail/5207
俄罗斯方块游戏开发
http://edu.csdn.net/course/detail/5110
boost库入门基础
http://edu.csdn.net/course/detail/5029
Arduino入门基础
http://edu.csdn.net/course/detail/4931
Unity5.x游戏基础入门
http://edu.csdn.net/course/detail/4810
TensorFlow API攻略
http://edu.csdn.net/course/detail/4495
TensorFlow入门基本教程
http://edu.csdn.net/course/detail/4369
C++标准模板库从入门到精通
http://edu.csdn.net/course/detail/3324
跟老菜鸟学C++
http://edu.csdn.net/course/detail/2901
跟老菜鸟学python
http://edu.csdn.net/course/detail/2592
在VC2015里学会使用tinyxml库
http://edu.csdn.net/course/detail/2590
在Windows下SVN的版本管理与实战
http://edu.csdn.net/course/detail/2579
Visual Studio 2015开发C++程序的基本使用
http://edu.csdn.net/course/detail/2570
在VC2015里使用protobuf协议
http://edu.csdn.net/course/detail/2582
在VC2015里学会使用MySQL数据库
http://edu.csdn.net/course/detail/2672
更多推荐
所有评论(0)