Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ubuntu, can not reset environment with steam turning on. #5

Open
gomiss opened this issue Dec 10, 2018 · 7 comments
Open

Ubuntu, can not reset environment with steam turning on. #5

gomiss opened this issue Dec 10, 2018 · 7 comments

Comments

@gomiss
Copy link

gomiss commented Dec 10, 2018

Hi, thanks for your reading first.

Environment

Ubuntu 18.04.1.
The newest steam, Dota2 client and code up to date (10/12/2018).

Problem

  1. Turn on steam.
  2. Start server, python3 -m dotaservice
  3. Run test code. This just do the init jobs (import lib, define variables ...) and calling state = await asyncio.wait_for(env.reset(config))

When i do as 1 2 3 (whether with and without rendering), the server will blocked at

(py) worldstate @ dotatime=-89.23334503173828, gamestate=4

The last few logs are showing below:

(py) worldstate @ dotatime=-12.10013198852539, gamestate=8
Act::
Observe:: cout
Observe:: cerr
(py) worldstate @ dotatime=-12.10013198852539, gamestate=8
Act::
S:Gamerules: entering state 'DOTA_GAMERULES_STATE_WAIT_FOR_MAP_TO_LOAD'
S:Gamerules: entering state 'DOTA_GAMERULES_STATE_PRE_GAME'
m_flPreGameStartTime set to 31.13
m_flStateTransitionTime set to 121.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.
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.
Observe:: cout
Observe:: cerr
(py) worldstate @ dotatime=-89.23334503173828, gamestate=4

But when i do as 2 3 4, without turn on steam client, it can work correctly. Some logs are:

(py) worldstate @ dotatime=-12.10013198852539, gamestate=8
Act::
Observe:: cout
Observe:: cerr
(py) worldstate @ dotatime=-12.10013198852539, gamestate=8
Act::
S:Gamerules: entering state 'DOTA_GAMERULES_STATE_WAIT_FOR_MAP_TO_LOAD'
S:Gamerules: entering state 'DOTA_GAMERULES_STATE_PRE_GAME'
m_flPreGameStartTime set to 31.13
m_flStateTransitionTime set to 121.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.
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.
Observe:: cout
Observe:: cerr
(py) worldstate @ dotatime=-89.23334503173828, gamestate=4
(py) lua_config =  {'step': 30, 'dota_time': -88.966682434082}
(py) lua config received= {'step': 30, 'dota_time': -88.966682434082}
(py) writing live config= {'calibration_dota_time': -89.23334503173828}
DotaService::step()

I compared the two logs, it seems without steam running, it can not load steam API. Can this be one reason of the block?
I doesn't know much about Steam and Dota2 APIs, and doesn't know how to debug this error.
Thanks for your helping!

@TimZaman
Copy link
Owner

TimZaman commented Dec 10, 2018

Thanks for you report, I'll look into it. Some observations:

  • You can only run 1 instance of dota at the same time
  • In order to render the dota GUI, you need to have steam on (so it can find the steam DLL)
  • Running Dota dedicated (without rendering) without having steam on will result into warnings that can be ignored, it doesn't actually use.

That doesn't help your issue though does it? You also list "Observe:: cout (..) Observe:: cerr" what are those?

@gomiss
Copy link
Author

gomiss commented Dec 11, 2018

Thanks for you report, I'll look into it. Some observations:

  • You can only run 1 instance of dota at the same time
  • In order to render the dota GUI, you need to have steam on (so it can find the steam DLL)
  • Running Dota dedicated (without rendering) without having steam on will result into warnings that can be ignored, it doesn't actually use.

That doesn't help your issue though does it? You also list "Observe:: cout (..) Observe:: cerr" what are those?

  1. Yes, i only run one instance.
  2. When the steam is on, it will load stem DLL. I think the problem may caused by this. E.g. New steam DLL doesn't match cause DOTA_GAMERULES_STATE_PRE_GAME failed?
  3. Without steam on, i can get the world state successfully.
  4. I think the "Observe:: cout (..) Observe:: cerr" is come from the Observe function in dotaservice/botcpp_dire.cpp. I compile this file and copy the .so to dota/scripts/vscripts/bots/ to load when init bots.

By the way, the logs with steam on print a lot of "FS: Tried to Write NULL file handle!", which i think is just warning and should not influence other jobs. Doesn't check.

I guess the block may caused by loaded steam DLL. Since this is one difference between the logs of with and without steam on that i found. I didn't find other difference until now.

@TimZaman
Copy link
Owner

TimZaman commented Dec 11, 2018

Interesting. How did you compile the botcpp_dire.so? Command and compiler v?

@gomiss
Copy link
Author

gomiss commented Dec 11, 2018

Interesting. How did you compile the botcpp_dire.so?

Use this command g++ -shared -o botcpp_dire.so -fPIC botcpp_radiant.cpp. Same as shown in dotaservice/botcpp/README.md

@TimZaman
Copy link
Owner

TimZaman commented Dec 11, 2018

That cannot be the right command. You're missing includes.. Anyway I think I figured that part out.

@gomiss
Copy link
Author

gomiss commented Dec 11, 2018

That cannot be the right command. You're missing includes.. Anyway I think I figured that part out.

I am not quite understand what to includes? Do you mean protobuf? I already exported it. It did not show any warning or error during compiling.
Besides, these .so can work when steam is off. Maybe the bot .so is not the problem?

@TimZaman
Copy link
Owner

I can confirm steam only needs to be turned on (or even installed!) when you want the graphical interface. It runs fine on a docker container without steam..

@Nostrademous Nostrademous mentioned this issue Jan 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants