stolencatkarma / cataclysmld Goto Github PK
View Code? Open in Web Editor NEWCataclysm: Looming Darkness
Cataclysm: Looming Darkness
Can I get instructions?
Currently the only prerequisite seems to be pygame
, but even still, for people unfamiliar with python who don't have pip installing it and running the game (or wysiwyg) may be cumbersome.
Short term this can be solved by proving clear step-by-step instructions on how to install and run the game, such as:
In the future it's probably the best to have some kind of setup script that does all the dirty work.
What do you think about using the functions of the Cataclysm DDA executable for the server? I think that calling some functions through ctypes could benefit this project by not having to reimplement functionalities from scratch (at least in the short term). Here is an example that I made with one_in() function:
from ctypes import CDLL
# Change for the path of the executable, I suppose that in Windows it should work the same
cataclysm = CDLL("/usr/bin/cataclysm")
# Results
>>> cataclysm._Z6one_ini(100)
0
>>> cataclysm._Z6one_ini(15)
0
one_in
can be used transparently since it accepts an integer as a parameter and returns 0 or 1 (at least if the parameter is less than 200), although with functions that handle custom data types (such as objects) more work may be needed.
To know the functions that the executable exports you can use DLL Export Viewer in Windows or the following command in Linux:
nm -D /path/to/the/cataclysm/bin | grep -E "[a-f0-9]+ T"
If you consider the idea viable, in the long run you could create a library that only contains the necessary functions (although at the moment you could put the path of the executable in server.cfg).
Server is running, altrough client isn't starting. Python version is 3.7.2
Stdout:
Loaded gfx folder gfx/inputbox
Loaded gfx folder gfx/background
Loaded gfx folder gfx/scrollbox/vbar/backward
Loaded gfx folder gfx/scrollbox/vbar/forward
Loaded gfx folder gfx/scrollbox/vbar/decoration
Loaded gfx folder gfx/scrollbox/vbar/grip
Loaded gfx folder gfx/scrollbox/frame/decoration
Traceback (most recent call last):
File "./client.py", line 648, in <module>
pyglet.app.run()
File "C:\Python37\lib\site-packages\pyglet\app\__init__.py", line 138, in run
event_loop.run()
File "C:\Python37\lib\site-packages\pyglet\app\base.py", line 142, in run
self._run()
File "C:\Python37\lib\site-packages\pyglet\app\base.py", line 154, in _run
timeout = self.idle()
File "C:\Python37\lib\site-packages\pyglet\app\base.py", line 281, in idle
window.dispatch_event('on_draw')
File "C:\Python37\lib\site-packages\pyglet\window\__init__.py", line 1232, in dispatch_event
if EventDispatcher.dispatch_event(self, *args) != False:
File "C:\Python37\lib\site-packages\pyglet\event.py", line 360, in dispatch_event
self._raise_dispatch_exception(event_type, args, handler)
File "C:\Python37\lib\site-packages\pyglet\event.py", line 357, in dispatch_event
if handler(*args):
File "C:\Python37\lib\site-packages\glooey\root.py", line 108, in on_draw
self.batch.draw()
File "C:\Python37\lib\site-packages\pyglet\graphics\__init__.py", line 560, in draw
func()
File "C:\Python37\lib\site-packages\glooey\drawing\stencil.py", line 84, in unset_state
glPopAttrib(GL_ENABLE_BIT)
TypeError: this function takes 0 arguments (1 given)```
Connected to 127.0.0.1.
Escape character is '^]'.
_________ __ .__
\_ ___ \ _____ _/ |_ _____ ____ | | ___.__. ______ _____
/ \ \/ \__ \ \ __\\__ \ _/ ___\ | | < | | / ___/ / \
\ \____ / __ \_| | / __ \_\ \___ | |__\___ | \___ \ | Y Y \
\______ /(____ /|__| (____ / \___ >|____// ____|/____ >|__|_| /
\/ \/ \/ \/ \/ \/ \/
.____ .__
| | ____ ____ _____ |__| ____ ____
| | / _ \ / _ \ / \ | | / \ / ___\
| |___( <_> )( <_> )| Y Y \| || | \/ /_/ >
|_______ \\____/ \____/ |__|_| /|__||___| /\___ /
\/ \/ \//_____/
________ __
\______ \ _____ _______ | | __ ____ ____ ______ ______
| | \ \__ \ \_ __ \| |/ / / \ _/ __ \ / ___/ / ___/
| |_` \ / __ \_| | \/| < | | \\ ___/ \___ \ \___ \
/_______ /(____ /|__| |__|_ \|___| / \___ >/____ >/____ >
\/ \/ \/ \/ \/ \/ \/
This is a pre-alpha preview release of the Looming Darkness Multiplayer engine.
Questions, comments, and bug reports goto -> https://github.com/stolencatkarma/CataclysmLD
Please Login:
Username? >
Clort
Password? >
sdfef9if
Login Accepted! Moving us to Character Select.
1.) Create New >
Choice? >
1
Name? >
Clort
1.) Create New >
Choice? >
1
Name? >
mongo
lhasdjli
asoidjaosidj
the server is outputting status info and showing my selected 'name':
Hello, I just launched the game and even a friend connected to me, but we don't know the controls, could you suggest it?
Hey, I get FileNotFoundError: No such file or directory: './world/0_0.chunk' when I run python3 ./server.py on both Windows and Linux Mint machines.
Trying to run WYSIWYG.py, getting following stacktrace:
python3.6 WYSIWYG.py
loading tile table: tiles.png
Traceback (most recent call last):
File "WYSIWYG.py", line 307, in <module>
editor = Editor()
File "WYSIWYG.py", line 32, in __init__
self.TileManager = TileManager()
File "/Users/Aivean/Documents/coding/cataclysm-looming-darkness/CataclysmLD/tile.py", line 36, in __init__
self.TILE_MAP = self.load_tile_table("tiles.png", self.tilemapPx, self.tilemapPy) # list correlating to .png part of the file. relates to tile.fg and tile.bg
File "/Users/Aivean/Documents/coding/cataclysm-looming-darkness/CataclysmLD/tile.py", line 19, in load_tile_table
image = pygame.image.load(filename).convert_alpha()
pygame.error: Couldn't open tiles.png
Seems that tiles.png
is expected.
What actually needs to be done to make this playable? I don't see any open issues. So I am not sure what you are aiming at in the short term other than "Multiplayer"
I am interested in trying to help since I have been programming in python for a bit. But, I am not really sure what to do other than just trawling through the code till I grok it and then trying to add stuff or make stuff work?
Oh, I found the project to-do. Welp, I guess I can try working off that?
I am guessing making scenarios load? Or trying to impement crafting components, monsters, and areas? Is that not even started yet? Is there a structure for any of that. Or does something need to be done from scratch. If so, do you have an idea how you want to structure that? I could probably look into how the map is represented when it comes to trying to make that.
That appears to be done since you mentioned having all your map gen. As well as basic player logic done.
As project is growing it's sensible to organize the codebase into scalable directory structure.
I don't have a strong opinion on how exactly to structure the code, but I guess anything is better than no structure. Perhaps we can start with something as simple as:
./src/
./test/
./asset/
Or maybe separate subtrees for different subprojects:
./common
./src/
./test/
./asset/
./wysiswg
./src/
./test/
./asset/
./client
./src/
./test/
./asset/
./server
./src/
./test/
./asset/
Yes, that's my question, how does this works
Full traceback:
Traceback (most recent call last):
File "server.py", line 1020, in <module>
server.connect(ip, port)
File "C:\dev\python37\CataclysmLD\Mastermind\_mm_server.py", line 142, in connect
self._mm_make_connection(ip, port)
File "C:\dev\python37\CataclysmLD\Mastermind\_mm_server.py", line 252, in _mm_make_connection
socket.IPPROTO_TCP, socket.TCP_KEEPIDLE, 1
AttributeError: module 'socket' has no attribute 'TCP_KEEPIDLE'
This seems to be an issue with the socket library as indicated by this other issue:
websocket-client/websocket-client#75
Mastermind seems to be the culprit, since it's there that these settings are set:
def _mm_make_connection(self, ip, port):
...
self._mm_unconnected_socket.setsockopt(socket.IPPROTO_TCP, socket.TCP_KEEPIDLE, 1)
Its kinda been a while since last update
killaura@Unknown:~/CataclysmLD$ python3 server.py
Traceback (most recent call last):
File "/home/killaura/.local/lib/python3.9/site-packages/sdl2/dll.py", line 362, in
dll = DLL("SDL2", ["SDL2", "SDL2-2.0", "SDL2-2.0.0"], os.getenv("PYSDL2_DLL_PATH"))
File "/home/killaura/.local/lib/python3.9/site-packages/sdl2/dll.py", line 253, in init
raise RuntimeError("could not find any library for %s (%s)" %
RuntimeError: could not find any library for SDL2 (PYSDL2_DLL_PATH: unset)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/killaura/CataclysmLD/server.py", line 13, in
import sdl2
File "/home/killaura/.local/lib/python3.9/site-packages/sdl2/init.py", line 2, in
from .dll import get_dll_file, _bind
File "/home/killaura/.local/lib/python3.9/site-packages/sdl2/dll.py", line 364, in
raise ImportError(exc)
ImportError: could not find any library for SDL2 (PYSDL2_DLL_PATH: unset)
killaura@Unknown:~/CataclysmLD$ python3 server.py
Traceback (most recent call last):
File "/home/killaura/.local/lib/python3.9/site-packages/sdl2/dll.py", line 362, in
dll = DLL("SDL2", ["SDL2", "SDL2-2.0", "SDL2-2.0.0"], os.getenv("PYSDL2_DLL_PATH"))
File "/home/killaura/.local/lib/python3.9/site-packages/sdl2/dll.py", line 253, in init
raise RuntimeError("could not find any library for %s (%s)" %
RuntimeError: could not find any library for SDL2 (PYSDL2_DLL_PATH: unset)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/killaura/CataclysmLD/server.py", line 13, in
import sdl2
File "/home/killaura/.local/lib/python3.9/site-packages/sdl2/init.py", line 2, in
from .dll import get_dll_file, _bind
File "/home/killaura/.local/lib/python3.9/site-packages/sdl2/dll.py", line 364, in
raise ImportError(exc)
ImportError: could not find any library for SDL2 (PYSDL2_DLL_PATH: unset)
Xubuntu 18.04.2, python 3.7.2
After pressing character creation button, im having empty scroll panes
Clicking top buttons doesn't doing anything. After clicking scroll panes, it crashes (probably crash isn't the main problem, main is empty UI)
stdout of crash:
Loaded gfx folder /gfx/
Loaded gfx folder gfx/inputbox
Loaded gfx folder gfx/background
Loaded gfx folder gfx/scrollbox/vbar/backward
Loaded gfx folder gfx/scrollbox/vbar/forward
Loaded gfx folder gfx/scrollbox/vbar/decoration
Loaded gfx folder gfx/scrollbox/vbar/grip
Loaded gfx folder gfx/scrollbox/frame/decoration
--next_update in login--
--next_update in login--
--next_update in character_select--
Traceback (most recent call last):
File "./client.py", line 648, in <module>
pyglet.app.run()
File "/usr/local/lib/python3.7/dist-packages/pyglet/app/__init__.py", line 138, in run
event_loop.run()
File "/usr/local/lib/python3.7/dist-packages/pyglet/app/base.py", line 142, in run
self._run()
File "/usr/local/lib/python3.7/dist-packages/pyglet/app/base.py", line 155, in _run
platform_event_loop.step(timeout)
File "/usr/local/lib/python3.7/dist-packages/pyglet/app/xlib.py", line 125, in step
device.select()
File "/usr/local/lib/python3.7/dist-packages/pyglet/canvas/xlib.py", line 168, in select
dispatch(e)
File "/usr/local/lib/python3.7/dist-packages/pyglet/window/xlib/__init__.py", line 922, in dispatch_platform_event_view
event_handler(e)
File "/usr/local/lib/python3.7/dist-packages/pyglet/window/xlib/__init__.py", line 1155, in _event_motionnotify_view
x, y, dx, dy, buttons, modifiers)
File "/usr/local/lib/python3.7/dist-packages/pyglet/window/__init__.py", line 1232, in dispatch_event
if EventDispatcher.dispatch_event(self, *args) != False:
File "/usr/local/lib/python3.7/dist-packages/pyglet/event.py", line 357, in dispatch_event
if handler(*args):
File "/usr/local/lib/python3.7/dist-packages/glooey/widget.py", line 693, in on_mouse_drag
child.dispatch_event('on_mouse_drag', x, y, dx, dy, buttons, modifiers)
File "/usr/local/lib/python3.7/dist-packages/pyglet/event.py", line 367, in dispatch_event
if getattr(self, event_type)(*args):
File "/usr/local/lib/python3.7/dist-packages/glooey/widget.py", line 693, in on_mouse_drag
child.dispatch_event('on_mouse_drag', x, y, dx, dy, buttons, modifiers)
File "/usr/local/lib/python3.7/dist-packages/pyglet/event.py", line 367, in dispatch_event
if getattr(self, event_type)(*args):
File "/usr/local/lib/python3.7/dist-packages/glooey/widget.py", line 693, in on_mouse_drag
child.dispatch_event('on_mouse_drag', x, y, dx, dy, buttons, modifiers)
File "/usr/local/lib/python3.7/dist-packages/pyglet/event.py", line 367, in dispatch_event
if getattr(self, event_type)(*args):
File "/usr/local/lib/python3.7/dist-packages/glooey/widget.py", line 693, in on_mouse_drag
child.dispatch_event('on_mouse_drag', x, y, dx, dy, buttons, modifiers)
File "/usr/local/lib/python3.7/dist-packages/pyglet/event.py", line 367, in dispatch_event
if getattr(self, event_type)(*args):
File "/usr/local/lib/python3.7/dist-packages/glooey/widget.py", line 693, in on_mouse_drag
child.dispatch_event('on_mouse_drag', x, y, dx, dy, buttons, modifiers)
File "/usr/local/lib/python3.7/dist-packages/pyglet/event.py", line 367, in dispatch_event
if getattr(self, event_type)(*args):
File "/usr/local/lib/python3.7/dist-packages/glooey/widget.py", line 693, in on_mouse_drag
child.dispatch_event('on_mouse_drag', x, y, dx, dy, buttons, modifiers)
File "/usr/local/lib/python3.7/dist-packages/pyglet/event.py", line 367, in dispatch_event
if getattr(self, event_type)(*args):
File "/usr/local/lib/python3.7/dist-packages/glooey/widget.py", line 693, in on_mouse_drag
child.dispatch_event('on_mouse_drag', x, y, dx, dy, buttons, modifiers)
File "/usr/local/lib/python3.7/dist-packages/pyglet/event.py", line 367, in dispatch_event
if getattr(self, event_type)(*args):
File "/usr/local/lib/python3.7/dist-packages/glooey/widget.py", line 693, in on_mouse_drag
child.dispatch_event('on_mouse_drag', x, y, dx, dy, buttons, modifiers)
File "/usr/local/lib/python3.7/dist-packages/pyglet/event.py", line 367, in dispatch_event
if getattr(self, event_type)(*args):
File "/usr/local/lib/python3.7/dist-packages/glooey/widget.py", line 693, in on_mouse_drag
child.dispatch_event('on_mouse_drag', x, y, dx, dy, buttons, modifiers)
File "/usr/local/lib/python3.7/dist-packages/pyglet/event.py", line 367, in dispatch_event
if getattr(self, event_type)(*args):
File "/usr/local/lib/python3.7/dist-packages/glooey/scrolling.py", line 130, in on_mouse_drag
super().on_mouse_drag(x, y, dx, dy, buttons, modifiers)
File "/usr/local/lib/python3.7/dist-packages/glooey/widget.py", line 693, in on_mouse_drag
child.dispatch_event('on_mouse_drag', x, y, dx, dy, buttons, modifiers)
File "/usr/local/lib/python3.7/dist-packages/pyglet/event.py", line 367, in dispatch_event
if getattr(self, event_type)(*args):
File "/usr/local/lib/python3.7/dist-packages/glooey/scrolling.py", line 462, in on_mouse_drag
self.pane.scroll_percent(drag_percent)
File "/usr/local/lib/python3.7/dist-packages/vecrec/shapes.py", line 71, in decorator
return function(self, vector)
File "/usr/local/lib/python3.7/dist-packages/glooey/scrolling.py", line 284, in scroll_percent
self._require_rects()
File "/usr/local/lib/python3.7/dist-packages/glooey/scrolling.py", line 418, in _require_rects
raise UsageError("can't scroll until the scroll pane has a child widget.")
glooey.helpers.UsageError: can't scroll until the scroll pane has a child widget.
I just downloaded the lastest build. Then I installed all the required packages with pip.
I could start a server just fine, it even says "Started up Cataclysm: Looming Darkness Server".
But when I try to start the client, I get this:
C:\Programme 2\CataclysmLD-master\CataclysmLD-master>python client.py Swag Naut
Loaded gfx folder gfx/background
Loaded gfx folder gfx/scrollbox/vbar/backward
Loaded gfx folder gfx/scrollbox/vbar/forward
Loaded gfx folder gfx/scrollbox/vbar/decoration
Loaded gfx folder gfx/scrollbox/vbar/grip
Loaded gfx folder gfx/scrollbox/frame/decoration
total TILE_TYPES loaded: 8388
total ITEM_TYPES loaded: 922
total RECIPE_TYPES loaded: 4
HEAD_0
TORSO_0
ARM_LEFT
ARM_RIGHT
LEG_LEFT
LEG_RIGHT
FOOT_LEFT
FOOT_RIGHT
HAND_LEFT
HAND_RIGHT
survivor
added localhost:6317
added 162.211.66.247:6317
Traceback (most recent call last):
File "client.py", line 473, in
client = Client(args.first_name, args.last_name)
File "client.py", line 252, in __init__
self.LoginWindow = LoginWindow()
File "client.py", line 191, in __init__
self.gui.add(self.grid)
File "C:\Users\philb\AppData\Roaming\Python\Python37\site-packages\glooey\containers.py", line 501, in add
self.add_front(widget)
File "C:\Users\philb\AppData\Roaming\Python\Python37\site-packages\glooey\containers.py", line 505, in add_front
self.insert(widget, layer)
File "C:\Users\philb\AppData\Roaming\Python\Python37\site-packages\glooey\containers.py", line 514, in insert
self._repack_and_regroup_children()
File "C:\Users\philb\AppData\Roaming\Python\Python37\site-packages\glooey\helpers.py", line 90, in wrapped_method
method(self, *args, **kwargs)
File "C:\Users\philb\AppData\Roaming\Python\Python37\site-packages\glooey\widget.py", line 1475, in _repack_and_regroup_children
self._repack()
File "C:\Users\philb\AppData\Roaming\Python\Python37\site-packages\glooey\helpers.py", line 90, in wrapped_method
method(self, *args, **kwargs)
File "C:\Users\philb\AppData\Roaming\Python\Python37\site-packages\glooey\root.py", line 92, in _repack
self.claimed_width, self.claimed_height,
RuntimeError: Gui(id=0278) is only 854x528, but its children are 466x608.
(I copied the whole error just to be sure I got the important bit)
I don't know exactly caused this error, it may be entirely my fault. But maybe it somehow helps.
I can't wait to play this with a couple of friends or even other people online.
I download the current build, commit 84f1f08, and installed everything.
After starting the server for the first time and connecting, the server displayed this error:
Exception in thread Thread-2:
Traceback (most recent call last):
File "..\src\worldmap.py", line 156, in get_tile_by_position
for tile in self.WORLDMAP[x_count][y_count][z].tiles:
KeyError: 7
The actual error was a bit longer, but I cut it down to what I believe are the essentials.
All required libraries seem to be installed. The player window shows a bunch of dirt tiles if that helps.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.