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)
Cosmologicon on
2013/09/09 14:08:
Looks like it's a bug in python 2.7.3. Fortunately it's an easy fix in this case. Delete the file data/graphics.pkl.
Cosmologicon on
2013/09/09 14:10:
Oops, picked Save too early.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!
cyhawk on
2013/09/09 19:35:
Thanks! Now I get this:Looks like you're doing really advanced stuff. Perhaps I don't have the right library versions.
Mat on
2013/09/09 21:36:
I got a bug after playing for a while :(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
Cosmologicon on
2013/09/09 21:48:
@Mat: Thanks. I suspect that's a one-time thing and won't happen again. The game should be saved in the background every 5 seconds, for just such an occasion. What happens if you just run the game again? Does the bug reappear? If so, I can give you a patch that should fix it.
Cosmologicon on
2013/09/10 14:23:
@cyhawk: Sorry, I'm not able to figure out your issue. It's probably pygame related. If you want to spend some time on it, I can work with you to find a minimal problematic example to take to the pygame people. Otherwise, my only suggestion is to try a different pygame version.
Mat on
2013/09/10 19:52:
Yup, now I get the bug as soon as I run the game :)
Cosmologicon on
2013/09/10 19:59:
Okay it should be as simple as changing line 341 in src/things.py from this:state.stuff.remove(self)
to this:
if self in state.stuff: state.stuff.remove(self)
cyhawk on
2013/09/10 20:46:
Thanks. I'll take a closer look on the weekend!
Mat on
2013/09/15 10:38:
Yep that fixed it.After I did: if self in state.stuff: state.stuff.remove(self)
Cosmologicon on
2013/09/16 03:49:
It looks like you got the indentation wrong. The indentation of that line should match the line previous to it, ie, with two tabs at the beginning of the line. Note that I used tabs, not spaces.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.
cyhawk on
2013/09/21 18:18:
I'm testing on Windows now. I don't have a PrintScreen key, so I cannot show you, but something is wrong with depth testing. It almost looks like it's happening the wrong way around. The bottom of buildings is rendered on top of their tops. Much is covered by the moon itself. Does anyone happen to have a fix for this? (It's still sort of playable at least.)
Cosmologicon on
2013/09/21 19:10:
F12 will take a screenshot.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:
And then this when it's time to draw the HUD:
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.
jerith on
2013/09/21 21:03:
Whoops, I forgot to mention how to set GL_DEPTH_SIZE.Add this line to graphics.py just before the pygame.display.set_mode() call:
cyhawk on
2013/09/21 22:13:
Thanks, that worked perfectly! I also had depth issues with another game (Hungry Hungry Werewolf). Looks like you and me have the stupidest video cards :).
Cosmologicon on
2013/09/21 22:31:
If either of you could post a patch, or your version of the file, or email them to me at Cosmologicon@gmail.com I can incorporate them into the repo for any future users. :)
cyhawk on
2013/09/21 22:57:
I only had to add the gl_set_attribute line before the set_mode line in graphics.py and it worked flawlessly.
jerith on
2013/09/22 08:46:
Here's a diff of my two changes: https://gist.github.com/jerith/6658028
maral on
2013/09/22 12:56:
Thanks cyhawk, I had the very same problem and it's fixed now! I think I'm gonna finish the game now. And big congratulations to Cosmologicon, the victory was well deserved, you did amazing amazing job :)
maral on
2013/09/22 15:29:
Hmmhh... In 3rd level I started getting this errors: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)...
Cosmologicon on
2013/09/22 15:36:
@maral: Look about halfway up on this post, I posted a fix for that issue in response to Mat. Thanks for trying it again!
maral on
2013/09/22 15:40:
Awesome, (yeah, was too lazy too scroll and read everything :D) I think you should include this two fixes into the post-final version and put it here.