Post subject: New OSS project: Jetblade
Joined: 7/2/2007
Posts: 3960
I've decided to make the project I've spent the last few months working on into an open-source project. It's called Jetblade, and it's a 2D platforming game using procedurally-generated levels. At the moment, it can generate maps like this one, and you can explore them using the player avatar with accurate physics; thus, it's not really a playable game yet. Still, there's a lot of code here doing a great deal of work; as I said, I've spent several months on this. Jetblade is written in Python with PyGame. You'll need Mercurial to download the source code (Mercurial is a VCS like git, and very easy to use). There's Doxygen documentation for the project in the 'html' directory of the source, which should give you a starting point for figuring out how things are organized. I've also included all of the Blender files for the models I've made so far (minus the file for the terrain blocks, which is too big and needs to be split up). Please take a look, and if you're so inclined, contributions are welcome!
Pyrel - an open-source rewrite of the Angband roguelike game in Python.
Joined: 10/3/2005
Posts: 1332
Neat! I think I might actually abscond with your map generator code and use it to make a Solar Jetman clone. That screenshot you posted is very reminiscent of what you'd see in that game. Also, you can't say "Castletroid" without "castle", but these procedural maps don't seem like they'd be able to generate anything resembling man-made architecture. Any thoughts/plans on that?
Joined: 8/3/2004
Posts: 380
Location: Finland
Dromiceius wrote:
Neat! I think I might actually abscond with your map generator code and use it to make a Solar Jetman clone. That screenshot you posted is very reminiscent of what you'd see in that game. Also, you can't say "Castletroid" without "castle", but these procedural maps don't seem like they'd be able to generate anything resembling man-made architecture. Any thoughts/plans on that?
I'd assume you could combine developer designed blocks of a map and the procedurally generated content seamlessly so you could add certain things that repeat from game to game in different positions and arrangements. Also, I'm assuming that with switching of the terrain and restricting the layouts a bit more (to move them from the current cave-like appearance into the sharp corners and so forth of a castle) could make it generate more castlevania-esque levels. Anyway, pretty impressive so far. I'll definetly take a look at the code and possibly contribute something if I find the the time and motivation (coding at work severely diminishes motivation for other coding). Do you happen to any sort of a roadmap one could look for a list of things to be done?
"Kids! Bringing about Armageddon can be dangerous. Do not attempt it in your home." ( Pratchett & Gaiman: Good Omens )
Joined: 10/3/2005
Posts: 1332
Tombad wrote:
I'd assume you could combine developer designed blocks of a map and the procedurally generated content seamlessly so you could add certain things that repeat from game to game in different positions and arrangements. Also, I'm assuming that with switching of the terrain and restricting the layouts a bit more (to move them from the current cave-like appearance into the sharp corners and so forth of a castle) could make it generate more castlevania-esque levels.
Well... that's one way to do it. ;) It's definitely not a simple problem, but I've suspected for awhile that there are cleverer solutions to create "randomness that isn't random." Not that I have any specific ideas or anything.
Anyway, pretty impressive so far. I'll definetly take a look at the code and possibly contribute something if I find the the time and motivation (coding at work severely diminishes motivation for other coding). Do you happen to any sort of a roadmap one could look for a list of things to be done?
There's a todo.html under /html in the repo.
Joined: 8/3/2004
Posts: 380
Location: Finland
Dromiceius wrote:
Tombad wrote:
stuff
Well... that's one way to do it. ;) It's definitely not a simple problem, but I've suspected for awhile that there are cleverer solutions to create "randomness that isn't random." Not that I have any specific ideas or anything.
Indeed. Though if there's a well-known solution I'd suspect that the roguelike-scene might be the place to search for it. I'm told that most of the games that strive for something like that use the nethack (I think?) method of having premade pieces that are inserted in the maps at certain locations to facilitate gameplay. Having a system to generate interesting gameplay elements for each play session would be cool though. By interesting I mean something more than just chaining upgrades/keys/whatever together to create linear progression (even with multiple paths).
Dromiceius wrote:
Anyway, pretty impressive so far. I'll definetly take a look at the code and possibly contribute something if I find the the time and motivation (coding at work severely diminishes motivation for other coding). Do you happen to any sort of a roadmap one could look for a list of things to be done?
There's a todo.html under /html in the repo.
Ah, thanks. I'll have to take a look later.
"Kids! Bringing about Armageddon can be dangerous. Do not attempt it in your home." ( Pratchett & Gaiman: Good Omens )
Joined: 7/2/2007
Posts: 3960
Thanks for the feedback! I have done some work on varying the rules for map generation depending on the local terrain type; the screenshot I posted doesn't show that well because I only have three terrain types and the one that looks at all different is barely in it. My overall goal is to make the map generation routines flexible and configurable enough that you can create "man-made" structures just by tweaking the rules for tunnel placement, tunnel length/width, and available tunnel features. Check out data/mapgen/zones.py for what I've accomplished so far on that. Here's a screenshot showing a bit more of the "techpipe" terrain type, which enforces axis-aligned tunnels and doesn't use the more irregular tunnel types. It's not perfect (since there's a special rule that breaks the axis-aligned constraint), and it's still not really what I'd call a "structure", but it's closer than the freeform tunnels of the "jungle" and "lava" terrain types. The todo list is mostly being used to mark areas where I've left features unfinished or where I'm not happy with my solution to a given problem. Think of it as the auto-documenting equivalent of writing HACK in the code. It's not a roadmap by any means; I'll be adding that to the wiki when I get a chance.
Pyrel - an open-source rewrite of the Angband roguelike game in Python.
Joined: 8/3/2004
Posts: 380
Location: Finland
Got a chance to look at this. Minor gripe: Missing import sys in enveffectmanager.py Currently though, it fails to launch with the following error:
Loading environment effect water
Failed to load module environments.water : Bad magic number in data/images\effects\environments\water\sprite.pyc
Does Jetblade certain versions of Python / Pygame to function since this seems to originate from the python module loader and not the game code itself?
"Kids! Bringing about Armageddon can be dangerous. Do not attempt it in your home." ( Pratchett & Gaiman: Good Omens )
Joined: 7/2/2007
Posts: 3960
Oh, dear. Thanks for catching that. I'd erroneously included some .pyc files in the initial commit, which allowed those bugs to slip through (and are also why I didn't catch the bug in the first place -- I'd renamed a file from "sprite.py" to "spriteConfig.py" but didn't delete the "sprite.pyc" file). I've just checked in an update that should fix that (removing the .pyc files, and fixing the bugs). You'll need to delete any generated .pyc files in your personal repo. Jetblade assumes Python 2.5, but I don't think the version of PyGame matters.
Pyrel - an open-source rewrite of the Angband roguelike game in Python.
Joined: 8/3/2004
Posts: 380
Location: Finland
Worked fine now with Python 2.6. I think about the only potential breaking changes between 2.5 and 2.6 would be serialization of lists anyway. Found a minor bug while testing it out. Unless, of course, that's how it's supposed to work. I'll see if I can help you out with some of that code in the todo (monster handling seems interesting), though I'm a total disaster when it comes to graphics.
"Kids! Bringing about Armageddon can be dangerous. Do not attempt it in your home." ( Pratchett & Gaiman: Good Omens )
Joined: 7/2/2007
Posts: 3960
Awesome. I've filed the bug. :) Looks like a problem with TerrestrialObject.canGrabLedge(). As for graphics, don't worry about it. Graphics are obviously not going to be everyone's forte. Fortunately, the maleplayer sprite has a fairly wide set of actions available, so it can be used as a placeholder until "real" graphics get made.
Pyrel - an open-source rewrite of the Angband roguelike game in Python.
Senior Moderator
Joined: 8/4/2005
Posts: 5777
Location: Away
Derakon wrote:
Here's a screenshot showing a bit more of the "techpipe" terrain type, which enforces axis-aligned tunnels and doesn't use the more irregular tunnel types.
Ha, that looks very metroidish already.
Warp wrote:
Edit: I think I understand now: It's my avatar, isn't it? It makes me look angry.
Joined: 7/2/2007
Posts: 3960
I set up a project blog for Jetblade so you don't have to read the code checkins list to see what's new. Speaking of which, most of the new stuff is just code cleanup. The codebase is a hell of a lot nicer to work with than it was a month ago when I decided to open-source the project.
Pyrel - an open-source rewrite of the Angband roguelike game in Python.
Zucca
He/Him
Joined: 8/22/2008
Posts: 118
Location: KUUSANKOSKI, Finland
How's the progress nowdays? I tried to run jetblade but I encountered errors. Firstly
$ python3 jetblade.py 
  File "jetblade.py", line 78
    print "Cannot use multiple-map generation with a sourced map file."
                                                                      ^
SyntaxError: invalid syntax
Then using Python 2.7 looked more promising:
$ python2 jetblade.py 

Error compiling Cython file:
------------------------------------------------------------
...

    ## Instantiate a Vector2D. We accept either two coordinates, or a single
    # argument which is assumed to be a tuple or list with at least two 
    # elements. If you want to make a Vector2D from another Vector2D, 
    # use the copy function.
    def __new__(self, first, second = None, magnitude = -1):
   ^
------------------------------------------------------------

vector2d.pyx:17:4: __new__ method of extension type will change semantics in a future version of Pyrex and Cython. Use __cinit__ instead.
/home/zucca/.pyxbld/temp.linux-x86_64-2.7/pyrex/vector2d.c:1:2: error: #error Do not use this file, it is the result of a failed Cython compilation.
Traceback (most recent call last):
  File "jetblade.py", line 108, in <module>
    cProfile.run('run()', 'profiling.txt')
  File "/usr/lib/python2.7/cProfile.py", line 29, in run
    prof = prof.run(statement)
  File "/usr/lib/python2.7/cProfile.py", line 135, in run
    return self.runctx(cmd, dict, dict)
  File "/usr/lib/python2.7/cProfile.py", line 140, in runctx
    exec cmd in globals, locals
  File "<string>", line 1, in <module>
  File "jetblade.py", line 27, in run
    import vector2d
  File "/usr/lib/python2.7/site-packages/pyximport/pyximport.py", line 331, in load_module
    self.pyxbuild_dir)
  File "/usr/lib/python2.7/site-packages/pyximport/pyximport.py", line 183, in load_module
    so_path = build_module(name, pyxfilename, pyxbuild_dir)
  File "/usr/lib/python2.7/site-packages/pyximport/pyximport.py", line 167, in build_module
    reload_support=pyxargs.reload_support)
  File "/usr/lib/python2.7/site-packages/pyximport/pyxbuild.py", line 85, in pyx_to_dll
    dist.run_commands()
  File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/usr/lib/python2.7/site-packages/Cython/Distutils/build_ext.py", line 135, in run
    _build_ext.build_ext.run(self)
  File "/usr/lib/python2.7/distutils/command/build_ext.py", line 340, in run
    self.build_extensions()
  File "/usr/lib/python2.7/site-packages/Cython/Distutils/build_ext.py", line 143, in build_extensions
    self.build_extension(ext)
  File "/usr/lib/python2.7/distutils/command/build_ext.py", line 499, in build_extension
    depends=ext.depends)
  File "/usr/lib/python2.7/distutils/ccompiler.py", line 624, in compile
    self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
  File "/usr/lib/python2.7/distutils/unixccompiler.py", line 180, in _compile
    raise CompileError, msg
ImportError: Building module failed: ["CompileError: command 'gcc' failed with exit status 1\n"]
And finally I even compiled Python 2.5:
$ python2.5 jetblade.py 
Traceback (most recent call last):
  File "jetblade.py", line 3, in <module>
    import splashscreen
  File "/home/zucca/jetblabe-hg/jetblade/splashscreen.py", line 4, in <module>
    import pygame
ImportError: No module named pygame
... which is kinda strange since I have installed pygame and Python 2.7 doesn't complain about it. :P Finally here's some of my system stats:
$ inxi -xv2
System:    Host Mieu Kernel 2.6.39-ARCH x86_64 (64 bit) Desktop LXDE (Openbox 3.4.11.2) Distro Arch Linux
Machine:   System Acer (portable) product Aspire 1810TZ version v1.3314
           Mobo Acer model JM11-MS version Base Board Version
           Bios INSYDE version v1.3314 date 08/31/2010
CPU:       Dual core Intel U4100 (-MCP-) clocked at 1200.00 MHz 
Graphics:  Card: Intel Mobile 4 Series Chipset Integrated Graphics Controller bus-ID: 00:02.0 
           X.Org 1.10.2 driver loaded: intel Resolution 1920x1080@60.0hz 
           GLX Renderer Mesa DRI Mobile Intel GM45 Express Chipset GLX Version 2.1 Mesa 7.10.2 Direct Rendering Yes
Network:   Card-1 Atheros AR8131 Gigabit Ethernet driver atl1c v: 1.0.1.0-NAPI port 2000 bus-ID: 01:00.0
           Card-2 Intel Centrino Wireless-N 1000 driver iwlagn v: in-tree: bus-ID: 02:00.0
Disks:     HDD Total Size: 320.1GB (10.9% used) 1: Hitachi_HTS54503 
Info:      Processes 133 Uptime 1 day Memory 693.4/3870.0MB Runlevel 3 Client Shell inxi 1.6.7
BTW. If I get this working I'm going to write a PKGBUILD of this game for Arch Linux.
trazz wrote:
Killing the skeletons sooner or letting the skeletons live (unlive?) won't affect that at all.
Joined: 7/2/2007
Posts: 3960
Oh, hello. I haven't touched Jetblade in a few months, I'm afraid. I changed the rendering from software (SDL) to OpenGL awhile back, then a few months ago I did a fairly significant overhaul of basic map generation, but that's about it. It's still not really playable -- you can run around in the maps but that's about it, nothing to find or fight. It uses Cython to compile some modules that do fairly significant computations. This gives a noticeable speed boost. Other than that, Pygame, and PyOpenGL, I don't think it has any external dependencies. The plan always was to provide prebuilt standalone executables (using py2app for OSX and py2exe for Windows) so people wouldn't have to deal with setting up their own development environments just to play the game. Of course since it's not playable, that hasn't happened yet. Top things to do right now: * Add powerups and associated barriers to map generation * Add enemies * Give the player proper attack animations
Pyrel - an open-source rewrite of the Angband roguelike game in Python.
Zucca
He/Him
Joined: 8/22/2008
Posts: 118
Location: KUUSANKOSKI, Finland
If could make a working PKGBUILD of Jetblade and post it to AUR (Arch user repository) then maybe more people would start to beta test and contribute to this project... Because I want to see this game actually playable some day. :)
trazz wrote:
Killing the skeletons sooner or letting the skeletons live (unlive?) won't affect that at all.