关于pysc2 的游戏启动问题

I:\myPython\pythonCOM\venv\Scripts>python -m pysc2.bin.agent --map Simple64
name 1 kernel32
name 1 I:\myPython\pythonCOM\venv\lib\site-packages\numpy.libs\libopenblas.IPBC74C7KURV7CB2PKT5Z5FNR3SIBV4J.gfortran-win_amd64.dll
pygame 1.9.6
Hello from the pygame community. https://www.pygame.org/contribute.html
name 1 libc.so.6
===exec_path: I:\StarCraft\StarCraft II\Versions/Base76114\SC2_x64.exe
I0915 19:00:00.866423 8972 sc_process.py:110] Launching SC2: I:\StarCraft\StarCraft II\Versions/Base76114\SC2_x64.exe -listen 127.0.0.1 -port 17308 -dataDir I:\StarCraft\StarCraft II\ -tempDir C:\Users\ADMINI~1\AppData\Local\Temp\sc-owe9spcm\ -displayMode 0 -windowwidth 640 -windowheight 480 -windowx 50 -windowy 50
startupinfo <subprocess.STARTUPINFO object at 0x000000000B076828>
I0915 19:00:00.875424 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 0, running: True
I0915 19:00:01.878481 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 1, running: True
I0915 19:00:02.878539 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 2, running: True
I0915 19:00:03.878596 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 3, running: True
I0915 19:00:04.878653 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 4, running: True
I0915 19:00:05.878710 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 5, running: True
I0915 19:00:06.878767 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 6, running: True
I0915 19:00:07.878824 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 7, running: True
I0915 19:00:08.879882 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 8, running: True
I0915 19:00:09.879939 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 9, running: True
I0915 19:00:10.879996 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 10, running: True
I0915 19:00:11.880053 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 11, running: True
I0915 19:00:12.880110 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 12, running: True
I0915 19:00:13.880168 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 13, running: True
I0915 19:00:14.880225 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 14, running: True
I0915 19:00:15.881282 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 15, running: True
I0915 19:00:16.881339 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 16, running: True
I0915 19:00:17.881397 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 17, running: True
I0915 19:00:18.881453 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 18, running: True
I0915 19:00:19.881511 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 19, running: True
I0915 19:00:20.881568 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 20, running: True
I0915 19:00:21.881625 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 21, running: True
I0915 19:00:22.881682 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 22, running: True
I0915 19:00:23.881740 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 23, running: True
I0915 19:00:24.881797 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 24, running: True
I0915 19:00:25.881854 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 25, running: True
I0915 19:00:26.881911 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 26, running: True
I0915 19:00:27.881968 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 27, running: True
I0915 19:00:28.882026 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 28, running: True
I0915 19:00:29.882083 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 29, running: True
I0915 19:00:30.882140 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 30, running: True
I0915 19:00:31.882197 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 31, running: True
I0915 19:00:32.882255 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 32, running: True
I0915 19:00:33.883312 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 33, running: True
I0915 19:00:34.883369 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 34, running: True
I0915 19:00:35.883426 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 35, running: True
I0915 19:00:36.883483 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 36, running: True
I0915 19:00:37.883541 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 37, running: True
I0915 19:00:38.883598 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 38, running: True
I0915 19:00:39.883655 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 39, running: True
I0915 19:00:40.883712 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 40, running: True
I0915 19:00:41.883769 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 41, running: True
I0915 19:00:42.883827 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 42, running: True
I0915 19:00:43.883884 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 43, running: True
I0915 19:00:44.884941 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 44, running: True
I0915 19:00:45.885998 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 45, running: True
I0915 19:00:46.886055 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 46, running: True
I0915 19:00:47.887113 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 47, running: True
I0915 19:00:48.887170 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 48, running: True
I0915 19:00:49.887227 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 49, running: True
I0915 19:00:50.887284 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 50, running: True
I0915 19:00:51.888341 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 51, running: True
I0915 19:00:52.889399 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 52, running: True
I0915 19:00:53.889456 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 53, running: True
I0915 19:00:54.889513 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 54, running: True
I0915 19:00:55.890571 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 55, running: True
I0915 19:00:56.890628 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 56, running: True
I0915 19:00:57.891685 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 57, running: True
I0915 19:00:58.892742 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 58, running: True
I0915 19:00:59.893800 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 59, running: True
I0915 19:01:00.893857 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 60, running: True
I0915 19:01:01.894914 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 61, running: True
I0915 19:01:02.894971 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 62, running: True
I0915 19:01:03.895028 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 63, running: True
I0915 19:01:04.895086 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 64, running: True
I0915 19:01:05.895143 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 65, running: True
I0915 19:01:06.895200 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 66, running: True
I0915 19:01:07.895257 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 67, running: True
I0915 19:01:08.896314 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 68, running: True
I0915 19:01:09.896372 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 69, running: True
I0915 19:01:10.896429 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 70, running: True
I0915 19:01:11.896486 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 71, running: True
I0915 19:01:12.896543 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 72, running: True
I0915 19:01:13.896600 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 73, running: True
I0915 19:01:14.897658 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 74, running: True
I0915 19:01:15.897715 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 75, running: True
I0915 19:01:16.897772 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 76, running: True
I0915 19:01:17.898829 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 77, running: True
I0915 19:01:18.898886 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 78, running: True
I0915 19:01:19.898944 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 79, running: True
I0915 19:01:20.900001 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 80, running: True
I0915 19:01:21.900058 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 81, running: True
I0915 19:01:22.900115 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 82, running: True
I0915 19:01:23.900172 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 83, running: True
I0915 19:01:24.901230 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 84, running: True
I0915 19:01:25.901287 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 85, running: True
I0915 19:01:26.901344 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 86, running: True
I0915 19:01:27.901401 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 87, running: True
I0915 19:01:28.901459 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 88, running: True
I0915 19:01:29.901516 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 89, running: True
I0915 19:01:30.901573 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 90, running: True
I0915 19:01:31.901630 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 91, running: True
I0915 19:01:32.901687 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 92, running: True
I0915 19:01:33.901745 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 93, running: True
I0915 19:01:34.901802 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 94, running: True
I0915 19:01:35.901859 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 95, running: True
I0915 19:01:36.902916 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 96, running: True
I0915 19:01:37.902973 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 97, running: True
I0915 19:01:38.904031 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 98, running: True
I0915 19:01:39.904088 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 99, running: True
I0915 19:01:40.905145 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 100, running: True
I0915 19:01:41.905202 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 101, running: True
I0915 19:01:42.905260 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 102, running: True
I0915 19:01:43.905317 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 103, running: True
I0915 19:01:44.906374 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 104, running: True
I0915 19:01:45.906431 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 105, running: True
I0915 19:01:46.906488 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 106, running: True
I0915 19:01:47.906546 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 107, running: True
I0915 19:01:48.906603 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 108, running: True
I0915 19:01:49.906660 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 109, running: True
I0915 19:01:50.906717 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 110, running: True
I0915 19:01:51.906774 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 111, running: True
I0915 19:01:52.906832 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 112, running: True
I0915 19:01:53.909889 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 113, running: True
I0915 19:01:54.910946 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 114, running: True
I0915 19:01:55.911003 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 115, running: True
I0915 19:01:56.911061 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 116, running: True
I0915 19:01:57.911118 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 117, running: True
I0915 19:01:58.911175 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 118, running: True
I0915 19:01:59.911232 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 119, running: True
I0915 19:02:00.912290 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 120, running: True
I0915 19:02:01.913347 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 121, running: True
I0915 19:02:02.913404 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 122, running: True
I0915 19:02:03.913461 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 123, running: True
I0915 19:02:04.913518 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 124, running: True
I0915 19:02:05.913576 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 125, running: True
I0915 19:02:06.913633 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 126, running: True
I0915 19:02:07.913690 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 127, running: True
I0915 19:02:08.913747 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 128, running: True
I0915 19:02:09.913804 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 129, running: True
I0915 19:02:10.913862 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 130, running: True
I0915 19:02:11.913919 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 131, running: True
I0915 19:02:12.913976 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 132, running: True
I0915 19:02:13.914033 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 133, running: True
I0915 19:02:14.914091 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 134, running: True
I0915 19:02:15.914148 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 135, running: True
I0915 19:02:16.914205 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 136, running: True
I0915 19:02:17.914262 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 137, running: True
I0915 19:02:18.914319 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 138, running: True
I0915 19:02:19.914376 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 139, running: True
I0915 19:02:20.914433 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 140, running: True
I0915 19:02:21.914491 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 141, running: True
I0915 19:02:22.914548 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 142, running: True
I0915 19:02:23.914605 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 143, running: True
I0915 19:02:24.914662 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 144, running: True
I0915 19:02:25.914720 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 145, running: True
I0915 19:02:26.914777 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 146, running: True
I0915 19:02:27.914834 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 147, running: True
I0915 19:02:28.914891 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 148, running: True
I0915 19:02:29.914948 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 149, running: True
I0915 19:02:30.915006 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 150, running: True
I0915 19:02:31.915063 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 151, running: True
I0915 19:02:32.915120 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 152, running: True
I0915 19:02:33.915177 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 153, running: True
I0915 19:02:34.916234 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 154, running: True
I0915 19:02:35.916292 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 155, running: True
I0915 19:02:36.916349 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 156, running: True
I0915 19:02:37.916406 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 157, running: True
I0915 19:02:38.916463 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 158, running: True
I0915 19:02:39.916521 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 159, running: True
I0915 19:02:40.916578 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 160, running: True
I0915 19:02:41.917635 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 161, running: True
I0915 19:02:42.917692 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 162, running: True
I0915 19:02:43.917749 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 163, running: True
I0915 19:02:44.917807 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 164, running: True
I0915 19:02:45.917864 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 165, running: True
I0915 19:02:46.917921 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 166, running: True
I0915 19:02:47.917978 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 167, running: True
I0915 19:02:48.918035 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 168, running: True
I0915 19:02:49.918092 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 169, running: True
I0915 19:02:50.918150 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 170, running: True
I0915 19:02:51.919207 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 171, running: True
I0915 19:02:52.920264 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 172, running: True
I0915 19:02:53.920321 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 173, running: True
I0915 19:02:54.920379 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 174, running: True
I0915 19:02:55.920436 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 175, running: True
I0915 19:02:56.920493 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 176, running: True
I0915 19:02:57.921550 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 177, running: True
I0915 19:02:58.921607 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 178, running: True
I0915 19:02:59.921665 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 179, running: True
I0915 19:03:00.921722 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 180, running: True
I0915 19:03:01.922779 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 181, running: True
I0915 19:03:02.922836 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 182, running: True
I0915 19:03:03.923893 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 183, running: True
I0915 19:03:04.923951 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 184, running: True
I0915 19:03:05.924008 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 185, running: True
I0915 19:03:06.924065 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 186, running: True
I0915 19:03:07.924122 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 187, running: True
I0915 19:03:08.924180 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 188, running: True
I0915 19:03:09.925237 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 189, running: True
I0915 19:03:10.925294 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 190, running: True
I0915 19:03:11.925351 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 191, running: True
I0915 19:03:12.926409 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 192, running: True
I0915 19:03:13.926466 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 193, running: True
I0915 19:03:14.926523 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 194, running: True
I0915 19:03:15.926580 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 195, running: True
I0915 19:03:16.927638 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 196, running: True
I0915 19:03:17.927695 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 197, running: True
I0915 19:03:18.927752 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 198, running: True
I0915 19:03:19.927809 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 199, running: True
I0915 19:03:20.927866 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 200, running: True
I0915 19:03:21.927923 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 201, running: True
I0915 19:03:22.927981 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 202, running: True
I0915 19:03:23.928038 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 203, running: True
I0915 19:03:24.928095 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 204, running: True
I0915 19:03:25.928152 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 205, running: True
I0915 19:03:26.928210 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 206, running: True
I0915 19:03:27.928267 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 207, running: True
I0915 19:03:28.929324 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 208, running: True
I0915 19:03:29.929381 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 209, running: True
I0915 19:03:30.929438 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 210, running: True
I0915 19:03:31.929495 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 211, running: True
I0915 19:03:32.929553 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 212, running: True
I0915 19:03:33.929610 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 213, running: True
I0915 19:03:34.929667 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 214, running: True
I0915 19:03:35.929724 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 215, running: True
I0915 19:03:36.929781 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 216, running: True
I0915 19:03:37.929839 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 217, running: True
I0915 19:03:38.929896 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 218, running: True
I0915 19:03:39.930953 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 219, running: True
I0915 19:03:40.932010 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 220, running: True
I0915 19:03:41.932068 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 221, running: True
I0915 19:03:42.932125 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 222, running: True
I0915 19:03:43.932182 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 223, running: True
I0915 19:03:44.933239 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 224, running: True
I0915 19:03:45.933296 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 225, running: True
I0915 19:03:46.934354 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 226, running: True
I0915 19:03:47.935411 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 227, running: True
I0915 19:03:48.935468 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 228, running: True
I0915 19:03:49.935525 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 229, running: True
I0915 19:03:50.935582 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 230, running: True
I0915 19:03:51.935640 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 231, running: True
I0915 19:03:52.936697 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 232, running: True
I0915 19:03:53.936754 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 233, running: True
I0915 19:03:54.936811 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 234, running: True
I0915 19:03:55.936869 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 235, running: True
I0915 19:03:56.936926 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 236, running: True
I0915 19:03:57.937983 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 237, running: True
I0915 19:03:58.939040 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 238, running: True
I0915 19:03:59.939098 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 239, running: True
I0915 19:04:00.939155 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 240, running: True
I0915 19:04:01.939212 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 241, running: True
I0915 19:04:02.939269 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 242, running: True
I0915 19:04:03.940326 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 243, running: True
I0915 19:04:04.940383 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 244, running: True
I0915 19:04:05.942441 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 245, running: True
I0915 19:04:06.942498 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 246, running: True
I0915 19:04:07.942555 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 247, running: True
I0915 19:04:08.942612 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 248, running: True
I0915 19:04:09.942670 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 249, running: True
I0915 19:04:10.943727 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 250, running: True
I0915 19:04:11.943784 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 251, running: True
I0915 19:04:12.943841 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 252, running: True
I0915 19:04:13.943898 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 253, running: True
I0915 19:04:14.943956 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 254, running: True
I0915 19:04:15.944013 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 255, running: True
I0915 19:04:16.944070 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 256, running: True
I0915 19:04:17.944127 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 257, running: True
I0915 19:04:18.944185 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 258, running: True
I0915 19:04:19.944242 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 259, running: True
I0915 19:04:20.944299 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 260, running: True
I0915 19:04:21.944356 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 261, running: True
I0915 19:04:22.944413 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 262, running: True
I0915 19:04:23.945471 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 263, running: True
I0915 19:04:24.946528 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 264, running: True
I0915 19:04:25.946585 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 265, running: True
I0915 19:04:26.946642 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 266, running: True
I0915 19:04:27.946699 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 267, running: True
I0915 19:04:28.946757 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 268, running: True
I0915 19:04:29.946814 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 269, running: True
I0915 19:04:30.946871 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 270, running: True
I0915 19:04:31.946928 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 271, running: True
I0915 19:04:32.946985 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 272, running: True
I0915 19:04:33.947043 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 273, running: True
I0915 19:04:34.947100 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 274, running: True
I0915 19:04:35.947157 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 275, running: True
I0915 19:04:36.948214 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 276, running: True
I0915 19:04:37.948272 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 277, running: True
I0915 19:04:38.948329 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 278, running: True
I0915 19:04:39.948386 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 279, running: True
I0915 19:04:40.949443 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 280, running: True
I0915 19:04:41.949501 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 281, running: True
I0915 19:04:42.949558 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 282, running: True
I0915 19:04:43.949615 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 283, running: True
I0915 19:04:44.949672 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 284, running: True
I0915 19:04:45.949729 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 285, running: True
I0915 19:04:46.949786 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 286, running: True
I0915 19:04:47.949843 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 287, running: True
I0915 19:04:48.949901 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 288, running: True
I0915 19:04:49.949958 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 289, running: True
I0915 19:04:50.950015 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 290, running: True
I0915 19:04:51.950072 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 291, running: True
I0915 19:04:52.950129 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 292, running: True
I0915 19:04:53.950187 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 293, running: True
I0915 19:04:54.951244 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 294, running: True
I0915 19:04:55.951301 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 295, running: True
I0915 19:04:56.951359 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 296, running: True
I0915 19:04:57.951416 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 297, running: True
I0915 19:04:58.951473 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 298, running: True
I0915 19:04:59.951530 8972 remote_controller.py:163] Connecting to: ws://127.0.0.1:17308/sc2api, attempt: 299, running: True
W0915 19:05:04.051764 8972 sc_process.py:204] Killing the process.
I0915 19:05:04.149770 8972 sc_process.py:182] Shutdown with return code: 1
Traceback (most recent call last):
File “C:\Users\Administrator\venv\Scripts\Lib\runpy.py”, line 193, in _run_module_as_main
main”, mod_spec)
File “C:\Users\Administrator\venv\Scripts\Lib\runpy.py”, line 85, in _run_code
exec(code, run_globals)
File “I:\myPython\pythonCOM\venv\lib\site-packages\pysc2\bin\agent.py”, line 154, in
app.run(main)
File “I:\myPython\pythonCOM\venv\lib\site-packages\absl\app.py”, line 300, in run
_run_main(main, args)
File “I:\myPython\pythonCOM\venv\lib\site-packages\absl\app.py”, line 251, in _run_main
sys.exit(main(argv))
File “I:\myPython\pythonCOM\venv\lib\site-packages\pysc2\bin\agent.py”, line 140, in main
run_thread(agent_classes, players, FLAGS.map, FLAGS.render)
File “I:\myPython\pythonCOM\venv\lib\site-packages\pysc2\bin\agent.py”, line 98, in run_thread
visualize=visualize) as env:
File “I:\myPython\pythonCOM\venv\lib\site-packages\pysc2\env\sc2_env.py”, line 276, in init
self._launch_sp(map_inst, interfaces[0])
File “I:\myPython\pythonCOM\venv\lib\site-packages\pysc2\env\sc2_env.py”, line 351, in _launch_sp
want_rgb=interface.HasField(“render”))]
File “I:\myPython\pythonCOM\venv\lib\site-packages\pysc2\run_configs\platforms.py”, line 97, in start
self, exec_path=exec_path, version=version, **kwargs)
File “I:\myPython\pythonCOM\venv\lib\site-packages\pysc2\lib\sc_process.py”, line 116, in init
self._host, self._port, self, timeout_seconds=timeout_seconds)
File “I:\myPython\pythonCOM\venv\lib\site-packages\pysc2\lib\remote_controller.py”, line 143, in init
sock = self._connect(host, port, proc, timeout_seconds)
File “I:\myPython\pythonCOM\venv\lib\site-packages\pysc2\lib\stopwatch.py”, line 201, in _stopwatch
return func(*args, **kwargs)
File “I:\myPython\pythonCOM\venv\lib\site-packages\pysc2\lib\remote_controller.py”, line 174, in _connect
raise ConnectError(“Failed to connect to the SC2 websocket. Is it up?”)
pysc2.lib.remote_controller.ConnectError: Failed to connect to the SC2 websocket. Is it up?
I0915 19:05:04.174772 8972 sc2_env.py:656] Environment Close

求教成功 运行星际2 的大佬指定这个错误怎么解决。游戏一直启动不起来,我修改了源码,把启动时间加到300s 。尝试过直接运行 SC2_x64.exe ,也是不能启动。有人指点一下什么原因么。
如果我找到原因,会同步更新到博客上。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 8
    评论
Pysc2是一个用于创建人工智能星际争霸2(StarCraft II)理程序的Python库。它允许您通过Python代码与StarCraft II进行交互,并使用Python编写的算法来控制游戏单位。以下是一个简单的Pysc2示例,展示如何使用Pysc2库来控制星际争霸2游戏单位: ```python import numpy as np import cv2 import time import pysc2 from pysc2 import maps from pysc2.lib import actions from pysc2.lib import features # 加载StarCraft II地图 pysc2.maps.get("Simple64") # 定义动作和特征 FUNCTIONS = actions.FUNCTIONS FEATURES = features.features_from_game_version(game_version=pysc2.maps.get("Simple64").game_version) # 定义代理类 class SimpleAgent(pysc2.agents.Agent): def __init__(self): super(SimpleAgent, self).__init__() self.attack_coordinates = None def step(self, obs): super(SimpleAgent, self).step(obs) # 如果没有准备好攻击坐标,则选择一个 if self.attack_coordinates is None: player_relative = obs.observation["screen"][features.SCREEN_FEATURES.player_relative.index] x, y = (player_relative == features.PlayerRelative.ENEMY).nonzero() target = [x.mean(), y.mean()] self.attack_coordinates = target # 如果可以攻击,则攻击 if FUNCTIONS.Attack_screen.id in obs.observation["available_actions"]: player_relative = obs.observation["screen"][features.SCREEN_FEATURES.player_relative.index] x, y = (player_relative == features.PlayerRelative.ENEMY).nonzero() if not y.any(): return FUNCTIONS.no_op() target = [x[0], y[0]] return FUNCTIONS.Attack_screen("now", target) # 如果无法攻击,则移动到攻击坐标 player_relative = obs.observation["screen"][features.SCREEN_FEATURES.player_relative.index] x, y = (player_relative == features.PlayerRelative.SELF).nonzero() if not x.any(): return FUNCTIONS.no_op() player = [int(x.mean()), int(y.mean())] if self.attack_coordinates is not None: return FUNCTIONS.Move_screen("now", self.attack_coordinates) return FUNCTIONS.no_op() # 运行代理 agent = SimpleAgent() try: while True: with sc2_env.SC2Env( map_name="Simple64", players=[sc2_env.Agent(sc2_env.Race.terran)], agent_interface_format=features.AgentInterfaceFormat( feature_dimensions=features.Dimensions(screen=84, minimap=64), use_feature_units=True), step_mul=16, game_steps_per_episode=0, visualize=True) as env: # 运行一局游戏 agent.setup(env.observation_spec(), env.action_spec()) # 重置游戏环境 timesteps = env.reset() agent.reset() # 运行游戏 while True: step_actions = [agent.step(timesteps[0])] if timesteps[0].last(): break timesteps = env.step(step_actions) except KeyboardInterrupt: pass ```
评论 8
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值