Dentosal / python-sc2

A StarCraft II bot api client library for Python 3
MIT License
588 stars 182 forks source link

Multiple bots or humans cannot play simultaneously #136

Closed blaines closed 6 years ago

blaines commented 6 years ago

It appears, based on the logs I can get at this point while running a bot/human game that a create_game response is received after a join_game request is made. Over multiple attempts this pattern of create request, join request, create response, join response is stable. I've been reviewing the logic for how a game is created and joined but I'm not seeing any obvious issue.

DEBUG:sc2.protocol:Debug logging
INFO:sc2.main:run_game
INFO:sc2.main:_host_game
INFO:sc2.main:_join_game
err = 3 /opt/blizzard/buildserver/data.noindex/repositories/sc2/branches/SC2.4.6-Publish/Game/Contrib/macteam/libs/ClampCursor/Contrib/mach_override/mach_override.c:244
err = 3 /opt/blizzard/buildserver/data.noindex/repositories/sc2/branches/SC2.4.6-Publish/Game/Contrib/macteam/libs/ClampCursor/Contrib/mach_override/mach_override.c:258
err = 3 /opt/blizzard/buildserver/data.noindex/repositories/sc2/branches/SC2.4.6-Publish/Game/Contrib/macteam/libs/ClampCursor/Contrib/mach_override/mach_override.c:263
err = 3 /opt/blizzard/buildserver/data.noindex/repositories/sc2/branches/SC2.4.6-Publish/Game/Contrib/macteam/libs/ClampCursor/Contrib/mach_override/mach_override.c:244
err = 3 /opt/blizzard/buildserver/data.noindex/repositories/sc2/branches/SC2.4.6-Publish/Game/Contrib/macteam/libs/ClampCursor/Contrib/mach_override/mach_override.c:258
err = 3 /opt/blizzard/buildserver/data.noindex/repositories/sc2/branches/SC2.4.6-Publish/Game/Contrib/macteam/libs/ClampCursor/Contrib/mach_override/mach_override.c:263
NSWindowEdgeResizing is off!
NSWindowEdgeResizing is off!
DEBUG:sc2.protocol:Ping: <sc2.controller.Controller object at 0x1098ec828>
DEBUG:sc2.protocol:Sending request: ping {
}

DEBUG:sc2.protocol:Request sent
DEBUG:sc2.protocol:Ping: <sc2.controller.Controller object at 0x1098ec780>
DEBUG:sc2.protocol:Sending request: ping {
}

DEBUG:sc2.protocol:Request sent
DEBUG:sc2.protocol:Response received ping {
  game_version: "4.6.1.68195"
  data_version: "BEA99B4A8E7B41E62ADC06D194801BAB"
  data_build: 68195
  base_build: 67926
}
status: launched

INFO:sc2.protocol:Client status changed to Status.launched (was None)
INFO:sc2.main:_setup_host_game
INFO:sc2.controller:Creating new game
INFO:sc2.controller:Map:     AbyssalReefLE
INFO:sc2.controller:Players: Bot(Race.Protoss, <__main__.BlainesBot object at 0x108e71fd0>), Human(Race.Terran)
DEBUG:sc2.protocol:Sending request: create_game {
  local_map {
    map_path: "Ladder2017Season1/AbyssalReefLE.SC2Map"
  }
  player_setup {
    type: Participant
  }
  player_setup {
    type: Participant
  }
  realtime: false
}

DEBUG:sc2.protocol:Request sent
DEBUG:sc2.protocol:Response received ping {
  game_version: "4.6.1.68195"
  data_version: "BEA99B4A8E7B41E62ADC06D194801BAB"
  data_build: 68195
  base_build: 67926
}
status: launched

INFO:sc2.protocol:Client status changed to Status.launched (was None)
INFO:sc2.main:Portconfig(shared=18942, server=[15969, 18664], players=[[19731, 22250], [20401, 19316]])
INFO:sc2.main:_play_game
DEBUG:sc2.protocol:Sending request: join_game {
  race: Terran
  options {
    raw: true
    score: true
  }
  server_ports {
    game_port: 15969
    base_port: 18664
  }
  client_ports {
    game_port: 19731
    base_port: 22250
  }
  client_ports {
    game_port: 20401
    base_port: 19316
  }
  shared_port: 18942
}

DEBUG:sc2.protocol:Request sent
DEBUG:sc2.protocol:Response received create_game {
}
status: init_game

INFO:sc2.protocol:Client status changed to Status.init_game (was Status.launched)
INFO:sc2.main:_play_game
DEBUG:sc2.protocol:Sending request: join_game {
  race: Protoss
  options {
    raw: true
    score: true
  }
  server_ports {
    game_port: 15969
    base_port: 18664
  }
  client_ports {
    game_port: 19731
    base_port: 22250
  }
  client_ports {
    game_port: 20401
    base_port: 19316
  }
  shared_port: 18942
}

DEBUG:sc2.protocol:Request sent

I'm running a mac, game version info included above. I'm using master of this repo to play.

blaines commented 6 years ago

And this is apparently a SC2/Blizzard issue. Only resolution is to use an old version. I don't have any other details.

yetongDJI commented 6 years ago

I also have the same issue. It works well on Ubuntu, but the protocol just does not work on Mac.

BurnySc2 commented 6 years ago

Yup, this is a known issue. Blizzard responded unofficially that there will be a fix that may take a few weeks. The only workaround is either using the headless linux client or downgrading StarCraft 2 to an older version (for example version 4.5.1). Edit: the issue exists since start of september 2018

TaehwanKwon commented 6 years ago

I am having the the same issue on 4.6.1 patch. How can I down grade SC2?

BurnySc2 commented 6 years ago

This issue has been solved with StarCraft 2 patch 4.6.2.69232. Just upgrade the SC2 windows/mac client and you should be fine.