TimZaman/dotaservice

botcpp_dire.so and stuck at the map loading screen

sijiaxu opened this issue · 7 comments

I notice the error log after launching the game
screenshot from 2019-01-08 03-55-47

it seems needs to compile both botcpp_radiant.so and botcpp_dire.so, I use the same command except the -o option parameter to compile both libraries.

g++ -shared -o botcpp_radiant.so -fPIC botcpp_radiant.cpp dota_gcmessages_common_bot_script.pb.cc -std=c++11 -lprotobuf

I also modified the code to copy .so to bots folder

# shutil.copy('/Users/tzaman/dev/dotaservice/botcpp/botcpp_radiant.so', bot_path)

but this throws many errors and terminate the game
screenshot from 2019-01-08 01-44-31

I also test the dotaservice without copy libraries and only copy radiant libraries, although not come to above error, the game all stuck at the map loading screen(in gui mode) and my client can not receive any normal observation.

from grpclib.client import Channel
from dotaservice.protos.DotaService_grpc import DotaServiceStub
from dotaservice.protos.DotaService_pb2 import GameConfig
from dotaservice.protos.DotaService_pb2 import Actions
from dotaservice.protos.DotaService_pb2 import ObserveConfig, Status
from dotaservice.protos.DotaService_pb2 import TEAM_RADIANT, TEAM_DIRE
import asyncio
from dotaservice.protos.dota_gcmessages_common_bot_script_pb2 import CMsgBotWorldState
from dotaservice.protos.dota_shared_enums_pb2 import DOTA_GAMEMODE_1V1MID

import time

async def game_init():
    await env.reset(GameConfig(ticks_per_observation=3, host_mode=1, game_mode=DOTA_GAMEMODE_1V1MID))
    print("init finish")
    for i in range(1000):
        response = await env.observe(ObserveConfig(team_id=TEAM_RADIANT))
        if response.status != Status.Value('OK'):
            print("response status %s"%str(response.status))
        obs = response.world_state
        dota_time = obs.dota_time
        print("cur time %s" %str(dota_time))
        time.sleep(1)

    print("finish")
    return

# Connect to the DotaService.
cur_loop = asyncio.get_event_loop()
env = DotaServiceStub(Channel('127.0.0.1', 13337, loop=cur_loop))

# Get the initial observation.
cur_loop.run_until_complete(game_init())

below is the dota console log save in bots folder

01/08/2019 - 04:43:27: WARNING: CDirWatcher not implemented
01/08/2019 - 04:43:27: ERROR: HangWatchdogInternal_BeginScope() - Hang watchdog not implemented for this platform!
01/08/2019 - 04:43:27: ERROR: HangWatchdogInternal_EndScope() - Hang watchdog not implemented for this platform!
01/08/2019 - 04:43:27: [Filesystem] ---------------
01/08/2019 - 04:43:27: [Filesystem] Path ID:             File Path:
01/08/2019 - 04:43:27: [Filesystem] ADDONS               "/root/Steam/steamapps/common/dota 2 beta/game/dota_addons/" 
01/08/2019 - 04:43:27: [Filesystem] CONTENT              "/root/Steam/steamapps/common/dota 2 beta/content/dota/" 
01/08/2019 - 04:43:27: [Filesystem] CONTENT              "/root/Steam/steamapps/common/dota 2 beta/content/core/" 
01/08/2019 - 04:43:27: [Filesystem] CONTENTADDONS        "/root/Steam/steamapps/common/dota 2 beta/content/dota_addons/" 
01/08/2019 - 04:43:27: [Filesystem] CONTENTROOT          "/root/Steam/steamapps/common/dota 2 beta/content/" 
01/08/2019 - 04:43:27: [Filesystem] DEFAULT_WRITE_PATH   "/root/Steam/steamapps/common/dota 2 beta/game/dota/pak01.vpk" (vpk) /root/Steam/steamapps/common/dota 2 beta/game/dota/pak01.vpk
01/08/2019 - 04:43:27: [Filesystem] DEFAULT_WRITE_PATH   "/root/Steam/steamapps/common/dota 2 beta/game/dota/" 
01/08/2019 - 04:43:27: [Filesystem] EXECUTABLE_PATH      "/root/Steam/steamapps/common/dota 2 beta/game/bin/linuxsteamrt64/" 
01/08/2019 - 04:43:27: [Filesystem] GAME                 "/root/Steam/steamapps/common/dota 2 beta/game/dota/pak01.vpk" (vpk) /root/Steam/steamapps/common/dota 2 beta/game/dota/pak01.vpk
01/08/2019 - 04:43:27: [Filesystem] GAME                 "/root/Steam/steamapps/common/dota 2 beta/game/core/pak01.vpk" (vpk) /root/Steam/steamapps/common/dota 2 beta/game/core/pak01.vpk
01/08/2019 - 04:43:27: [Filesystem] GAME                 "/root/Steam/steamapps/common/dota 2 beta/game/dota/" 
01/08/2019 - 04:43:27: [Filesystem] GAME                 "/root/Steam/steamapps/common/dota 2 beta/game/core/" 
01/08/2019 - 04:43:27: [Filesystem] GAMEBIN              "/root/Steam/steamapps/common/dota 2 beta/game/dota/bin/linuxsteamrt64/" 
01/08/2019 - 04:43:27: [Filesystem] GAMEBIN              "/root/Steam/steamapps/common/dota 2 beta/game/dota/bin/" 
01/08/2019 - 04:43:27: [Filesystem] GAMEBIN              "/root/Steam/steamapps/common/dota 2 beta/game/core/bin/linuxsteamrt64/" 
01/08/2019 - 04:43:27: [Filesystem] GAMEBIN              "/root/Steam/steamapps/common/dota 2 beta/game/core/bin/" 
01/08/2019 - 04:43:27: [Filesystem] GAMEROOT             "/root/Steam/steamapps/common/dota 2 beta/game/" 
01/08/2019 - 04:43:27: [Filesystem] MOD                  "/root/Steam/steamapps/common/dota 2 beta/game/dota/pak01.vpk" (vpk) /root/Steam/steamapps/common/dota 2 beta/game/dota/pak01.vpk
01/08/2019 - 04:43:27: [Filesystem] MOD                  "/root/Steam/steamapps/common/dota 2 beta/game/dota/" 
01/08/2019 - 04:43:27: [Filesystem] PLATFORM             "/root/Steam/steamapps/common/dota 2 beta/game/core/pak01.vpk" (vpk) /root/Steam/steamapps/common/dota 2 beta/game/core/pak01.vpk
01/08/2019 - 04:43:27: [Filesystem] PLATFORM             "/root/Steam/steamapps/common/dota 2 beta/game/core/" 
01/08/2019 - 04:43:27: [Filesystem] SHADER_SOURCE        "/root/Steam/steamapps/common/dota 2 beta/src/shaders/dota/" 
01/08/2019 - 04:43:27: [Filesystem] SHADER_SOURCE        "/root/Steam/steamapps/common/dota 2 beta/src/shaders/core/" 
01/08/2019 - 04:43:27: [Filesystem] SHADER_SOURCE        "/root/Steam/steamapps/common/dota 2 beta/src/shaders/dota_addons/" 
01/08/2019 - 04:43:27: [Filesystem] SHADER_SOURCE        "/root/Steam/steamapps/common/dota 2 beta/src/shaders/dota_core/" 
01/08/2019 - 04:43:27: [Filesystem] SHADER_SOURCE_MOD    "/root/Steam/steamapps/common/dota 2 beta/src/shaders/dota/" 
01/08/2019 - 04:43:27: [Filesystem] SHADER_SOURCE_ROOT   "/root/Steam/steamapps/common/dota 2 beta/src/shaders/" 
01/08/2019 - 04:43:27: [CommandLine] command line arguments:
01/08/2019 - 04:43:27: [CommandLine] -botworldstatetosocket_frames 30 -botworldstatetosocket_radiant 12120 -botworldstatetosocket_dire 12121 -con_logfile scripts/vscripts/bots/console.log -con_timestamp -console -insecure -sw -noip -nowatchdog +clientport 27006 +dota_1v1_skip_strategy 1 +dota_surrender_on_disconnect 0 +host_timescale 1 +hostname dotaservice +sv_cheats 1 +sv_hibernate_when_empty 0 +tv_delay 0 +tv_enable 1 +tv_title d98ef9c6-1329-11e9-ab64-2c4d54ecfe97 +tv_autorecord 1 +tv_transmitall 1 -dedicated -fill_with_bots +map start gamemode 11 +sv_lan 1
01/08/2019 - 04:43:27: [Networking] Network System Initialized
01/08/2019 - 04:43:27: [Networking] 10.23.112.15: enp2s0 
01/08/2019 - 04:43:27: [Networking] 127.0.0.1: lo 
01/08/2019 - 04:43:27: Physics Console Communications is not initialized
01/08/2019 - 04:43:27: [SplitScreen] Game supporting (4) split screen players
01/08/2019 - 04:43:28:  failed to dlopen libtensorflow.so error=libtensorflow.so: cannot open shared object file: No such file or directory
01/08/2019 - 04:43:28: [Networking] CEntitySystem::BuildEntityNetworking (parallel build of server) took 250.865 msecs for 859 out of 877 classes
01/08/2019 - 04:43:29: Failed to load mutations file! scripts/battlepass/ti2018/mutations.txt
01/08/2019 - 04:43:29: [ResourceSystem] Error loading resource file "soundevents/soundevents_test.vsndevts_c" (Error: ERROR_FILEOPEN)
01/08/2019 - 04:43:29: Attempted to set unknown configuration value <unknown>!
01/08/2019 - 04:43:29: name[ 0 ] changing from 'unnamed' to 'xsj.guagua'
01/08/2019 - 04:43:29: Error in user configuration file
01/08/2019 - 04:43:29: name[ 0 ] changing from 'xsj.guagua' to 'xsj.guagua'
01/08/2019 - 04:43:29: [HostStateManager] CHostStateMgr::QueueNewRequest( Idle (console), 1 )
01/08/2019 - 04:43:29: [EngineServiceManager] SwitchToLoop console requested:  id [1] addons []
01/08/2019 - 04:43:29: [HostStateManager] Idle (console)
01/08/2019 - 04:43:29: [HostStateManager] CHostStateMgr::QueueNewRequest( Loading (start), 2 )
01/08/2019 - 04:43:29: [EngineServiceManager] SwitchToLoop levelload requested:  id [2] addons []
01/08/2019 - 04:43:30: [Server] SV:  Level loading started for 'start'
01/08/2019 - 04:43:30: [Steam] Running SteamAPI_RunCallbacks for first time
01/08/2019 - 04:43:30: [Client] CL:  CLoopModeLevelLoad::MaybeSwitchToGameLoop switching to "game" loopmode with addons ()
01/08/2019 - 04:43:30: [EngineServiceManager] SwitchToLoop game requested:  id [2] addons []
01/08/2019 - 04:43:30: [Server] CNetworkGameServerBase::SetServerState (ss_dead -> ss_waitingforgamesessionmanifest)
01/08/2019 - 04:43:30: [Server] SV:  maxplayers set to 64
01/08/2019 - 04:43:30: [Networking] TCP/UDP Disabled.
01/08/2019 - 04:43:30: [Networking] Network socket 'server' opened on port 27015
01/08/2019 - 04:43:30: Initializing script VM...
01/08/2019 - 04:43:30: ...done
01/08/2019 - 04:43:30: [Server] SV:  Executing dedicated server config file
01/08/2019 - 04:43:30: S:Gamerules: entering state 'DOTA_GAMERULES_STATE_INIT'
01/08/2019 - 04:43:30: [Server] SV:  CGameRulesGameSystem::GameInit installed game rules
01/08/2019 - 04:43:30: Radiant bot scripting using script path /root/Steam/steamapps/common/dota 2 beta/game/dota/scripts/vscripts/bots
01/08/2019 - 04:43:30: LoadScript: /root/Steam/steamapps/common/dota 2 beta/game/dota/scripts/vscripts/bots/hero_selection.lua, scope name HeroSelectionScriptScope
01/08/2019 - 04:43:30: [VScript] Decode sucessful:	table: 0x002330b0
01/08/2019 - 04:43:30: LoadScript: /root/Steam/steamapps/common/dota 2 beta/game/dota/scripts/vscripts/bots/team_desires.lua, scope name TeamDesiresScriptScope
01/08/2019 - 04:43:30: LoadScript: /root/Steam/steamapps/common/dota 2 beta/game/dota/scripts/vscripts/bots/team_desires.lua not found!
01/08/2019 - 04:43:30: About to load botcpp from /root/Steam/steamapps/common/dota 2 beta/game/dota/scripts/vscripts/bots/botcpp_radiant.so
01/08/2019 - 04:43:30: Could not open botcpp: /root/Steam/steamapps/common/dota 2 beta/game/dota/scripts/vscripts/bots/botcpp_radiant.so: cannot open shared object file: No such file or directory
01/08/2019 - 04:43:30: Dire bot scripting using script path /root/Steam/steamapps/common/dota 2 beta/game/dota/scripts/vscripts/bots
01/08/2019 - 04:43:30: LoadScript: /root/Steam/steamapps/common/dota 2 beta/game/dota/scripts/vscripts/bots/hero_selection.lua, scope name HeroSelectionScriptScope
01/08/2019 - 04:43:30: [VScript] Decode sucessful:	table: 0x003330b0
01/08/2019 - 04:43:30: LoadScript: /root/Steam/steamapps/common/dota 2 beta/game/dota/scripts/vscripts/bots/team_desires.lua, scope name TeamDesiresScriptScope
01/08/2019 - 04:43:30: LoadScript: /root/Steam/steamapps/common/dota 2 beta/game/dota/scripts/vscripts/bots/team_desires.lua not found!
01/08/2019 - 04:43:30: About to load botcpp from /root/Steam/steamapps/common/dota 2 beta/game/dota/scripts/vscripts/bots/botcpp_dire.so
01/08/2019 - 04:43:30: Could not open botcpp: /root/Steam/steamapps/common/dota 2 beta/game/dota/scripts/vscripts/bots/botcpp_dire.so: cannot open shared object file: No such file or directory
01/08/2019 - 04:43:30: [Server] SV:  Spawn Server: start
01/08/2019 - 04:43:30: [Server] CNetworkGameServerBase::SetServerState (ss_waitingforgamesessionmanifest -> ss_loading)
01/08/2019 - 04:43:30: [Server] CNetworkGameServerBase::SetServerState (ss_dead -> ss_waitingforgamesessionmanifest)
01/08/2019 - 04:43:30: [Server] SV:  maxplayers set to 64
01/08/2019 - 04:43:30: [Networking] TCP/UDP Disabled.
01/08/2019 - 04:43:30: [Networking] Network socket 'hltv' opened on port 27020
01/08/2019 - 04:43:30: [HLTV Server] Starting SourceTV server listening on port 27020.
01/08/2019 - 04:43:30: [Server] CNetworkGameServerBase::SetServerState (ss_loading -> ss_active)
01/08/2019 - 04:43:30: [Server] SV:  IGameSystem::LoopActivateAllSystems
01/08/2019 - 04:43:30: [Host] HO:  IGameSystem::LoopActivateAllSystems
01/08/2019 - 04:43:30: Height map file (maps/start.vhcg) not found, this will make ground height traces more expensive! Recompile the map to generate a height map.
01/08/2019 - 04:43:30: [Server] SV:  64 player server started
01/08/2019 - 04:43:30: [Server] SV:  WriteInitialSpawnGroups sending 1 groups
01/08/2019 - 04:43:30: [HLTV Server] Recording SourceTV replay to replays/auto-20190108-0443-start-dotaservice.dem...
01/08/2019 - 04:43:30: [HLTV Server] playdemo replays/auto-20190108-0443-start-dotaservice.dem
01/08/2019 - 04:43:30: [HostStateManager] Loading (start)
01/08/2019 - 04:43:30: S:Gamerules: entering state 'DOTA_GAMERULES_STATE_CUSTOM_GAME_SETUP'
01/08/2019 - 04:43:30: S:Gamerules: entering state 'DOTA_GAMERULES_STATE_HERO_SELECTION'
01/08/2019 - 04:43:30: SV: Started streaming map dota spawngroup 2
01/08/2019 - 04:43:30: [Server] CDOTA_PlayerResource: Adding player SteamID 90071996842377217 to slot 0 FakeClient=1 preferred slot = -1
01/08/2019 - 04:43:30: [Server] PR:SetPlayerName 0:[I:0:0] "d98ef9c6_R0 (Bot)"
01/08/2019 - 04:43:30: [Server] CDOTA_PlayerResource: Adding player SteamID 90071996842377218 to slot 1 FakeClient=1 preferred slot = -1
01/08/2019 - 04:43:30: [Server] PR:SetPlayerName 1:[I:0:0] "d98ef9c6_R1 (Bot)"
01/08/2019 - 04:43:30: [Server] CDOTA_PlayerResource: Adding player SteamID 90071996842377219 to slot 2 FakeClient=1 preferred slot = -1
01/08/2019 - 04:43:30: [Server] PR:SetPlayerName 2:[I:0:0] "d98ef9c6_R2 (Bot)"
01/08/2019 - 04:43:30: [Server] CDOTA_PlayerResource: Adding player SteamID 90071996842377220 to slot 3 FakeClient=1 preferred slot = -1
01/08/2019 - 04:43:30: [Server] PR:SetPlayerName 3:[I:0:0] "d98ef9c6_R3 (Bot)"
01/08/2019 - 04:43:30: [Server] CDOTA_PlayerResource: Adding player SteamID 90071996842377221 to slot 4 FakeClient=1 preferred slot = -1
01/08/2019 - 04:43:30: [Server] PR:SetPlayerName 4:[I:0:0] "d98ef9c6_R4 (Bot)"
01/08/2019 - 04:43:30: [Server] CDOTA_PlayerResource: Adding player SteamID 90071996842377222 to slot 5 FakeClient=1 preferred slot = -1
01/08/2019 - 04:43:30: [Server] PR:SetPlayerName 5:[I:0:0] "d98ef9c6_D0 (Bot)"
01/08/2019 - 04:43:30: [Server] CDOTA_PlayerResource: Adding player SteamID 90071996842377223 to slot 6 FakeClient=1 preferred slot = -1
01/08/2019 - 04:43:30: [Server] PR:SetPlayerName 6:[I:0:0] "d98ef9c6_D1 (Bot)"
01/08/2019 - 04:43:30: [Server] CDOTA_PlayerResource: Adding player SteamID 90071996842377224 to slot 7 FakeClient=1 preferred slot = -1
01/08/2019 - 04:43:30: [Server] PR:SetPlayerName 7:[I:0:0] "d98ef9c6_D2 (Bot)"
01/08/2019 - 04:43:30: [Server] CDOTA_PlayerResource: Adding player SteamID 90071996842377225 to slot 8 FakeClient=1 preferred slot = -1
01/08/2019 - 04:43:30: [Server] PR:SetPlayerName 8:[I:0:0] "d98ef9c6_D3 (Bot)"
01/08/2019 - 04:43:30: [Server] CDOTA_PlayerResource: Adding player SteamID 90071996842377226 to slot 9 FakeClient=1 preferred slot = -1
01/08/2019 - 04:43:30: [Server] PR:SetPlayerName 9:[I:0:0] "d98ef9c6_D4 (Bot)"
01/08/2019 - 04:43:30: [Server] PR:SetSelectedHero 0:[I:0:0] npc_dota_hero_nevermore(11)
01/08/2019 - 04:43:30: [Server] PR:SetSelectedHero 1:[I:0:0] npc_dota_hero_sniper(35)
01/08/2019 - 04:43:30: [Server] PR:SetSelectedHero 2:[I:0:0] npc_dota_hero_sniper(35)
01/08/2019 - 04:43:30: [Server] PR:SetSelectedHero 3:[I:0:0] npc_dota_hero_sniper(35)
01/08/2019 - 04:43:30: [Server] PR:SetSelectedHero 4:[I:0:0] npc_dota_hero_sniper(35)
01/08/2019 - 04:43:30: [Server] PR:SetSelectedHero 5:[I:0:0] npc_dota_hero_nevermore(11)
01/08/2019 - 04:43:30: [Server] PR:SetSelectedHero 6:[I:0:0] npc_dota_hero_sniper(35)
01/08/2019 - 04:43:30: [Server] PR:SetSelectedHero 7:[I:0:0] npc_dota_hero_sniper(35)
01/08/2019 - 04:43:30: [Server] PR:SetSelectedHero 8:[I:0:0] npc_dota_hero_sniper(35)
01/08/2019 - 04:43:30: [Server] PR:SetSelectedHero 9:[I:0:0] npc_dota_hero_sniper(35)
01/08/2019 - 04:43:30: [HLTV Server] SourceTV broadcast active.
01/08/2019 - 04:43:30: S:Gamerules: entering state 'DOTA_GAMERULES_STATE_STRATEGY_TIME'
01/08/2019 - 04:43:30: [Server] Unable to load grid nav: file not found for world prefabs/promotional_radiant_fountain
01/08/2019 - 04:43:30: [Server] Unable to load grid nav: file not found for world prefabs/promotional_dire_fountain
01/08/2019 - 04:43:31: [Server] SV:  ServerSteamID=[A:1:3874839552:11736] (90122402158435328).
01/08/2019 - 04:43:31: [Server] SV:  CDOTAGCServerSystem - couldn't add listener because Steam wasn't ready
01/08/2019 - 04:43:31: [SteamNetSockets] Gameserver logged on to Steam, assigned SteamID [A:1:3874839552:11736]
01/08/2019 - 04:43:31: [Server] SV:  VAC secure mode disabled.
01/08/2019 - 04:43:32: [GCClient] Received server welcome from GC.
01/08/2019 - 04:43:32: [SOCache] CMsgClientWelcome subscribed: 0 up-to-date, 0 out-of-date
01/08/2019 - 04:43:32: Version out of date (GC wants 3312, we are 3311)!
01/08/2019 - 04:43:32: Version out of date (GC wants 3312, we are 3311)!
01/08/2019 - 04:44:00: S:Gamerules: entering state 'DOTA_GAMERULES_STATE_TEAM_SHOWCASE'
01/08/2019 - 04:44:12: S:Gamerules: entering state 'DOTA_GAMERULES_STATE_WAIT_FOR_MAP_TO_LOAD'
01/08/2019 - 04:44:13: S:Gamerules: entering state 'DOTA_GAMERULES_STATE_PRE_GAME'
01/08/2019 - 04:44:13: m_flPreGameStartTime set to 31.13
01/08/2019 - 04:44:13: m_flStateTransitionTime set to 121.13
01/08/2019 - 04:44:13: Height map file (maps/prefabs/promotional_radiant_fountain.vhcg) not found, this will make ground height traces more expensive! Recompile the map to generate a height map.
01/08/2019 - 04:44:13: Height map file (maps/prefabs/promotional_dire_fountain.vhcg) not found, this will make ground height traces more expensive! Recompile the map to generate a height map.
01/08/2019 - 04:44:15: [VScript] LUARDY	{"step":60,"dota_time":-87.933364868164}
01/08/2019 - 04:44:15: [VScript] (lua) looking for loadfile =	bots/live_config_auto
01/08/2019 - 04:44:25: [VScript] (lua) received live_config =	{ 
  calibration_dota_time = -88.233360290527 
}
01/08/2019 - 04:44:25: Script function 'Think' on bot npc_dota_hero_nevermore took 10097.265ms
01/08/2019 - 04:44:25: [VScript] LUARDY	{"step":60,"dota_time":-87.86669921875}
01/08/2019 - 04:44:25: [VScript] (lua) looking for loadfile =	bots/live_config_auto
01/08/2019 - 04:44:25: [VScript] (lua) received live_config =	{ 
  calibration_dota_time = -88.233360290527 
}

and I redirect dotaservice's log to local file, it looks like before enter the game the world state is received normally, but after enter the game it disappear and the observe function wait 10 seconds to raise a timeout error.

2019-01-08 05:53:07,031 INFO     DotaService 0.3.2 serving on :13337
2019-01-08 05:53:14,207 INFO     DotaService::reset()
2019-01-08 05:53:14,207 DEBUG    config=
ticks_per_observation: 30
host_mode: HOST_MODE_DEDICATED

2019-01-08 05:53:14,221 DEBUG    ::reset is awaiting lua config..
2019-01-08 05:53:18,036 DEBUG    demo_path_rel=replays/auto-20190108-0553-start-dotaservice.dem
2019-01-08 05:53:18,808 DEBUG    Received world_state: dotatime=-29.16666603088379, gamestate=3, team=2
2019-01-08 05:53:18,809 DEBUG    Received world_state: dotatime=-29.16666603088379, gamestate=3, team=3
2019-01-08 05:53:19,809 DEBUG    Received world_state: dotatime=-28.166667938232422, gamestate=3, team=2
2019-01-08 05:53:19,809 DEBUG    Received world_state: dotatime=-28.166667938232422, gamestate=3, team=3
2019-01-08 05:53:20,809 DEBUG    Received world_state: dotatime=-27.166667938232422, gamestate=3, team=2
2019-01-08 05:53:20,809 DEBUG    Received world_state: dotatime=-27.166667938232422, gamestate=3, team=3
2019-01-08 05:53:21,808 DEBUG    Received world_state: dotatime=-26.166669845581055, gamestate=3, team=2
2019-01-08 05:53:21,809 DEBUG    Received world_state: dotatime=-26.166669845581055, gamestate=3, team=3
2019-01-08 05:53:22,808 DEBUG    Received world_state: dotatime=-25.166669845581055, gamestate=3, team=2
2019-01-08 05:53:22,809 DEBUG    Received world_state: dotatime=-25.166669845581055, gamestate=3, team=3
2019-01-08 05:53:23,808 DEBUG    Received world_state: dotatime=-24.166671752929688, gamestate=3, team=2
2019-01-08 05:53:23,809 DEBUG    Received world_state: dotatime=-24.166671752929688, gamestate=3, team=3
2019-01-08 05:53:24,808 DEBUG    Received world_state: dotatime=-23.166671752929688, gamestate=3, team=2
2019-01-08 05:53:24,809 DEBUG    Received world_state: dotatime=-23.166671752929688, gamestate=3, team=3
2019-01-08 05:53:25,808 DEBUG    Received world_state: dotatime=-22.16666030883789, gamestate=3, team=2
2019-01-08 05:53:25,809 DEBUG    Received world_state: dotatime=-22.16666030883789, gamestate=3, team=3
2019-01-08 05:53:26,808 DEBUG    Received world_state: dotatime=-21.16664695739746, gamestate=3, team=2
2019-01-08 05:53:26,809 DEBUG    Received world_state: dotatime=-21.16664695739746, gamestate=3, team=3
2019-01-08 05:53:27,808 DEBUG    Received world_state: dotatime=-20.16663360595703, gamestate=3, team=2
2019-01-08 05:53:27,808 DEBUG    Received world_state: dotatime=-20.16663360595703, gamestate=3, team=3
2019-01-08 05:53:28,808 DEBUG    Received world_state: dotatime=-19.1666202545166, gamestate=3, team=2
2019-01-08 05:53:28,808 DEBUG    Received world_state: dotatime=-19.1666202545166, gamestate=3, team=3
2019-01-08 05:53:29,808 DEBUG    Received world_state: dotatime=-18.166606903076172, gamestate=3, team=2
2019-01-08 05:53:29,809 DEBUG    Received world_state: dotatime=-18.166606903076172, gamestate=3, team=3
2019-01-08 05:53:30,808 DEBUG    Received world_state: dotatime=-17.166593551635742, gamestate=3, team=2
2019-01-08 05:53:30,809 DEBUG    Received world_state: dotatime=-17.166593551635742, gamestate=3, team=3
2019-01-08 05:53:31,808 DEBUG    Received world_state: dotatime=-16.166580200195312, gamestate=3, team=2
2019-01-08 05:53:31,809 DEBUG    Received world_state: dotatime=-16.166580200195312, gamestate=3, team=3
2019-01-08 05:53:32,808 DEBUG    Received world_state: dotatime=-15.166566848754883, gamestate=3, team=2
2019-01-08 05:53:32,809 DEBUG    Received world_state: dotatime=-15.166566848754883, gamestate=3, team=3
2019-01-08 05:53:33,808 DEBUG    Received world_state: dotatime=-14.166580200195312, gamestate=3, team=2
2019-01-08 05:53:33,809 DEBUG    Received world_state: dotatime=-14.166580200195312, gamestate=3, team=3
2019-01-08 05:53:34,808 DEBUG    Received world_state: dotatime=-13.166595458984375, gamestate=3, team=2
2019-01-08 05:53:34,809 DEBUG    Received world_state: dotatime=-13.166595458984375, gamestate=3, team=3
2019-01-08 05:53:35,808 DEBUG    Received world_state: dotatime=-12.166610717773438, gamestate=3, team=2
2019-01-08 05:53:35,809 DEBUG    Received world_state: dotatime=-12.166610717773438, gamestate=3, team=3
2019-01-08 05:53:36,808 DEBUG    Received world_state: dotatime=-11.1666259765625, gamestate=3, team=2
2019-01-08 05:53:36,808 DEBUG    Received world_state: dotatime=-11.1666259765625, gamestate=3, team=3
2019-01-08 05:53:37,808 DEBUG    Received world_state: dotatime=-10.166641235351562, gamestate=3, team=2
2019-01-08 05:53:37,809 DEBUG    Received world_state: dotatime=-10.166641235351562, gamestate=3, team=3
2019-01-08 05:53:38,808 DEBUG    Received world_state: dotatime=-9.166656494140625, gamestate=3, team=2
2019-01-08 05:53:38,808 DEBUG    Received world_state: dotatime=-9.166656494140625, gamestate=3, team=3
2019-01-08 05:53:39,808 DEBUG    Received world_state: dotatime=-8.166671752929688, gamestate=3, team=2
2019-01-08 05:53:39,809 DEBUG    Received world_state: dotatime=-8.166671752929688, gamestate=3, team=3
2019-01-08 05:53:40,808 DEBUG    Received world_state: dotatime=-7.16668701171875, gamestate=3, team=2
2019-01-08 05:53:40,808 DEBUG    Received world_state: dotatime=-7.16668701171875, gamestate=3, team=3
2019-01-08 05:53:41,808 DEBUG    Received world_state: dotatime=-6.1667022705078125, gamestate=3, team=2
2019-01-08 05:53:41,809 DEBUG    Received world_state: dotatime=-6.1667022705078125, gamestate=3, team=3
2019-01-08 05:53:42,808 DEBUG    Received world_state: dotatime=-5.166717529296875, gamestate=3, team=2
2019-01-08 05:53:42,809 DEBUG    Received world_state: dotatime=-5.166717529296875, gamestate=3, team=3
2019-01-08 05:53:43,808 DEBUG    Received world_state: dotatime=-4.1667327880859375, gamestate=3, team=2
2019-01-08 05:53:43,808 DEBUG    Received world_state: dotatime=-4.1667327880859375, gamestate=3, team=3
2019-01-08 05:53:44,808 DEBUG    Received world_state: dotatime=-3.166748046875, gamestate=3, team=2
2019-01-08 05:53:44,808 DEBUG    Received world_state: dotatime=-3.166748046875, gamestate=3, team=3
2019-01-08 05:53:45,808 DEBUG    Received world_state: dotatime=-2.1667633056640625, gamestate=3, team=2
2019-01-08 05:53:45,808 DEBUG    Received world_state: dotatime=-2.1667633056640625, gamestate=3, team=3
2019-01-08 05:53:46,808 DEBUG    Received world_state: dotatime=-1.166778564453125, gamestate=3, team=2
2019-01-08 05:53:46,808 DEBUG    Received world_state: dotatime=-1.166778564453125, gamestate=3, team=3
2019-01-08 05:53:47,808 DEBUG    Received world_state: dotatime=-0.1667938232421875, gamestate=3, team=2
2019-01-08 05:53:47,808 DEBUG    Received world_state: dotatime=-0.1667938232421875, gamestate=3, team=3
2019-01-08 05:53:48,808 DEBUG    Received world_state: dotatime=-12.10013198852539, gamestate=8, team=2
2019-01-08 05:53:48,808 DEBUG    Received world_state: dotatime=-12.10013198852539, gamestate=8, team=3
2019-01-08 05:53:49,808 DEBUG    Received world_state: dotatime=-12.10013198852539, gamestate=8, team=2
2019-01-08 05:53:49,808 DEBUG    Received world_state: dotatime=-12.10013198852539, gamestate=8, team=3
2019-01-08 05:53:50,808 DEBUG    Received world_state: dotatime=-12.10013198852539, gamestate=8, team=2
2019-01-08 05:53:50,808 DEBUG    Received world_state: dotatime=-12.10013198852539, gamestate=8, team=3
2019-01-08 05:53:51,808 DEBUG    Received world_state: dotatime=-12.10013198852539, gamestate=8, team=2
2019-01-08 05:53:51,809 DEBUG    Received world_state: dotatime=-12.10013198852539, gamestate=8, team=3
2019-01-08 05:53:52,808 DEBUG    Received world_state: dotatime=-12.10013198852539, gamestate=8, team=2
2019-01-08 05:53:52,809 DEBUG    Received world_state: dotatime=-12.10013198852539, gamestate=8, team=3
2019-01-08 05:53:53,808 DEBUG    Received world_state: dotatime=-12.10013198852539, gamestate=8, team=2
2019-01-08 05:53:53,808 DEBUG    Received world_state: dotatime=-12.10013198852539, gamestate=8, team=3
2019-01-08 05:53:54,808 DEBUG    Received world_state: dotatime=-12.10013198852539, gamestate=8, team=2
2019-01-08 05:53:54,809 DEBUG    Received world_state: dotatime=-12.10013198852539, gamestate=8, team=3
2019-01-08 05:53:55,808 DEBUG    Received world_state: dotatime=-12.10013198852539, gamestate=8, team=2
2019-01-08 05:53:55,809 DEBUG    Received world_state: dotatime=-12.10013198852539, gamestate=8, team=3
2019-01-08 05:53:56,808 DEBUG    Received world_state: dotatime=-12.10013198852539, gamestate=8, team=2
2019-01-08 05:53:56,809 DEBUG    Received world_state: dotatime=-12.10013198852539, gamestate=8, team=3
2019-01-08 05:53:57,808 DEBUG    Received world_state: dotatime=-12.10013198852539, gamestate=8, team=2
2019-01-08 05:53:57,809 DEBUG    Received world_state: dotatime=-12.10013198852539, gamestate=8, team=3
2019-01-08 05:53:58,808 DEBUG    Received world_state: dotatime=-12.10013198852539, gamestate=8, team=2
2019-01-08 05:53:58,808 DEBUG    Received world_state: dotatime=-12.10013198852539, gamestate=8, team=3
2019-01-08 05:53:59,808 DEBUG    Received world_state: dotatime=-12.10013198852539, gamestate=8, team=2
2019-01-08 05:53:59,809 DEBUG    Received world_state: dotatime=-12.10013198852539, gamestate=8, team=3
2019-01-08 05:54:00,990 DEBUG    Received world_state: dotatime=-89.23334503173828, gamestate=4, team=2
2019-01-08 05:54:00,993 DEBUG    Received world_state: dotatime=-89.23334503173828, gamestate=4, team=3
2019-01-08 05:54:01,989 DEBUG    Received world_state: dotatime=-88.23336029052734, gamestate=4, team=2
2019-01-08 05:54:01,992 DEBUG    Received world_state: dotatime=-88.23336029052734, gamestate=4, team=3
2019-01-08 05:54:02,273 DEBUG    lua_config={'step': 60, 'dota_time': -87.966697692871}
2019-01-08 05:54:02,273 DEBUG    ::reset: lua config received={'step': 60, 'dota_time': -87.966697692871}
2019-01-08 05:54:12,282 DEBUG    Writing live_config={'calibration_dota_time': -88.23336029052734}
2019-01-08 05:54:12,288 DEBUG    DotaService::observe()
2019-01-08 05:54:12,921 DEBUG    Received world_state: dotatime=-87.2333755493164, gamestate=4, team=2
2019-01-08 05:54:13,927 DEBUG    DotaService::observe()
2019-01-08 05:54:24,936 DEBUG    DotaService::observe()
2019-01-08 05:54:35,949 DEBUG    DotaService::observe()
2019-01-08 05:54:46,961 DEBUG    DotaService::observe()
2019-01-08 05:54:57,972 DEBUG    DotaService::observe()
2019-01-08 05:55:08,985 DEBUG    DotaService::observe()
2019-01-08 05:55:19,996 DEBUG    DotaService::observe()
2019-01-08 05:55:31,008 DEBUG    DotaService::observe()
2019-01-08 05:55:42,021 DEBUG    DotaService::observe()
2019-01-08 05:55:53,030 DEBUG    DotaService::observe()
2019-01-08 05:56:04,034 DEBUG    DotaService::observe()
2019-01-08 05:56:15,047 DEBUG    DotaService::observe()
2019-01-08 05:56:26,057 DEBUG    DotaService::observe()
2019-01-08 05:56:37,068 DEBUG    DotaService::observe()
2019-01-08 05:56:48,080 DEBUG    DotaService::observe()
2019-01-08 05:56:59,093 DEBUG    DotaService::observe()

any suggestions?

stuck at this problem for nearly a week....can anyone give me some help?
really thanks!
@TimZaman @Nostrademous

I comment out

if ((step - worldstate_step_offset) % config.ticks_per_observation) == 0 then
-- print('(lua) Expecting state @ step=', step, 'dota_time=', dota_time)
-- TODO(tzaman): read the action file here, and check that it contains an
-- action with the right timestep.
action = get_new_action(dota_time, GetBot():GetPlayerID())
-- print('(lua) received action =', dump(action))
debug_text = pprint.pformat(action)
act_at_step = step + action.actionDelay -- TODO(tzaman) does this still work if not defined?
end
if step == act_at_step then
act(action)
act_at_step = nil
action = nil
end

then problem fixed..I can receive world state normally. it seems has some time-consuming thing or deadlock in these code..

Purely from memory - I would think ‘get_new_action’ is the issue as it expects a file to be written by the gRPC client that the bots read from the bots directory. Perhaps it doesn’t have a timeout. On phone so hard to check

Purely from memory - I would think ‘get_new_action’ is the issue as it expects a file to be written by the gRPC client that the bots read from the bots directory. Perhaps it doesn’t have a timeout. On phone so hard to check

yes, that may be a problem, my test client just use the observe rpc, so the lua is blocking at this function.

from grpclib.client import Channel
from dotaservice.protos.DotaService_grpc import DotaServiceStub
from dotaservice.protos.DotaService_pb2 import GameConfig
from dotaservice.protos.DotaService_pb2 import Actions
from dotaservice.protos.DotaService_pb2 import ObserveConfig, Status
from dotaservice.protos.DotaService_pb2 import TEAM_RADIANT, TEAM_DIRE
import asyncio
from dotaservice.protos.dota_gcmessages_common_bot_script_pb2 import CMsgBotWorldState
from dotaservice.protos.dota_shared_enums_pb2 import DOTA_GAMEMODE_1V1MID

import time

async def game_init():
    await env.reset(GameConfig(ticks_per_observation=10, host_mode=1))#, game_mode=DOTA_GAMEMODE_1V1MID))
    print("init finish")
    for i in range(1000):
        action_pb = CMsgBotWorldState.Action()
        action_pb.actionType = CMsgBotWorldState.Action.Type.Value('DOTA_UNIT_ORDER_NONE')
        actions_pb = CMsgBotWorldState.Actions(actions=[action_pb])
        execute_action = Actions(actions=actions_pb, team_id=TEAM_RADIANT)
        #await env.act(execute_action)

        response = await env.observe(ObserveConfig(team_id=TEAM_RADIANT))
        if response.status != Status.Value('OK'):
            print("response status %s"%str(response.status))
        obs = response.world_state
        dota_time = obs.dota_time
        print("cur time %s" %str(dota_time))

        time.sleep(1)


    print("finish")
    return

# Connect to the DotaService.
cur_loop = asyncio.get_event_loop()
env = DotaServiceStub(Channel('127.0.0.1', 13337, loop=cur_loop))

# Get the initial observation.
cur_loop.run_until_complete(game_init())

ok, thanks