Giter Site home page Giter Site logo

torchcraft / torchcraft Goto Github PK

View Code? Open in Web Editor NEW
1.4K 93.0 206.0 8.14 MB

Connecting Torch to StarCraft

License: Other

AutoHotkey 0.07% Shell 0.23% Batchfile 0.02% C++ 91.80% CMake 0.50% Lua 3.24% C 3.17% Python 0.34% Dockerfile 0.62%
starcraft torchcraft bwapi torch reinforcement-learning deep-learning machine-learning

torchcraft's Introduction

TorchCraft

A bridge between Torch and StarCraft.

A general overview of the system (and motivations for using TorchCraft) can be found in:

Synnaeve, G., Nardelli, N., Auvolat, A., Chintala, S., Lacroix, T., Lin, Z., Richoux, F. and Usunier, N., 2016. TorchCraft: a Library for Machine Learning Research on Real-Time Strategy Games - arXiv:1611.00625.

Please follow the installation instructions.

You will need to have a license of StarCraft: Brood War.

TorchCraft is a BWAPI module that sends StarCraft data out over a ZMQ connection. This lets you parse StarCraft data and interact with BWAPI from anywhere. The TorchCraft client should be installed from C++, Python, or Lua. We provide off the shelf solutions for Python and Lua:

Requirements:

  • zstd-devel 1.1.4
  • zeromq 4+

Remember to init submodules: git submodule update --init --recursive
Python setup: pip install pybind11 && pip install .
Lua setup (depends on torch7): luarocks make *.rockspec

We provide an example C++ CMake project in examples/cpp/

The hardest part of installing the server is actually setting up starcraft. We detail three ways of doing this:

Running TorchCraft

See examples/ for a list of scripts that you can try. In all cases, the $server_ip is the ip address of the machine running StarCraft.

StarCraft Server

Do whichever was installed:

Windows / WINE

  1. Open bwapi.ini and set ai = PATH\TO\BWEnv.dll (or copy ours from config/bwapi.in)
  2. Start ChaosLauncher, enable BWAPI DLL Injector [Release].
  3. Press Start.

WINE

  1. Open bwapi.ini and set ai = PATH\TO\BWEnv.dll (or copy
  2. wine bwheadless.exe -e $STARCRAFT/StarCraft.exe -l $STARCRAFT/bwapi-data/BWAPI.dll --headful as detailed in the WINE docs

OpenBW

Something like: OPENBW_ENABLE_UI=0 BWAPI_CONFIG_AI__RACE=Terran BWAPI_CONFIG_AI__AI="BWEnv/build/BWEnv.so" BWAPI_CONFIG_AUTO_MENU__AUTO_MENU="SINGLE_PLAYER" BWAPI_CONFIG_AUTO_MENU__MAP=maps/micro/m5v5_c_far.scm BWAPI_CONFIG_AUTO_MENU__GAME_TYPE="USE MAP SETTINGS" TORCHCRAFT_PORT=11111 BWAPILauncher

TorchCraft Client

$ cd examples
$ th lua/simple_dll.lua -t $server_ip
$ python py/example.py -t $server_ip

Other Documentation

Citation

Please cite the arXiv paper if you use TorchCraft in your work:

@article{synnaeve2016torchcraft,
  title={TorchCraft: a Library for Machine Learning Research on Real-Time Strategy Games},
  author={Synnaeve, Gabriel and Nardelli, Nantas and Auvolat, Alex and Chintala, Soumith and Lacroix, Timoth{\'e}e and Lin, Zeming and Richoux, Florian and Usunier, Nicolas},
  journal={arXiv preprint arXiv:1611.00625},
  year={2016}
}

Contributing

See Contributing

Also check out the code structure and PR process

torchcraft's People

Contributors

dgant avatar ebetica avatar edran avatar enguyen-ca avatar facebook-github-bot avatar jgehring avatar liboyue avatar meriipu avatar spencerduncan avatar syhw avatar tscmoo avatar vkhalidov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

torchcraft's Issues

Cannot find 'BWAPI.obj'

I try to compile BWEnv but there is an error: error LNK1104: cannot open “F:\StarCraft\BWAPI.obj”.
What should I do to fix it? Thank you.

BWAPI on Linux Problem_Running AIModule

I read recent tutorial about TorchCraft and follow tutorial "BWAPI in Linux",
but when I try to implement
"wine bwheadless.exe -e $STARCRAFT/StarCraft.exe -l $STARCRAFT/bwapi-data/BWAPI.dll --headful",
which is used for connecting BWAPI and Starcraft, it freeze like below figures.

Can someone help me?

2016-12-26 20-32-50

2016-12-26 20-33-00

wine --version : wine-1.6.2 (I set WINEARCH=win32 WINEPREFIX=~/.wine wine wineboot)
Ubuntu --version : 16.04
Starcraft --version : 1.16.1
BWAPI --version : 4.1.2


I tried other command,
wine /desktop=foo, 800x600 bwheadless.exe -e $STARCRAFT/StarCraft.exe -l bwapi-data/BWAPI.dll --headful

wine explorer /desktop=foo, 800x600 bwheadless.exe -e $STARCRAFT/StarCraft.exe -l bwapi-data/BWAPI.dll --headful
but they don't work like below figures

2016-12-27 12-48-32

2016-12-27 12-50-36

Static Map Data for Pathfinding

If someone wants to make an agent for path finding, or to actually play a full game, they'll need the map elevation and pathing data. Anyone who's tried to make Dragoons walk down a ramp knows that dealing with Brood War unit pathing can a complex task. There are a few BWAPI functions that can be used to get the necessary data:

  • int getGroundHeight(int tileX, int tileY) const
    -Returns an integer corresponding to the elevation at the queried tile (32x32)
  • bool isWalkable(int walkX, int walkY) const
    -Returns true if the corresponding walk tile (8x8) is walkable. Does not account for any structures or units on the tile.
  • Unitset& getStaticNeutralUnits() const
    -Returns a list of all Neutral Units (critters, minerals, geysers, neutral structures) available at the beginning of the game. Similar functions exist for just minerals and just geysers.

None of these functions require vision or for the map hack to be enabled. BWAPI considers pre-game knowledge of the map layout to be reasonable as most players would study a given prior to playing on it.

My thought is that these functions could be called once at the beginning of the game to get the necessary data from the C++ side to the Torch side to be used as necessary. If the extra processing time at the beginning of the game is an issue for repeated trials these values could be saved to disk and retrieved using mapHash() to identify the map. It could also be setup such that this function is skipped on micro_games.

While the above functions should be sufficient for pathfinding purposes, this would also be a good point to include isBuildable() as well, as someone will want that eventually.

BWAPI does not seem to include any methods for identifying ramps, however a learning agent should be able to infer there existence from the correlations between getGroundHeight and isWalkable data.

After writing all that I see that mapToTensor already exists, and is already sending data to lua, which doesn't get used anywhere. I'm going to keep all the stuff I wrote above in case someone wants to repurpose it for documentation.

Right now it only has getGroundHeight, isWalkable and a comment for isBuildable. The data for this appears to be stored as a 2D ByteTensor with values corresponding to getGroundHeight, unless the mini-tile is non walkable, in which case the value is set to -1 (technically 255 because ByteTensor is unsigned). Since this is only called once in setupHandshake, it would be good to send all usable initial map data ( getGroundHeight, isWalkable, isBuildable, getStaticNeutralUnits, getStartLocations) in this function. I also think that separating getGroundHeight and isWalkable could be beneficial, as there are a few cases where combining them doesn't give the whole picture. For example, where there's a 1 tile large non-walkable elevation where someone could hide an Overlord that's invisible from low ground vs a one tile large non-walkable water doodad.

The simplest way to implement this would be as a 3D (X,Y,5) ByteTensor where each of the 5 values in the third dim hold the different attributes. The issue is that this would generate a up to a 5MB ((255 tiles x 4 walk tiles)^2*5) tensor, most of which is created because of the resolution of isWalkable. getStartLocations in particular would be very sparse, and is perhaps better suited to be a separate variable. Perhaps this is a non-issue. This is only written once per game and can be processed afterwards to suit whatever computation needs to be preformed. Other solutions would include hashing the different combinations into a 2D ByteTensor, separating the fields into different Tensors such that isWalkable has an 8 pixel resolution, getGroundHeight and isBuildable have 32 pixel resolution, and that getStaticNeutralUnits and getStartLocations are lists, or some combination of the two. Some sort of autoencoder may also be applicable, but I don't know if the actual machine learning bits are within this scope of this project.

To go with those changes, some kind of accessor functions should probably written on the lua side since map_data would no longer be a simple tensor. Some sort of layer function similar to the ones that currently exist for visibility and unit stats would probably be useful as well.

I'm willing to work on any of this, but I thought I would actually submit an issue for discussion first instead of jumping straight to a pull request again.

custom_launcher unused

custom_launcher seems to be unused, but torchcraft.ini indicates nothing of the sort.

What does the --headful bwheadless parameter do?
It seems to be appended to the launch command when setting launcher to bwheadless in torchcraft.ini, and to me --headful seems to not run in headless after all.

StarCraft latest free version installation issue on different VMware platform

I am installing StarCraft in different VMware platforms, unfortunately all failed.

On Ubuntu 16.04, I tried to install StarCraft on Win 7, Win 8.1 and Win10 in VMware workstation.

On OSX(10.12.5), I also tried to install StarCraft on Win 7, Win 8.1 and Win10 in VMware fusion.

All attempts end in error:

After installed StarCraft, and lauched it. The error pops out:

Unable to initialize OpenGL. Please verify that your video card drivers are up to date. The pic is below:
wechatimg1

However in Gabriel Synnaeve's talk, it seems all works OK between host and virtual machine.

Thanks for any help.

Morphing/Building Structures

I've noticed that buildings which are under construction or morphing (e.g. Hatchery->Lair) to not appear in feature layers. This issue can be most easily seen by running visual_example.lua on a Melee map and either morphing a Lair and watching the HP layers, or by building a Refinery on a gas geyser and watching the Gas layer.

TorchCraft Client doesn't compile in Visual C++

Background
The TorchCraft Client was designed to run in linux.
https://github.com/TorchCraft/TorchCraft/blob/master/examples/cpp/simple_dll.cpp is an example of a client implementation in pure c++.

Problem
All versions of Visual Studio have a max of 127 macro arguments. The C++ standard says that compilers should support 256 parameters for functions. TorchCraft's use of Better Enums has 258 parameters.

Trying to build enum_macros.h throws this msvc error:
torchcraft\include\enum_macros.h(553): fatal error C1112: compiler limit: '258' too many macro arguments, only '127' allowed

Minimum code to reproduce:

#include "TorchCraft\include\client.h"

Googling for workarounds for msvc turned up this answer.

No. There is no way around the internal compiler limit.
The only thing you can do is to split your macro into 2 macros.

Proposal
Identify where Better Enums is used throughout the code, and figure out if it can be replaced, for example with constexpr.

get_weapon() in init.lua assumes that unit contains weapon types.

In https://github.com/TorchCraft/TorchCraft/blob/master/lua/init.lua#L230, it is assumed that the unit contains awtype and gwtype fields. These fields seem to have been replaced with damage types, i.e. awdmgtype and gwdmgtype. While the remaining code correctly treats these as "damage type" (in contrast to its name, weapontype), the non-existent fields will produce wrong results when passed to dmg_multiplier(). This can lead to wrong results for compute_dmg() and apply_attack().

python client

this issue will invariably be opened by someone within the next few 10s of hours, so might as well open it and give folks some pointers.

To have a working and minimal python client (that does baseline_heuristics), you need to do three main things:

  1. transpile init.lua to init.py: https://github.com/TorchCraft/TorchCraft/blob/master/init.lua . The work is mostly mechanical / codemod, and most of the static constants are planned to eventually move to C++ anyways.
  2. Add python / cython bindings for replayer.frameFromString, which ends up being this set of code:
    1. *f = new Frame();
      std::istringstream is(str);
      is >> (**f);
    2. https://github.com/TorchCraft/TorchCraft/blob/master/replayer/frame.cpp#L116
  3. Add conditional compilation to the lua bits of replayer controlled by an #ifdef. Actually, one has to verify, but you might just get away with only compiling frame.cpp and nothing else for frameFromString functionality.

That should be sufficient to get one going.

Looking forward to the PRs:

cc: @sherjilozair who asked about it

Setting up TorchCraft both client and server at same local

I setting up all the TorchCraft setting on local, but another problem occur.

When I try to run simple_dll.lua in examples, game ended immediately like below fig 4,5)

Can someone help to know cause?

a2
fig.1) Check Map is correct - m5v5_c_far.scm is implemented well without TorchCraft

a1
fig.2) All the bwapi-data and $STARCRAFT setting is already set correctly following BWAPI ON LINUX tutorial

a5
fig.3) Check BWAPI work fine through running Iron.dll bot

a3

a4
fig.4, 5) But when I try to run simple_dll.lua, game ended immediately

Specification)
wine --version : wine-1.6.2 -> wine-1.8 (I tried both version, but same error)
Ubuntu --version : 16.04
Starcraft --version : 1.16.1
BWAPI --version : 4.1.2

Improve release packaging

  • Add to the zip release the configuration files under ./config
  • Add the maps under ./maps

Update the instructions in the website

deepmind lab with unity3d and torch

anybody interested in deepmind lab, but the engine would be unity3d instead of quake3, and the RL part would be torch instead of deepmind?

Pass error messages back from BWAPI to TorchCraft

Currently, the only way to knowing if a command failed is to analyze the logs. I propose we add error messages in a new field to the TC reply, so that we can programmatically determine if a command failed.

launcher=bwheadless does not work as expected

From what I have understood, setting the launcher to bwheadless in torchcraft.ini results in the launch of this command:

bwheadless.exe --headful -e StarCraft.exe -l bwapi-data/BWAPI.dll

The first problem I have with this is the --headful parameter, which is hardcoded and seems to launch bwheadless in not headless mode.

The second problem might be me misunderstanding, but without the -h parameter (along with a -m mappath), bwheadless tries to join a game rather than host it. This means I have to run a second bwheadless instance to host the game as far as I understand.

Much of this would be solved if custom_launcher actually launched the command #68 (and the documentation more explanatory)

I have been trying to solve it myself by patching but I can not get torchcraft to build.

game mapping table not found

When I launch the exe and run the sample code in client, the server machine keeps outputing mapping table not found in cmd. I use windows 7 in virtual machine on my mac, how to solve that?

Missing dependencies for torchcraft

on ubuntu-16.04,

after installing torch, th can successfully run, then, do the following:

$ git clone [email protected]:torchcraft/torchcraft.git --recursive`
$ cd torchcraft
$ luarocks make torchcraft-1.0-0.rockspec

Missing dependencies for torchcraft:
tds
torch >= 7.0

what's wrong?
thanks

BWenv can't kill StarCraft.exe in wine

Utils::killStarCraft() is meant to kill StarCraft process(es), however in wine the /T flag for taskkill is not supported.

Moreover, when removing the flag, taskkill fails with:

Error: Could not find process "StarCraft.exe".

(I've uploaded a patched BWEnv.exe on top of develop here)

This probably means that we have to make a custom solution for Wine 😢

Git clone error when install the Torch client (Linux)

I follow this document to install Torch client on Ubuntu 14.04.5 LTS

when I install TorchCraft by typing:
git clone [email protected]:torchcraft/torchcraft.git --recursive

It cause error:

Warning: Permanently added the RSA host key for IP address '192.30.253.112' to the list of known hosts.
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

How should I fix it? Could I just use git clone https://github.com/TorchCraft/TorchCraft.git --recursive as a substitite?

How can I disable the gui?

Hellow, I wanna know how to disable the gui of starcraft when i train a model with torchcraft, because I think it cost too much time using the gui to render. I only find in setup [tcc.set_gui, 1], but I don't know what to do in the server sdie(starcrat),. Should I do something with BWAPI or other things?

czmq.h Can't be found in vs2013

Though I have already set up bwapi_dir and some others, I met some problem that vs2013 can not found out the head file czmq.h, and czmq directory is empty. How can I do to fix it? Please help:(

In addition, It is on Windows 10.

Launch Several Servers( SC games ) on Windows.

I want to sample the data using multiple threads to accelerate the data sampling.

What can I do to achieve launching several games simultaneously ?

If I simply open several games and use several clients to send commands in the same time, only one game will respond.

Load BWEnv.dll error

Environment:
Starcraft Brood War 1.16.1, TorchCraft Server (BWEnv.dll): Windows7
TorchCraft Client (simple_dll.lua): Ubuntu 14.04.5 LTS
BWAPI 4.2.0

Problem
When I config ai = BWEnv.dll in bwapi.ini and launch Chaoslauncher, the SC:BW always crashed, a stop at initial game state like:

When I remove BWEnv.dll as: ai = NULL, BWAPI will work appropriately.
I think this problem may caused by using wrong BWAPI.dll which is not suitable for TorchCraft
Could you offer the instructions to build BWAPI.dll?

Thank you.

Installation issue on latest version

I am installing TorchCraft in Ubuntu. However, I think currently it does not work due to the latest version. I think the all versions of dependencies are wrong following by StarCraft version 1.18.

Here is my details of environment and dependencies and installation processes:

OS: Ubuntu 16.04
Wine: wine2.9 (Staging)

  • When I installed Starcraft via original Wine, the different version of Starcraft has caused error (plus free version, no requiring license key anymore).
  • So I installed winehq-staging instead and checked out Starcraft could run properly!

(Then installed winetricks -q vcrun2013)

BWAPI: 4.2.0

  • Previous version BWAPI_412 got crashes with wine. So I searched the latest version of it and installed.

(Then I successfully installed TorchCraft with quick_setup.sh)

Then I ran common prerequisites.

Copy $STARCRAFT/TorchCraft/config/bwapi.ini in $STARCRAFT/bwapi-data/bwapi.ini.
Copy $STARCRAFT/TorchCraft/config/torchcraft.ini in $STARCRAFT/bwapi-data/torchcraft.ini.
Copy $STARCRAFT/TorchCraft/BWEnv/bin/.dll into $STARCRAFT/.
Copy $STARCRAFT/TorchCraft/maps/
into $STARCRAFT/Maps/BroodWar.

While following BWAPI on Linux, I got another error in running AIModule.
wine bwheadless.exe -e $STARCRAFT/StarCraft.exe -l $STARCRAFT/bwapi-data/BWAPI.dll --headful and "Game Initialization Failed!" message box came out.

Python client crashes after launching

Bwapi log:

//////////////////////////////////////////////////
TIME: Mon Apr 17 17:32:10 2017

VERSION: 1.16.1.1
BWAPI:
REVISION: 4708
BUILD: RELEASE
ERROR: None
LOCATION: Single Player
MAP: 4_dragoons_2_ultralisks
3mar1zeal.scm

EXCEPTION: 0xC0000005 EXCEPTION_ACCESS_VIOLATION
FAULT: 0x69F74F78 czmq.dll
REGISTERS:
EDI: 0494E048
ESI: 00000000
EBX: 00000000
EDX: 00000000
ECX: 00000000
EAX: 00000000
EBP: 0019F928
EIP: 69F74F78
ESP: 0019F928
STACK:
czmq.dll 0x69F74F78 zsock_is
czmq.dll 0x69F755D0 zsock_resolve
czmq.dll 0x69F719E6 zmsg_send
czmq.dll 0x69F7643E zsock_vsend
czmq.dll 0x69F75642 zsock_send
BWEnv.dll 0x68FB6713 newAIModule
BWEnv.dll 0x68FA32F0 ----
BWEnv.dll 0x68FA8A48 newAIModule
BWAPI.dll 0x1003471E ----
BWAPI.dll 0x1003496A ----
BWAPI.dll 0x10041BC9 ----
BWAPI.dll 0x100345E7 ----

Compressed replays sometimes cannot be read correctly

This doesn't happen very often, but sometimes I cannot read a compressed replay when I can read the uncompressed version. An example can be downloaded here: https://www.dropbox.com/s/1bkntbkpm1zolnf/bwrep_7p5q6.rep?dl=0

Simply compress it with zstd zstd -e5 bwrep_7p5q6.rep -o bwrep_7p5q6.tcr

In Python, I can do:

from torchcraft import replayer
rep = replayer.load("bwrep_7p5q6.rep")
bad = replayer.load("bwrep_7p5q6.tcr")

Same thing happens in lua. @jgehring if you have any idea why this happens let me know.

Install script fails on Mac

In this file, https://github.com/TorchCraft/TorchCraft/blob/master/docs/user/bwapi_on_linux.md, clone command should be git clone https://github.com/TorchCraft/TorchCraft.git

TorchCraft/quick_setup.sh fails on Mac.
Line 5, readlink -f does not work on Mac
Line 20, maybe it is cp -R?
Line 22, sed -i "s|^ai *=.*|ai=$SC_DIR/BWEnv.dll|" bwapi-data/bwapi.ini should be sed -i '' "s|^ai *=.*|ai=$SC_DIR/BWEnv.dll|" bwapi-data/bwapi.ini

And I can't run AIModule... Could you please take a look? Thanks :)

Replay loading should error better when fails

I'm unsure whether this is only with ZSTD or not, but currently it'll complain that torch tried to allocate too much RAM, since it'll read a bad file width / height and try to allocation a couple terrabytes of RAM. Instead, throw some kind of better error so we can catch it.

setting up TorchCraft

While setting up according to installation instructions, after launcing instance in ChaosLuncher I came across following error:

selection_179

(it says that it couldn't find SleepConditionVariableCS in KERNEL32.dll)

I run windows XP in virtualbox.

After there is a battle between few marines, and an error message about not being able to find BWEnv.dll, although it is located in C:\Starcraft

selection_183

Linux, OpenBW; BWEnv.so (ZMQ) fails an assertion on game restart

With OpenBW, one game runs fine, but when BWAPI unloads the old module and loads it again for the new game, it goes:

BWAPILauncher: src/zsys.c:178: zsys_init: Assertion `!s_process_ctx' failed.
Aborted (core dumped)

I've verified that destructors run and zsys_shutdown is called when it unloads, but need more debugging.
I don't think it's a openbw or bwapi bug since other bots seem to restart with no issues.

Fail to compile BWEnv.dll

Sorry to bother you. I used both VS2013 and VS2017 to compile BWEnv.dll, but they all had thousands lines of errors :(

For VS2017:

1>------ Build started: Project: BWEnv, Configuration: Release Win32 ------
1>main.cc
1>frame.cpp
1>controller.cc
1>dll.cc
1>module.cc
1>recorder.cc
1>user_actions.cc
1>utils.cc
1>F:\StarCraft\BWAPI\include\BWAPI/Type.h(66): error C2208: 'int': no members defined using this type (compiling source file ..\src\module.cc)
1>F:\StarCraft\BWAPI\include\BWAPI/Type.h(162): note: see reference to class template instantiation 'BWAPI::Type<T,UnknownId>' being compiled (compiling source file ..\src\module.cc)
1>F:\StarCraft\BWAPI\include\BWAPI/Type.h(66): error C2208: 'int': no members defined using this type (compiling source file ..\src\controller.cc)
1>F:\StarCraft\BWAPI\include\BWAPI/Type.h(162): note: see reference to class template instantiation 'BWAPI::Type<T,UnknownId>' being compiled (compiling source file ..\src\controller.cc)
1>F:\StarCraft\BWAPI\include\BWAPI/Type.h(66): error C2208: 'int': no members defined using this type (compiling source file F:\TorchCraft\BWEnv\VisualStudio\\..\src\main.cc)
1>F:\StarCraft\BWAPI\include\BWAPI/Type.h(162): note: see reference to class template instantiation 'BWAPI::Type<T,UnknownId>' being compiled (compiling source file F:\TorchCraft\BWEnv\VisualStudio\\..\src\main.cc)
1>F:\StarCraft\BWAPI\include\BWAPI/Type.h(66): error C2208: 'int': no members defined using this type (compiling source file ..\src\dll.cc)
1>F:\StarCraft\BWAPI\include\BWAPI/Type.h(162): note: see reference to class template instantiation 'BWAPI::Type<T,UnknownId>' being compiled (compiling source file ..\src\dll.cc)
1>F:\StarCraft\BWAPI\include\BWAPI/Type.h(66): warning C4091: 'explicit constexpr ': ignored on left of 'int' when no variable is declared (compiling source file ..\src\module.cc)
1>F:\StarCraft\BWAPI\include\BWAPI/Type.h(66): warning C4091: 'explicit constexpr ': ignored on left of 'int' when no variable is declared (compiling source file ..\src\controller.cc)
1>F:\StarCraft\BWAPI\include\BWAPI/Type.h(66): warning C4091: 'explicit constexpr ': ignored on left of 'int' when no variable is declared (compiling source file F:\TorchCraft\BWEnv\VisualStudio\\..\src\main.cc)
1>F:\StarCraft\BWAPI\include\BWAPI/Type.h(66): warning C4091: 'explicit constexpr ': ignored on left of 'int' when no variable is declared (compiling source file ..\src\dll.cc)
1>F:\StarCraft\BWAPI\include\BWAPI/UnitType.h(277): error C3615: constexpr function 'BWAPI::UnitType::UnitType' cannot result in a constant expression (compiling source file ..\src\module.cc)
1>F:\StarCraft\BWAPI\include\BWAPI/UnitType.h(277): note: failure was caused by call of undefined function or one not declared 'constexpr' (compiling source file ..\src\module.cc)
1>F:\StarCraft\BWAPI\include\BWAPI/UnitType.h(277): note: see usage of 'BWAPI::Type<BWAPI::UnitType,233>::Type' (compiling source file ..\src\module.cc)
.......
1>F:\StarCraft\BWAPI\include\BWAPI/UnitType.h(274): note: type 'BWAPI::UnitType' is not a literal type because its direct base class 'Type<BWAPI::UnitType,233>' is not a literal type (compiling source file ..\src\zmq_server.cc)
1>F:\StarCraft\BWAPI\include\BWAPI/UnitType.h(273): note: type 'BWAPI::Type<BWAPI::UnitType,233>' is not a literal type because it is not an aggregate type, a closure type, or does not have a constexpr constructor that is not a copy or move constructor (compiling source file ..\src\zmq_server.cc)
1>F:\StarCraft\BWAPI\include\BWAPI/UnitType.h(1120): error C2127: 'BWAPI::UnitTypes::Protoss_Templar_Archives': illegal initialization of 'constexpr' entity with a non-constant expression (compiling source file ..\src\zmq_server.cc)
1>F:\StarCraft\BWAPI\include\BWAPI/UnitType.h(1120): fatal error C1003: error count exceeds 100; stopping compilation (compiling source file ..\src\zmq_server.cc)
1>Done building project "BWEnv.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

And for VS2013:

1>------ Build started: Project: BWEnv, Configuration: Release Win32 ------
1>  main.cc
1>  frame.cpp
1>  config_manager.cc
1>  controller.cc
1>  dll.cc
1>  module.cc
1>  recorder.cc
1>  user_actions.cc
1>F:\StarCraft\BWAPI\include\BWAPI/Type.h(66): error C2071: “BWAPI::Type<T,UnknownId>::constexpr”:  illegal storage class (..\src\dll.cc)
1>          F:\StarCraft\BWAPI\include\BWAPI/Type.h(162): note: see reference to class template instantiation 'BWAPI::Type<T,UnknownId>' being compiled
1>F:\StarCraft\BWAPI\include\BWAPI/Type.h(66): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int (..\src\dll.cc)
1>F:\StarCraft\BWAPI\include\BWAPI/Type.h(77): error C2143: error C2143: syntax error : missing ';' before 'type' (..\src\dll.cc)
1>F:\StarCraft\BWAPI\include\BWAPI/Type.h(77): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int (..\src\dll.cc)
1>F:\StarCraft\BWAPI\include\BWAPI/Type.h(82): error C2144:  error C2144: syntax error : “int”should be preceded by ';' (..\src\dll.cc)
1>F:\StarCraft\BWAPI\include\BWAPI/Type.h(82): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int (..\src\dll.cc)
1>F:\StarCraft\BWAPI\include\BWAPI/Type.h(90): error C2144: error C2144: syntax error : “bool” should be preceded by ';' (..\src\dll.cc)
1>F:\StarCraft\BWAPI\include\BWAPI/Type.h(90): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int (..\src\dll.cc)
1>F:\StarCraft\BWAPI\include\BWAPI/Type.h(66): error C2071: “BWAPI::Type<BWAPI::UnitType,233>::constexpr”:  illegal storage class (..\src\dll.cc)
1>          F:\StarCraft\BWAPI\include\BWAPI/UnitType.h(274): note: type 'BWAPI::UnitType' is not a literal type because its direct base class 'Type<BWAPI::UnitType,233>' is not a literal type (compiling source file ..\src\module.cc)
1>F:\StarCraft\BWAPI\include\BWAPI/UnitType.h(277): error C2146: syntax error : missing“;” before “UnitType” (..\src\dll.cc)
1>F:\StarCraft\BWAPI\include\BWAPI/UnitType.h(277): error C4430:missing type specifier - int assumed. Note: C++ does not support default-int (..\src\dll.cc)
1>F:\StarCraft\BWAPI\include\BWAPI/Type.h(66): error C2071: “BWAPI::Type<T,UnknownId>::constexpr”:  illegal storage class (..\src\user_actions.cc)
1>          F:\StarCraft\BWAPI\include\BWAPI/Type.h(162): note: see reference to class template instantiation 'BWAPI::Type<T,UnknownId>' being compiled
......
1>F:\StarCraft\BWAPI\include\BWAPI/UnitType.h(1038): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int (..\src\utils.cc)
1>F:\StarCraft\BWAPI\include\BWAPI/UnitType.h(1038): error C2086: “int BWAPI::UnitTypes::constexpr”:  (..\src\utils.cc)
1>          F:\StarCraft\BWAPI\include\BWAPI/UnitType.h(965) : “BWAPI::UnitTypes::constexpr”
1>F:\StarCraft\BWAPI\include\BWAPI/UnitType.h(1039): error C2146: syntax error : missing“;” before “UnitType” (..\src\utils.cc)
1>F:\StarCraft\BWAPI\include\BWAPI/UnitType.h(1039): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int (..\src\utils.cc)
1>F:\StarCraft\BWAPI\include\BWAPI/UnitType.h(1039): error C2086: “int BWAPI::UnitTypes::constexpr”:  (..\src\utils.cc)
1>          F:\StarCraft\BWAPI\include\BWAPI/UnitType.h(965) : “BWAPI::UnitTypes::constexpr”
1>F:\StarCraft\BWAPI\include\BWAPI/UnitType.h(1039): fatal error C1003: error count exceeds 100; stopping compilation  (..\src\utils.cc)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

I guess that I used wrong compiler. However, do you have any idea about this? Thank you!

connect method leaves torchcraft intance in an uncertain state in case of failure

In current implementation, torchcraft:connect method may fail in 2 cases:

  1. client:connect failed
  2. client:init failed
    These two failures have currently very different postconditions. In case 1, connection is not established and one can call torchcraft:connect once more in an attempt to reestablish connection (which looks logical from the user perspective). In case 2, connection is established, but torchcraft:connect still fails with an error. Any further attempt to invoke torchcraft:connect would fail since the connection was established and must be closed.

Thus either the end user should distinguish between the two different invalid states and call torchcraft:close manually, or torchcraft should destroy the client's socket connection on client:init failure. From the OOP point of view, it would be better to leave the object in a consistent state and go for the second option (destroy client's connection in case of client:init failure)

Problem on Install vcrun2013

winetricks -q vcrun2013
When I ran this command on Ubuntu14.04, it occured the Problem that:

tommy@tommy:~$ winetricks -q vcrun2013

You are using a 64-bit WINEPREFIX. If you encounter problems, please retest in a clean 32-bit WINEPREFIX before reporting a bug.

Unknown arg vcrun2013
Usage: /usr/bin/winetricks [options] [command|verb|path-to-verb] ...
Executes given verbs. Each verb installs an application or changes a setting.

I don't know why the vcrun2013 is not exists. Please give me a help:(

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.