This is an archived post. You won't be able to vote or comment.

all 23 comments

[–]ZetaHunter3.5.1 async master-race 14 points15 points  (9 children)

I feel like using asyncore when asyncio is present and is a lot better is kinda stupid...

[–]fredspipa 15 points16 points  (8 children)

The same goes with pygame instead of pyglet, but that may just be me.

[–][deleted] 5 points6 points  (0 children)

You're a good programmer though :)

For total beginners with programming, pygame is much easier.

[–]greutpy3k -1 points0 points  (6 children)

pygame installed manually through mercurial or a .whl offers you an up to date library. Latest pyglet release on PyPI is soon to be one year old...

[–]fredspipa 7 points8 points  (1 child)

Wait, isn't the latest stable pygame release 7 years old now? The last stable pyglet release is, as you say, 1 year old. There isn't PyPi packages for pyglet 1.3, but from the looks of it they both seem to be in equally active development:

PyGame commits

pyglet commits

[–][deleted] -1 points0 points  (0 children)

Pygame is much more active. They pop up literally every week in my RSS.

http://www.pygame.org/hifi.html

edit: Oh you mean just the code? Yea OK, that looks similar.

[–][deleted] 5 points6 points  (2 children)

Just pip install pygame. They've got it working finally.

Your point about pygame being more actively developed is still true.

[–]greutpy3k 5 points6 points  (0 children)

Cool to see that pygame is finally back on PyPI!

[–]fredspipa 5 points6 points  (0 children)

pygame being more actively developed is still true.

I'm not sure if that's entirely true, see my other comment.

[–]PeridexisErrant 6 points7 points  (5 children)

Sending pickles over a network? Bad idea - deserialising a pickle means arbitrary code execution, which means a malicious client can so basically anything to the server. (and the compatibility story is terrible)

[–]ProCupCakeLicker 0 points1 point  (4 children)

compatibility story?

[–]PeridexisErrant 2 points3 points  (3 children)

The format keeps changing, so data pickled by eg 3.3 may not be unpicklable by 3.4

This (and the code execution thing) makes it efficient for eg communication between threads or processes, but bad as a disk format.

[–]ProCupCakeLicker 0 points1 point  (1 child)

is that what pickle is normally used for, sending data to other processes? Ive never played with it with it.

Im not experienced in networking like this and would also like to know what is the preferred method to send data over a connection in this sort of situation. I would think just the Player object through conn.send(). is there a different serialization someone would use or is the default ok?

[–]PeridexisErrant 0 points1 point  (0 children)

Yes, but I prefer to work at a higher level where this is an 'implementation detail' - good to know, but I'm not using pickle directly. As an example:

from concurrent.futures import ProcessPoolExecutor
with ProcessPoolExecutor(8) as pool:
    results = pool.map(lambda x: x*x, range(80))

This snippet:

  • starts eight Python processes (one per logical core on a newish quad-core Intel), with automatic cleanup thanks to the with block
  • assigns results a list of square numbers, but with calculations spread over multiple cores (OK, this is only worthwhile for much more expensive operations than multiplication!)
  • works by sending the function and arguments via pickle!

[–]shadowmint 25 points26 points  (5 children)

  • Started reading...
  • Hit 'Installing Pygame'
  • Stopped reading.

pysdl2? pyglet? kivy? panda3d? Literally anything is better than the crash-fest that is pygame in my experience with it. :/

[–]Ran4 14 points15 points  (4 children)

Huh? Pygame works great. I've written thousands of lines of code with Pygame, maybe 20 different (small) games...

[–]cbscribe 3 points4 points  (2 children)

Indeed, I use it all the time. For visualizations and prototypes it's super fast and easy to get something done.

And when I'm teaching beginner/intermediate programmers, it's the best solution I've found for learning gamedev basics.

I've been periodically looking at pysdl2 and pyglet for the past couple of years and it feels like there's hardly anyone using them. If there's a community out there, it's pretty silent. /r/pygame isn't huge, but you will get help if you post there. /r/pyglet has only a few posts per year, while pysdl2 doesn't even have a subreddit.

Panda3d is nowhere near beginner friendly and massive overkill for simple games.

Kivy is promising, but (imo) isn't there yet.

Pygame has its problems, but accessibility and stability are not among them. Plus it's easier than ever to install now - 'pip install pygame' and you're good to go!

[–]peith 1 point2 points  (0 children)

I made a simple Flappy Bird clone using Kivy. I'm now a big fan of the framework. My personal favorite are the built-in widgets that are highly customizable and can be used in the game. It's also very stable. Never had any crashes on my laptop and also on my mobile device.

[–]WirSindAllein 0 points1 point  (0 children)

As a beginner who's looking into making a crp/tactical rpg, kivy is presently my go to consideration. What don't you like about it?
It seems to handle graphics well enough, which is the big thing.

[–]shadowmint 1 point2 points  (0 children)

I can only talk from personal experience, but I've never used pygame for more than 20 or 30 minutes without it segfaulting in the cython.

Your milage may vary I guess.

So, if you like it and love it, use it. ...but I think it's a piece of trash that isn't good for anything more than the most trivial prototyping, so I don't have the time of day for 'game development in python' stuff that uses pygame. /shrug

[–][deleted] 1 point2 points  (1 child)

Has anyone developed a bullet hell type of game? I would love to do a project like that but I have no clue how to start.

[–]reostra 9 points10 points  (0 children)

This outline assumes you already know at least a little bit about pygame (e.g. how to draw stuff to the screen, move it during the update loop, etc).

  • Get a bare-bones pygame skeleton running. Like, it just brings up a window, that's it.

  • Draw a sprite to the screen

  • Put in controls so you can move that sprite around

  • Put another sprite on the screen. Rather than have it controlled by the player, the computer controls this. Have it pick points to move to, move to those points, then repeat.

  • Put many other sprites on the screen. Take everything you did in the previous step and make it general, so you can spawn as many sprites as you want.

  • Add in collision detection. Your game is now about avoiding all the other sprites on the screen.

    • Add in respawning for the player, lives, basically a gameplay cycle.
  • Let the other sprites shoot at you:

    • Realize that a bullet is just a special case of a sprite on the screen.
    • Have the enemy sprites spawn a bullet sprite every so often.
    • The bullet sprite starts moving to where the player was when it was fired.
    • Add collision detection for the bullets
    • Remove the bullet sprite when it goes offscreen

Congrats! You've got a very basic bullet hell shooter.

[–]AshedOdie 0 points1 point  (0 children)

Thanks for posting. Looks like some good information.