-
Notifications
You must be signed in to change notification settings - Fork 36
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
Cannot use custom maps #13
Comments
I tried replacing my custom map with a default one, the game refuses to start with the same error: "RuntimeError: File Error: Could not find: 10x10-2v2.json (/home/marcocspc/git/drts/DeepRTS/python/assets/maps/10x10-2v2.json). Again, the file is there: "marcocspc@marcocspc-desktop-linux:~/git/drts/DeepRTS/python/assets/maps$ ls -l |
Hi,
How did you run DeepRTS? Are you using it as a library or directly from the
git repo?
…On Tue, Jan 21, 2020, 21:03 Marco Antonio ***@***.***> wrote:
I tried replacing my custom map with a default one, the game refuses to
start with the same error:
"RuntimeError: File Error: Could not find: 10x10-2v2.json
(/home/marcocspc/git/drts/DeepRTS/python/assets/maps/10x10-2v2.json).
Ensure that the data directory exists!"
Again, the file is there:
***@***.***:~/git/drts/DeepRTS/python/assets/maps$
ls -l
total 48
-rw-rw-r-- 1 marcocspc marcocspc 5493 jan 21 16:01 10x10-2v2.json
-rw-r--r-- 1 marcocspc marcocspc 1881 jan 21 10:12 15x15-2v2.json
-rw-r--r-- 1 marcocspc marcocspc 2937 jan 21 10:12 21x21-2v2.json
-rw-r--r-- 1 marcocspc marcocspc 5497 jan 21 10:12 31x31-2v2.json
-rw-r--r-- 1 marcocspc marcocspc 5495 jan 21 10:12 31x31-4v4.json
-rw-r--r-- 1 marcocspc marcocspc 5493 jan 21 10:12 31x31-6v6.json
-rw-rw-r-- 1 marcocspc marcocspc 5493 jan 21 16:10 32.json"
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#13?email_source=notifications&email_token=AA4ZS7WO6FPG7BRAG7JVXKLQ65IJPA5CNFSM4KJZFYHKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJRCCXY#issuecomment-576856415>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA4ZS7U3JPJ5B5DIWDMCSSTQ65IJPANCNFSM4KJZFYHA>
.
|
Hello! I've installed it using pip, running the commands from the Dockerfile in a real Ubuntu installation. The script I'm using to test the game is the one here: https://github.com/marcocspc/AI_Laboratory/blob/master/DeepRTS/scripts/drts_test.py As you can see, I'm using DeepRTS as a system module. |
If you install DeepRTS, it will be installed in site-packages. This means that the custom map must be added to this location. I'm not 100% sure where this would be, but something like (https://github.com/cair/deep-rts/tree/master/DeepRTS/python/assets/maps) What you could do is to fork the project and add the map to your fork, then install your fork via pip. I havent found a good way of doing this, because the "Engine", which runs in C++ is not very friendly when it comes to paths.
A fix for this could perhaps be to allow absolute paths. But I would have to investigate. |
I'm using a Ubuntu VM on this scenario because I need to visualize the map on the gui (I wasn't able to see the main window using docker, even forwarding my x session. But I am able to run DRTS with no gui inside a container). Anyway, using the same commands in the Dockerfile on your repo, DRTS is installed on "its own folder" inside the VM. I don't why this happened, but the game keeps referencing the directory into which the repo was cloned. It is installed as a system-wide module (I'm not using venv, since it's a VM), I am able to import DeepRTS anywhere on the system, even inside Python 3 terminal. I will try to reinstall from scratch with my custom maps included to see if I am able to load the custom maps. A way to allow absolute paths on the referenced code (https://github.com/cair/deep-rts/blob/master/src/loaders/ResourceLoader.cpp#L51) would be:
I know almost nothing about C++, but I may try to alter the code a little bit to see if it works if reinstalling DRTS fails. Thank you again for your support! |
Ill take a look for possible solutions tonight ,+1GMT
…On Wed, Jan 22, 2020, 14:14 Marco Antonio ***@***.***> wrote:
I'm using a Ubuntu VM on this scenario because I need to visualize the map
on the gui (I wasn't able to see the main window using docker, even
forwarding my x session. But I am able to run DRTS with no gui inside a
container). Anyway, using the same commands in the Dockerfile on your repo,
DRTS is installed on "its own folder" inside the VM. I don't why this
happened, but the game keeps referencing the directory into which the repo
was cloned.
It *is* installed as a system-wide module (I'm not using venv, since it's
a VM), I am able to import DeepRTS anywhere on the system, even inside
Python 3 terminal. I will try to reinstall from scratch with my custom maps
included to see if I am able to load the custom maps.
A way to allow absolute paths on the referenced code (
https://github.com/cair/deep-rts/blob/master/src/loaders/ResourceLoader.cpp#L51)
would be:
- Check if the map is inside the maps folder. If it is, load it;
- If not, try to use the mapFile variable as an absolute path.
I know almost nothing about C++, but I may try to alter the code a little
bit to see if it works if reinstalling DRTS fails.
Thank you again for your support!
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#13?email_source=notifications&email_token=AA4ZS7SL3XD3R4LTHWI5FMTQ7BBCDA5CNFSM4KJZFYHKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJTQCHI#issuecomment-577175837>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA4ZS7V4DFMDVLEUOVNVJBDQ7BBCDANCNFSM4KJZFYHA>
.
|
Quick update, installing from scratch using the command: "pip3 install ./drts" (I removed the "-e" option), I was able to install it to my venv default lib folder (the map was included in the installation, as you suggested). Still, the error persists:
|
Figured it out!
There is a missing " at the start as well as a random 1 in the file, Remove these and the map will work |
You can now also run games with main.py --map=32.json to run custom maps, however, they must be added to the assets directory |
Yay! It worked! I've tested copying one of the default maps as "32.json" file and the game ran without any problems. One last question: is this main.py file this one? https://github.com/cair/deep-rts/blob/master/coding/main.py I'll try to fix my map and to copy it to the venv/lib/python3.6/site-packages/DeepRTS/python/assets/maps/ and see if it works after the installation. Reinstalling DeepRTS every time I make a modification to the map would be painful. :P Again, thank you for your support! |
Usually, when doing custom stuff and doing research, I would reccomend that you git clone the whole project and do your work from the coding directory If you run the main.py from drts/coding/ with the working dir as drts it should resolve itself python3 setup.py clean build and copy the resulting Engine.so (from build dir) to the DeepRTS directoryI reccomend that you fork DeepRTS to your own repository and do changes this way :) Hope this helps |
Hello! I'm not being able to use custom maps on DeepRTS.
If I try to load a map that is not inside the default maps folder, it fails. I took a look at the code and saw that the game will only run maps that are inside that directory.
Even if I copy my custom map to DeepRTS/python/assets/maps, the game won't load. The error I'm getting is this one:
"RuntimeError: File Error: Could not find: 32.json (/home/marcocspc/git/drts/DeepRTS/python/assets/maps/32.json).
Ensure that the data directory exists!"
But the file is there:
"$ls /home/marcocspc/git/drts/DeepRTS/python/assets/maps/ -l
total 52
-rw-r--r-- 1 marcocspc marcocspc 1253 jan 21 10:12 10x10-2v2.json
-rw-r--r-- 1 marcocspc marcocspc 1881 jan 21 10:12 15x15-2v2.json
-rw-r--r-- 1 marcocspc marcocspc 2937 jan 21 10:12 21x21-2v2.json
-rw-r--r-- 1 marcocspc marcocspc 5497 jan 21 10:12 31x31-2v2.json
-rw-r--r-- 1 marcocspc marcocspc 5495 jan 21 10:12 31x31-4v4.json
-rw-r--r-- 1 marcocspc marcocspc 5493 jan 21 10:12 31x31-6v6.json
-rw-rw-r-- 1 marcocspc marcocspc 5493 jan 21 16:10 32.json
-rw-rw-r-- 1 marcocspc marcocspc 5493 jan 21 16:01 simple_32_32.json"
I tried to reinstall DeepRTS with the custom maps inside the folder, but to no avail. I thought that the installation "freezes" the files inside the folder and won´t "see" the new files that I added there, so If I reinstalled the module, maybe the maps would be included.
Thank you for your support!
The text was updated successfully, but these errors were encountered: