day 7 - finish
I added a "finish" sign to the end of the snow hill. Since I didn't want to mess about with fonts I built 3D models for the F, I, N, S and H keys and placed a 3D FINISH-model at the end. I also added a gameplay features, there's now hungry wolves jumping out of the hills and attacking your wizards. It's mostly untested - so either it will have little effect and you can just ignore them, or it will make it slightly harder to win :)
Anyway, I just spent hours getting pyinstaller to work. In theory you can now run the game on Linux, OSX and Windows without installing Python or any of the dependencies. I wish they would put in some effort to make this easier. Especially do not require me to access an actual OSX and Windows box to create the distribution for them - that sort of defeats the purpose. Oh well. Will see for how many people it will actually work.
(log in to comment)
Comments
In Linux this works for me:
cp main-linux/liballegro_monolith.5.2.so .
python3 src/main.py
python3 src/main.py
Basically ctypes looks for .so files in the current directory. I copied it to the main-linux folder when I made the pyinstaller version and didn't think about breaking the source version that way. pyinstaller apparently uses a wrong libc version? Another thing they should fix I suppose :(
If that liballegro_monolith.5.2.so file also is incompatible than on Ubuntu a compatible version can be obtained with:
sudo apt install liballegro-5.2
I think no copying would be necessary in that case as ctypes also finds system installed .so files.
No idea about Windows unfortunately.
cp main-linux/liballegro_monolith.5.2.so .
python3 src/main.py
still does nothing.
If I add some print statements in allegro.py, I see that python_callback in al_main isn't ever called, which is probably why the game appear to do nothing and exit. I don't know why _dll ignores functions it can't find but if I let it print error messages, there are many not found.
libwebp.so.6 => not found
libdumb.so.1 => not found
libopusfile.so.0 => not found
I don't have easy access to allegro 5.2 to test out the alternative. And haven't used pyinstaller before so can't help you there unfortunately.
Thanks for debugging this, and that makes sense, ctypes won't load a .so file if it the dependencies can't be found.
I don't even use .webp or .it or .opus files in my entry so could probably compile a version without support for those... if you want to try: https://allefant.com/liballegro_monolith.5.2.so but ldd shows there is still a ton of dependencies to other .so files so it might not really improve things much.
The problem with pyinstaller is this I guess: https://github.com/pyinstaller/pyinstaller/wiki/FAQ#gnulinux - maybe next pyweek I can investigate what this "staticx" is.
rdb on 2018/11/04 14:00:
Nothing seems to be happening when running "python src\main.py" on WIndows or Linux. How do I run this from source?