Eclipsed - entry submitted
My game is submitted!It requires pygame, pyopengl, and numpy. (If you're on Ubuntu check out this post I made for installing tons of dependencies at once - some good info in the responses too.) I haven't used pyopengl since PyWeek 10, but the gameplay this time really called for 3D so I went for it.
Other than that, I don't have much to say. Just making this post so that people with bug reports have a place for them. Enjoy!
(log in to comment)
Comments
a bug in python 2.7.3. Fortunately it's an easy fix in this case. Delete the file data/graphics.pkl.
Looks like it's Looks like it's due to a bug in python 2.7.3. Fortunately it's an easy fix in this case. Delete the file data/graphics.pkl. The first time you run the game, it might take a minute or two to load because it's remaking all the graphical models. After that it should load quickly, though.
Let me know if that doesn't work. Thanks for trying the game!
Traceback (most recent call last):
File "run_game.py", line 4, in <module>
main.main()
File "src/main.py", line 31, in main
s.draw()
File "src/scenes/menu.py", line 95, in draw
hud.draw()
File "src/hud.py", line 566, in draw
b.draw()
File "src/hud.py", line 66, in draw
text.write(self.words, self.fontname, self.size, self.color, (x, y), None, 0, 1)
File "src/text.py", line 166, in write
texture = gettexture(text, fontname, size, color, bcolor)
File "src/text.py", line 133, in gettexture
textures[key] = Texture(text, fontname, size, color, bcolor)
File "src/text.py", line 63, in __init__
self.maketexture(surf)
File "src/text.py", line 68, in maketexture
numpy.reshape(pygame.surfarray.pixels3d(surf), [sw * sh, 3]),
File "/Library/Python/2.7/site-packages/pygame/surfarray.py", line 190, in pixels3d
return numpysf.pixels3d (surface)
File "/Library/Python/2.7/site-packages/pygame/_numpysurfarray.py", line 133, in pixels3d
return numpy_array(surface.get_view('3'), copy=False)
ValueError: unsupport colormasks for 3D reference array
Looks like you're doing really advanced stuff. Perhaps I don't have the right library versions.
Looks like you're doing really advanced stuff. Perhaps I don't have the right library versions.
Traceback (most recent call last):
File "run_game.py", line 4, in <module>
main.main()
File "src/main.py", line 29, in main
s.think(tdt, pygame.event.get(), pygame.key.get_pressed())
File "src/scenes/game.py", line 127, in think
obj.think(dtobj)
File "src/things.py", line 157, in think
self.arrive(self.target)
File "src/things.py", line 114, in arrive
where.receive(self)
File "src/things.py", line 341, in receive
state.stuff.remove(self)
ValueError: list.remove(x): x not in list
state.stuff.remove(self)
to this:
if self in state.stuff: state.stuff.remove(self)
Traceback (most recent call last):
File "/Volumes/Mac2/Users/leif/Downloads/eclipsed/run_game.py", line 3, in <module>
import main
File "src/main.py", line 6, in <module>
import scene, settings, scenes.game, scenes.menu, graphics, sound, state
File "src/scenes/game.py", line 6, in <module>
import scene, settings, random, graphics, camera, text, things, state, cursor, hud, lighting, info, sound
File "src/graphics.py", line 8, in <module>
import scene, settings, state, data
File "src/state.py", line 2, in <module>
import things, settings, info, text, sound, random, data
File "src/things.py", line 320, in <module>
class Material(Thing):
File "src/things.py", line 341, in Material
if self in state.stuff: state.stuff.remove(self)
NameError: name 'self' is not defined
After I did: if self in state.stuff: state.stuff.remove(self)
After I did: if self in state.stuff: state.stuff.remove(self)
If you don't think that's it, please post your entire things.py file (on pastebin or wherever) exactly as it is and I'll take a look.
A lot of OpenGL is unfamiliar to me, so it's very possible that I made a mistake. I pretty much just tried stuff until it worked. Basically all I do as far as depth is concerned is put this at the beginning of the draw loop:
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
glEnable(GL_DEPTH_TEST)
And then this when it's time to draw the HUD:
And then this when it's time to draw the HUD:
glDisable(GL_DEPTH_TEST)
Setting GL_DEPTH_SIZE to 32 fixes the weird rendering issues I was having. (Another game had a similar problem but the symptoms were a bit different.)
I also had to replace the call to pygame.surfarray.pixels3d() with a call to pygame.surfarray.array3d(). I'm not sure if the pixels_alpha() call on the next line also needs replacing with the array equivalent, but I did it anyway.
cyhawk, this might sort out your issues as well.
I also had to replace the call to pygame.surfarray.pixels3d() with a call to pygame.surfarray.array3d(). I'm not sure if the pixels_alpha() call on the next line also needs replacing with the array equivalent, but I did it anyway.
cyhawk, this might sort out your issues as well.
Add this line to graphics.py just before the pygame.display.set_mode() call:
pygame.display.gl_set_attribute(pygame.GL_DEPTH_SIZE, 32)
Traceback (most recent call last):
File "C:\Users\Marek\Downloads\pyweek\eclipsed-v2\eclipsed-v2\eclipsed\run_game.py", line 4, in <module>
main.main()
File "src\main.py", line 29, in main
s.think(tdt, pygame.event.get(), pygame.key.get_pressed())
File "src\scenes\game.py", line 127, in think
obj.think(dtobj)
File "src\things.py", line 157, in think
self.arrive(self.target)
File "src\things.py", line 114, in arrive
where.receive(self)
File "src\things.py", line 341, in receive
state.stuff.remove(self)
ValueError: list.remove(x): x not in list
The worse thing is I cannot get rid of them, since when I run the game again the error comes again in about 1 second... That means I had better correct that then just erasing my saves (can happen again)...
The worse thing is I cannot get rid of them, since when I run the game again the error comes again in about 1 second... That means I had better correct that then just erasing my saves (can happen again)...
cyhawk on 2013/09/09 12:25: