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

how to show battle #20

Open
Ruobird opened this issue Nov 26, 2019 · 4 comments
Open

how to show battle #20

Ruobird opened this issue Nov 26, 2019 · 4 comments

Comments

@Ruobird
Copy link

Ruobird commented Nov 26, 2019

I want to take a look at the battle screens I trained. What should I do? I found the index.html page file. How should I use this? Looking forward to your answer

@Swell61
Copy link

Swell61 commented Dec 3, 2020

I've had a look at this today as I had the same question.

From my experimentation, you can either compile the render backend in examples/battle_model/src/render/backend (I had to use clang++ as g++ wouldn't compile the jsoncpp library), or use the binary render in examples/battle_model/build/render/.

The web page will then connect to the server. You supply it with the config and map files. The config file is in the render directory. If you feed one of the video_x files as a map, it seems to work, I get an animation of blue and red boxes, similar to that of the demo.

I'm not sure what static.map is for. When it is provided as the map file, it outputs an error invalid tag of walls. Comparing it to the video_x files (after running battle.py with the --render arg), it's missing a W at the start of the file. If I add the W, it starts to load but the backend produces a segmentation fault.

@ElizabethDuo
Copy link

I've had a look at this today as I had the same question.

From my experimentation, you can either compile the render backend in examples/battle_model/src/render/backend (I had to use clang++ as g++ wouldn't compile the jsoncpp library), or use the binary render in examples/battle_model/build/render/.

The web page will then connect to the server. You supply it with the config and map files. The config file is in the render directory. If you feed one of the video_x files as a map, it seems to work, I get an animation of blue and red boxes, similar to that of the demo.

I'm not sure what static.map is for. When it is provided as the map file, it outputs an error invalid tag of walls. Comparing it to the video_x files (after running battle.py with the --render arg), it's missing a W at the start of the file. If I add the W, it starts to load but the backend produces a segmentation fault.

@Swell61 Hi Swell! Your answer helped a lot!
I ran render under examples/battle_model/build/render/ and tried to serve cofig.json and video_x.txt as the map.
config.json seemed to be fine, but it failed for magent::render::RenderException: "invalid handle of the map configuration file".
Any idea to solve this?
Hope to hear from you soon.

@Swell61
Copy link

Swell61 commented Jan 19, 2021

@Swell61 Hi Swell! Your answer helped a lot!
I ran render under examples/battle_model/build/render/ and tried to serve cofig.json and video_x.txt as the map.
config.json seemed to be fine, but it failed for magent::render::RenderException: "invalid handle of the map configuration file".
Any idea to solve this?
Hope to hear from you soon.

Hi, do you have the files in the same directory as render? I think I remember encountering an issue when attempting to feed it files that were in different directory to render and it wouldn't run.

I've just tried it again with config.json and video_15.txt in the same directory as render and index.html and it worked.

Let me know if this works or not.

@ElizabethDuo
Copy link

@Swell61 Hi Swell! Your answer helped a lot!
I ran render under examples/battle_model/build/render/ and tried to serve cofig.json and video_x.txt as the map.
config.json seemed to be fine, but it failed for magent::render::RenderException: "invalid handle of the map configuration file".
Any idea to solve this?
Hope to hear from you soon.

Hi, do you have the files in the same directory as render? I think I remember encountering an issue when attempting to feed it files that were in different directory to render and it wouldn't run.

I've just tried it again with config.json and video_15.txt in the same directory as render and index.html and it worked.

Let me know if this works or not.

Swell, thank you for the reply! I have solved this problem by just type in the name of cofig.json and video_x.txt.
I was wrongly upload the whole file path before, then caused the error.
And it was simply solved by input the name of files only.
Thanks again for your help!

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

3 participants