Talks - Esther Alter: Procedurally Generated Monsters! A complete example of Python game development

Learn how Esther Alter built a full 2D game using Python, PyGameCE, and procedural generation to create unique monsters, worlds, and gameplay elements from scratch.

Key takeaways
  • Python can be an excellent choice for 2D game development, offering convenience and rapid prototyping capabilities despite performance limitations

  • PyGameCE (Community Edition) provides pixel-perfect rendering and excellent documentation, making it ideal for 2D games - though it’s slower than engines like Unity

  • Procedural generation was extensively used to create unique content including:

    • Monster sprites and stats
    • World maps and tiles
    • Battle animations and moves
    • NPC characters and dialogue
    • Audio effects
  • Code organization was critical for success:

    • Main game loop uses a renderer class system
    • Commands abstract rendering operations
    • NumPy handles image processing before PyGameCE rendering
    • Test scripts can target specific renderers as entry points
  • Development constraints and insights:

    • Game took 9 months from first commit to Steam release
    • Total development cost was $100 (Steam fee)
    • Python’s limitations forced creative solutions
    • Clean code organization made debugging easier
    • Cross-platform deployment was challenging
  • The “10,000 bowls of oatmeal problem” - procedural generation can create endless variations but maintaining interest is challenging

  • Avoided using AI/ML in favor of simpler procedural generation techniques

  • Key libraries:

    • PyGameCE for core game functions
    • NumPy for efficient image manipulation
    • PIL for image processing
    • H5Py for data handling
  • Game testing was simplified by Python’s ability to create quick entry points to any game state

  • Cross-platform deployment remains Python’s biggest weakness for game development, requiring separate compilation for each OS