Addendum
Also I'd like to point out that the abyss after the third screen is intentional, and represents the emptiness of life. You're slightly confused, none of it makes sense, and then you fall off a cliff. I don't like to reward players, I like to make them think and feel.(log in to comment)
Comments
Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56)
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pickle
>>> pickle.load(open("data/rabbit.skel", "rb"))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.6/pickle.py", line 1370, in load
return Unpickler(file).load()
File "/usr/lib/python2.6/pickle.py", line 858, in load
dispatch[key](self)
File "/usr/lib/python2.6/pickle.py", line 1069, in load_inst
klass = self.find_class(module, name)
File "/usr/lib/python2.6/pickle.py", line 1126, in find_class
klass = getattr(mod, name)
AttributeError: 'module' object has no attribute 'Joint'
Traceback (most recent call last):
File "src/main.py", line 3, in <module>
import squirtle
File "src/squirtle/__init__.py", line 3, in <module>
from svg import *
File "src/squirtle/svg.py", line 27, in <module>
from gradient import *
File "src/squirtle/gradient.py", line 12, in <module>
radial_shader = shader.MakeProgramFromSource("Radial Shader", vertex_shader_src, radial_shader_src)
File "src/squirtle/shader.py", line 169, in MakeProgramFromSource
vs = MakeVertexShaderFromSource(name, vertex_shader_src )
File "src/squirtle/shader.py", line 151, in MakeVertexShaderFromSource
return MakeShaderFromSource(name, src, GL_VERTEX_SHADER_ARB )
File "squirtle/shader.py", line 156, in MakeShaderFromSource
shader.compileShader()
File "squirtle/shader.py", line 31, in compileShader
glGetObjectParameterivARB (self.shaderObject, GL_OBJECT_COMPILE_STATUS_ARB, ctypes.pointer(rval))
ctypes.ArgumentError: argument 3: <type 'exceptions.TypeError'>: expected LP_c_int instance instead of LP_c_long
Traceback (most recent call last):
File "run_game.py", line 4, in <module>
File "src\main.pyo", line 103, in main
File "src\main.pyo", line 43, in init
File "src\level.pyo", line 29, in __init__
File "src\isomap.pyo", line 25, in __init__
IOError: [Errno 2] No such file or directory: 'src/vertex.glsl'
Traceback (most recent call last):
File "run_game.py", line 4, in <module>
File "src\main.pyo", line 102, in main
File "pyglet\window\win32\__init__.pyo", line 423, in __init__
File "pyglet\window\__init__.pyo", line 644, in __init__
File "pyglet\window\__init__.pyo", line 290, in get_best_config
pyglet.window.NoSuchConfigException
Traceback (most recent call last):
File "run_game.py", line 4, in <module>
File "src\main.pyo", line 102, in main
File "pyglet\window\win32\__init__.pyo", line 423, in __init__
File "pyglet\window\__init__.pyo", line 644, in __init__
File "pyglet\window\__init__.pyo", line 290, in get_best_config
pyglet.window.NoSuchConfigException
Any help would be greatly appreciated!
I had to edit settings.py and turn on fullscreen to get a usable display, though.
cyhawk, hidas: I didn't get your errors, so I can't help there. Sorry.
=== added file 'run_game.py'
--- run_game.py 1970-01-01 00:00:00 +0000
+++ run_game.py 2011-09-25 16:14:04 +0000
@@ -0,0 +1,6 @@
+#!/usr/bin/env python
+
+from src.animation import Keyframe, Joint
+from src.main import main
+
+main()
=== modified file 'src/animation.py'
--- src/animation.py 2011-09-25 15:40:30 +0000
+++ src/animation.py 2011-09-25 16:11:48 +0000
@@ -6,7 +6,7 @@ import squirtle
import os
from math import cos, sin, radians
-data_path = 'data\\char\\'
+data_path = os.path.join('data', 'char', '')
images = {}
def LoadImages():
global images
=== modified file 'src/grfx.py'
--- src/grfx.py 2011-09-25 15:40:30 +0000
+++ src/grfx.py 2011-09-25 16:08:38 +0000
@@ -17,7 +17,7 @@ class DisplayList(object):
class FramebufferObject(object):
def __init__(self, w, h):
- x = ctypes.c_ulong()
+ x = ctypes.c_uint()
px = ctypes.pointer(x)
gl.glGenFramebuffersEXT(1, px)
self.id = x.value
=== modified file 'src/squirtle/shader.py'
--- src/squirtle/shader.py 2011-09-25 15:40:30 +0000
+++ src/squirtle/shader.py 2011-09-25 16:07:46 +0000
@@ -27,7 +27,7 @@ class Shader(object):
def compileShader( self ):
glCompileShader( self.shaderObject )
- rval = ctypes.c_long()
+ rval = ctypes.c_int()
glGetObjectParameterivARB (self.shaderObject, GL_OBJECT_COMPILE_STATUS_ARB, ctypes.pointer(rval))
if rval:
print "%s compiled successfuly." % (self.name)
cyhawk: The problem was that GLints are int, not long, but int == long on i386, which is probably why the author didn't notice.
hidas: I also get your issue on my desktop (which uses the nouveau driver, and thus doesn't have great 3D support). I can work around it by not requesting multisample buffers, but that results in pretty broken graphics. It's totally unusable on my laptop with Intel graphics.
=== modified file 'src/main.py'
--- src/main.py 2011-09-25 15:40:30 +0000
+++ src/main.py 2011-09-25 16:29:48 +0000
@@ -90,7 +90,7 @@ class MainWindow(pyglet.window.Window):
def main():
- config = pyglet.gl.Config(sample_buffers=1, samples=4)
+ config = pyglet.gl.Config()
if settings.current.fullscreen:
mw = MainWindow(vsync=0,
fullscreen=settings.current.fullscreen)
Traceback (most recent call last):
File "_ctypes/callbacks.c", line 295, in 'calling callback function'
File "src/squirtle/svg.py", line 617, in combineCallback
dataOut[0] = cast(pointer(data), POINTER(GLvoid))
NameError: global name 'pointer' is not defined
Traceback (most recent call last):
File "src/main.py", line 6, in <module>
import scene, level
File "src/level.py", line 13, in <module>
import animation
File "src/animation.py", line 162, in <module>
LoadImages()
File "src/animation.py", line 17, in LoadImages
images[f] = squirtle.SVG(data_path + f, 'left', 'bottom', invert_y=True)
File "src/squirtle/svg.py", line 126, in __init__
self.generate_disp_list()
File "src/squirtle/svg.py", line 175, in generate_disp_list
self.render_slowly()
File "src/squirtle/svg.py", line 231, in render_slowly
if g: g.apply_shader(transform)
File "src/squirtle/gradient.py", line 121, in apply_shader
linear_shader.uniformMatrixf("worldTransform", False, svg_matrix_to_gl_matrix(transform))
File "src/squirtle/shader.py", line 137, in uniformMatrixf
self.uniformVars[name].set()
File "src/squirtle/shader.py", line 61, in set
self.setFunction( self.name, *self.values )
File "src/squirtle/shader.py", line 134, in _set_uniform
f(location, 1, transpose, cast(matrix, ctypes.POINTER(ctypes.c_float) ))
NameError: global name 'cast' is not defined
I wonder how you didn't get them — these look like something that would never work on any system. Maybe your version of pyglet.gl leaks ctypes.cast and ctypes.pointer.
Anyway it works now. I can roll to the right and down the rabbit's hole!
Cosmologicon on 2011/09/18 16:42:
Ha, I'm looking forward to playing it! :)Your packaging has a couple of issues on Linux. There's no python file to launch the game from. You've got run_game.exe but no run_game.py. I added "main()" to the end of main.py and then ran it with python src/main.py.
Also in your animation.py module you have data_path = "data\\char\\", which doesn't work on systems where the directory separator is not a backslash. Prefer os.path.join("data", "char", "")