mwydmuch / PyOblige

PyOblige is Python wrapper for OBLIGE - random level generator for Doom

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

It only generated a text file, not WAD

wzbbbb opened this issue · comments

I used the example. However, it only generated a text file. Not sure what I missed.

from oblige import *
seed=2042
another_seed=203234
generator = DoomLevelGenerator(seed)
generator.set_seed(another_seed)
#generator.set_config({"key_to_update": "value"})
number_of_generate_maps = generator.generate("test_wad")

By the way, the link is broken.
Example of usage with ViZDoom: ViZDoom/examples/python/oblige.py.

Are you sure? I copy-pasted the code and it produces a tet file and the wad as well.

The link has been corrected.

Yes, I tried several times, it only generate a text file. Unless the WAD file will be in a different directory?
Is there a way to trace the operation?

No, the directory should be the same.
To see output files use:
number_of_generated_maps = generator.generate("test_wad",verbose=True)

Sorry for the delay! I tried again. Here is the output

...
...
Oblige executable path: Oblige_src/Oblige
Exit code: 3
Oblige output:
Making MAP01
Script Error
FAILED!

>>> import oblige
>>> oblige.__version__
'0.1.0'
Ubuntu 16.04.4 LTS

Same output here.

commented

I'm getting the same output from the latest git version (fc10ce2). I am on OSX.

It seems on my laptop Ubuntu 16.04, the code only runs well on python3.5, but failed on python2.7 and my manually installed python3.6; however, on my server computer Ubuntu14.04, it fails to run in all python versions, include 2.7, 3.4, 3.5, 3.6.
I've tried to manually run script ./Oblige --batch ~/test.wad --load ~/github/ViZDoom/examples/python/test.txt in /usr/local/lib/python3.6/site-packages/oblige/Oblige_src, and it outputs like this
Making MAP01 Script Error FAILED!
looks something strange...

Could you post the files that are included in the pip package after installation?

e.g. tree python3 -c "import oblige; print(oblige.path[0])"``
(please don't copy the whole text, just attach the file with output)

Python 3.5.2 (default, Nov 23 2017, 16:37:01) 
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import oblige
>>> oblige.path
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'oblige' has no attribute 'path'

same as py2.7 && py3.6 on my laptop

And I run command tree /usr/local/lib/python3.5/dist-packages/oblige, the output is attached after
filetree.txt
I've updated my oblige version to 0.1.2, and was the same output which couldn't find it's path.

localtree.txt is the pyoblige github repo in my /home dir

Hi @Trinkle23897,
thanks for your help so far. @mihahauke meant oblige.__path__[0] instead of oblige.path[0], but it's not that important. It seems that you have all relevant files.

With 0.1.2 I extended output when verbose option is set to True. Please run:

generator = DoomLevelGenerator()
maps = generator.generate("test.wad", verbose=True)

this should print explanation of Oblige's error.

verbose_server.txt
I know how is the error generated on my server...... the home dir is /media/ST\wengjiayi/trinkle and contains '\', maybe the code can't handle the character '\'.
I move it to another dir which doesn't contain '\' and works well.

On my laptop, the new version 0.1.2 works in py2.7 && py3.5, but py3.6 crashed. It outputs

Traceback (most recent call last):
File "pyoblige.py", line 12, in <module>
from vizdoom import *
File "/usr/local/lib/python3.6/site-packages/vizdoom/init.py", line 1, in <module>
from .vizdoom import version as version
ImportError: /usr/local/lib/python3.6/site-packages/vizdoom/vizdoom.so: undefined symbol: _Py_ZeroStruct

and I look at the py3.6 lib dir
n+e:/usr/local/lib/python3.5/dist-packages/vizdoom ls
bots.cfg freedoom2.wad init.py pycache scenarios vizdoom vizdoom.pk3 vizdoom.so
n+e:/usr/local/lib/python3.5/dist-packages/vizdoom ls ../../../python3.6/site-packages/vizdoom
bots.cfg freedoom2.wad init.py init.pyc scenarios vizdoom _vizdoom vizdoom.pk3 vizdoom.so
it looks fine... I don't know what's happened.

I had this issue as well on Ubuntu 16.04 and both python 3.5/3.6. The issue went away when I changed the directory of where to generate the WAD file to a location that did not have any spaces anywhere in the path. E.g. ~/Wad Path/test.wad fails but ~/WadPath/test.wad works fine.

Hello @devinjdangelo, thank you for finding it out!