cair / deep-rts

A Real-Time-Strategy game for Deep Learning research
MIT License
202 stars 34 forks source link

Aborted (core dumped) #7

Closed ayush1710 closed 5 years ago

ayush1710 commented 5 years ago

have been trying to use thefeatures/drqn_1.2 branch and was successfully able to compile the code, but the DeepRTS executable encounters a runtime error.

Screenshot from 2019-06-14 09-53-54

perara commented 5 years ago

Looking at the error code, it seems like the AI code is not found when starting Deep RTS

On Fri, Jun 14, 2019, 07:26 Ayush notifications@github.com wrote:

have been trying to use thefeatures/drqn_1.2 branch and was successfully able to compile the code, but the DeepRTS executable encounters a runtime error.

[image: Screenshot from 2019-06-14 09-53-54] https://user-images.githubusercontent.com/33285977/59483347-9cdef800-8e8a-11e9-927c-d4fb59b25efb.png

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/cair/deep-rts/issues/7?email_source=notifications&email_token=AA4ZS7V2M5XAYHTBQDDSRY3P2MMWPA5CNFSM4HYEHCD2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4GZO24SA, or mute the thread https://github.com/notifications/unsubscribe-auth/AA4ZS7QMPZ5UQKSJYBZVR5TP2MMWPANCNFSM4HYEHCDQ .

ayush1710 commented 5 years ago

I used the makefile generated using cmake to complie the code. What else should I do to make it work?

perara commented 5 years ago

Hi,

I'm currently on vacation, and as such do not have access to a computer.

I will take a look at it next week but generally I think you are using a old version. I deprecated the code you are referring to a while back.

In the updated repository (c++ or master) the recommended use is to access Deep RTS through the python API. I should make this more clear when returning from vacation.

In the meantime, try the most recent code, which should yield better results.

On Fri, Jun 14, 2019, 13:12 Ayush notifications@github.com wrote:

I used the makefile generated using cmake to complie the code. What else should I do to make it work?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/cair/deep-rts/issues/7?email_source=notifications&email_token=AA4ZS7VI4AQ3CR6STI63BILP2NVKBA5CNFSM4HYEHCD2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXWLW6Y#issuecomment-502053755, or mute the thread https://github.com/notifications/unsubscribe-auth/AA4ZS7VGBYYSNZUQOFWDYP3P2NVKBANCNFSM4HYEHCDQ .

ayush1710 commented 5 years ago

Can you tell me what PyAPIRegistry is and how can I import it?

perara commented 5 years ago

The PyAPIRegistry was previously used to inject a few bindings from C++ to Python using this code: https://github.com/cair/deep-rts/blob/features/drqn_1.2/src/game/algorithms/PYAPI/PyAI.cpp

In the version you are trying to replicate, C++ was in charge of starting a Python Interpreter within the C++ application, Inject bindings into the Python interpreter which enabled me to read state and to call C++ classes from such ass the step function from Python classes.

The AI files were added to a directory called Algorithms and was automatically loaded when defined in the C++ code.

BUT! As mentioned previously, the brach you are attempting to run is over 2 years old and was at that stage only experimental (still is, This branch is 1 commit ahead, 179 commits behind c++.).

I urge to to use the c++ branch which properly binds the C++ classes into pure python via pybind. (Like it should)

There is a fairly detailed guide on how to get it up and running on: https://github.com/cair/deep-rts/blob/c%2B%2B/README.md

ayush1710 commented 5 years ago

Thank you for the help. I ran the c++ branch. It works fine. But I have no idea where are the algorithms in that branch or the actions that are to performed. How do I know what action does what and how do I get the reward and stuff?

perara commented 5 years ago

In the c++, no algorithms are included. You can easily use algorithms such as those founds in the stable-baselines or, any RL framework really. The reward function must be defined manually, but you should have access to any parts of the state through the wrappers.

In python run (dir(game)) to see the exposed functions. I've not been able to generate comments yet for the API.

There should be a example in the README file

perara commented 5 years ago

I've added a experiments directory into the source code. please try this :)