Skip to content
This repository has been archived by the owner on Jul 26, 2022. It is now read-only.

Starcraft freezes on start #299

Open
ChobitsTheZero opened this issue Feb 28, 2019 · 20 comments
Open

Starcraft freezes on start #299

ChobitsTheZero opened this issue Feb 28, 2019 · 20 comments

Comments

@ChobitsTheZero
Copy link

Not sure if I followed the instructions incorrectly. I did the copy of common prerequisites and followed the AIModule part.

However when Starcraft launches it freezes as soon as it enters the game/match.

I may have done the common prerequisites incorrect since I was unsure about what the last two steps meant.

For "Copy $STARCRAFT/TorchCraft/BWEnv/bin/*.dll into $STARCRAFT/." I was unable to find any BWEnv map so I just went in to the bin map and copied the 1 dll file into the Starcraft map.

For "Copy $STARCRAFT/TorchCraft/maps/* into $STARCRAFT/Maps/BroodWar." I copied both the folders inside the maps folder into the Maps/BroodWar folder.

Did I make a mistake somewhere? Or is it supposed to freeze when it gets into the game?

@dgant
Copy link
Contributor

dgant commented Feb 28, 2019

Hello. A few questions to round down what might be happening:

  • At what point are you seeing it freeze? Is StarCraft getting to the game screen (where you can see units and terrain) and freezing then?
  • How frozen is it? Is your Vepsene Geyser animating? Can you access the game menus?
  • Does anything change if in BWAPI.ini you replace the path to BWEnv.dll with a non-existent file?

@ChobitsTheZero
Copy link
Author

Hello. A few questions to round down what might be happening:

  • At what point are you seeing it freeze? Is StarCraft getting to the game screen (where you can see units and terrain) and freezing then?
  • How frozen is it? Is your Vepsene Geyser animating? Can you access the game menus?
  • Does anything change if in BWAPI.ini you replace the path to BWEnv.dll with a non-existent file?
  • It freezes when it gets to the the game screen yes, all I can see is terrain, no units no nothing.
  • I am not able to access anything, the game goes into not responding and has to be forced shutdown.
  • I removed BWEnv.dll from "ai = ", when I now launch the game it instead just closes the game when it gets into the game screen.

@dgant
Copy link
Contributor

dgant commented Feb 28, 2019

To confirm: Are you using StarCraft version 1.16.1?

@ChobitsTheZero
Copy link
Author

To confirm: Are you using StarCraft version 1.16.1?

Yes, I was able to run Starcraft with bwapi before I did the Torchcraft changes.

@ChobitsTheZero
Copy link
Author

Am I supposed to change both

ai = BWEnv.dll
ai_dbg = BWEnv.dll

or just the "ai = BWEnv.dll" part? Since that's the only part I changed into "ai = "

@dgant
Copy link
Contributor

dgant commented Feb 28, 2019

Setting up the TorchCraft bot shouldn't impact how BWAPI functions in any way -- it should just be another bot that you inject with BWAPI. So another good diagnostic test would be verifying that you can still load other BWAPI 4.2.0 bots (like this one).

ai_dbg is only used when using the DEBUG version of the BWAPI plugin, which is for when you want to run your bot DLL through a debugger. If using the RELEASE BWAPI plugin, ai_dbg is ignored.
(Here, for example, is the RELEASE version enabled)
image

So you only need to think about the ai setting. If it's blank or points to nothing, the game should still start normally and you should see your units happily doing nothing. If that's not happening, there's an error in the BWAPI configuration.

@ChobitsTheZero
Copy link
Author

Setting up the TorchCraft bot shouldn't impact how BWAPI functions in any way -- it should just be another bot that you inject with BWAPI. So another good diagnostic test would be verifying that you can still load other BWAPI 4.2.0 bots (like this one).

ai_dbg is only used when using the DEBUG version of the BWAPI plugin, which is for when you want to run your bot DLL through a debugger. If using the RELEASE BWAPI plugin, ai_dbg is ignored.
(Here, for example, is the RELEASE version enabled)
image

So you only need to think about the ai setting. If it's blank or points to nothing, the game should still start normally and you should see your units happily doing nothing. If that's not happening, there's an error in the BWAPI configuration.

I will look into it, will start over and see if I can get it to work.

@ebetica
Copy link
Contributor

ebetica commented Feb 28, 2019

I think this happens most often when you set up the server correctly (BWEnv is the server) but did not run the client correctly (for example, from python). Running https://github.com/TorchCraft/TorchCraft/blob/master/examples/py/example.py for example should unfreeze the game.

@ChobitsTheZero
Copy link
Author

ChobitsTheZero commented Feb 28, 2019

I did some testing and replaced the BWEnv.dll with the old dll I had.

Now for some reason it works and dosn't freeze or crash. It runs some marine micro scenario I believe. Although the dll that its loading dosn't have anything to do with marine micro.

So in conclusion it only freezes when im using the BWEnv.dll

@ChobitsTheZero
Copy link
Author

I think this happens most often when you set up the server correctly (BWEnv is the server) but did not run the client correctly (for example, from python). Running https://github.com/TorchCraft/TorchCraft/blob/master/examples/py/example.py for example should unfreeze the game.

I haven't actually gotten to the part "Developing the TorchCraft Server:" yet. Was doing the "TorchCraft AIModule (DLL) for users:" and since the last * said " Click Start." I assumed it would be possible to run without freezing. So im assuming that the "Developing the TorchCraft Server" step needs to be completed before the game can be started?

@dgant
Copy link
Contributor

dgant commented Feb 28, 2019

Ah, yes. The bot module (BWEnv) is waiting for a TorchCraft server to connect, and will wait until it does, which freezes StarCraft. If you experience the freezing only when using BWEnv.dll (and not other bots), and when not using a TorchCraft server, that indicates everything is working correctly.

@ChobitsTheZero
Copy link
Author

Ah, yes. The bot module (BWEnv) is waiting for a TorchCraft server to connect, and will wait until it does, which freezes StarCraft. If you experience the freezing only when using BWEnv.dll (and not other bots), and when not using a TorchCraft server, that indicates everything is working correctly.

Ah I see, makes sense then. The steps in the setup are a bit confusing then since the "TorchCraft AIModule (DLL) for users:" says "Click Start" which made me assume the game would run without problems.

@dgant
Copy link
Contributor

dgant commented Feb 28, 2019

That's a good point. I've opened #300 to make the documentation clearer on that point. Thank you for the feedback!

@ChobitsTheZero
Copy link
Author

ChobitsTheZero commented Mar 2, 2019

Have followed the steps in "Developing the TorchCraft Server:". However, the game is still freezing.

Unsure if I have done something incorrectly, im assuming that after I have recieved the BWEnv.dll file I am supposed to put it in the Starcraft folder. Even after doing that the game still freezes, am I missing something that I am supposed to do? I am assuming I am not supposed to do the step "Installing the Torch client (Linux)" since I am not on Linux.

Is it possible that the issue is that BWAPI is located inside a seperate folder and not inside the actual Starcraft folder? Or possibly that I am required to install the Torch client?

@ebetica
Copy link
Contributor

ebetica commented Mar 2, 2019

You are suppose to run the client. Try running https://github.com/TorchCraft/TorchCraft/blob/master/examples/py/example.py after you get to the freeze. If you do it correctly, your starting workers will execute attack-closest (meaning they won't move until an enemy is in vision)

@ebetica
Copy link
Contributor

ebetica commented Mar 2, 2019

I feel like you can install it on Windows, but we recommend using a Linux VM.

@ChobitsTheZero
Copy link
Author

You are suppose to run the client. Try running https://github.com/TorchCraft/TorchCraft/blob/master/examples/py/example.py after you get to the freeze. If you do it correctly, your starting workers will execute attack-closest (meaning they won't move until an enemy is in vision)

Im assuming this requires installing Pytorch?

@ebetica
Copy link
Contributor

ebetica commented Mar 2, 2019

No it doesn't actually. It's a bit of a misnomer now, we've actually removed all torch dependencies.

@ChobitsTheZero
Copy link
Author

No it doesn't actually. It's a bit of a misnomer now, we've actually removed all torch dependencies.

I'm actually trying to run the lua example. Using a community windows build of torch https://github.com/hiili/WindowsTorch

Having some issues setting up the server though.

@ChobitsTheZero
Copy link
Author

I feel like you can install it on Windows, but we recommend using a Linux VM.

I would like to avoid Linux VM if possible. Kinda struggling to get the lua and python examples to work at the moment.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants