⚠️ Beta State

PyBevy is in an early and experimental stage. The API is incomplete, subject to breaking changes without notice, and you should expect bugs. Many features are still under development.

PyBevy vs. Other Frameworks

A comparison of pybevy's philosophy to other Python game libraries.

Introduction

How does pybevy fit into the Python game development ecosystem? This guide provides a high-level comparison to help you choose the right tool for your project.

PyBevy vs. Pygame

Pygame is one of the most well-known and established Python game libraries. It's simple, direct, and great for learning.

  • Architecture: Pygame is imperative and generally object-oriented. You typically have a main game loop where you handle events, update your game objects, and draw everything to the screen, in that order.
  • State Management: State is often managed manually in global variables, dictionaries, or within your game object classes.
  • Rendering: Pygame provides a simple 2D software-based rendering API.

PyBevy's Approach:

  • Architecture: pybevy is declarative and data-oriented, using an Entity Component System (ECS). You define components (data) and systems (logic), and the engine handles the loop and parallelism.
  • State Management: State is explicitly managed through ECS Components and Resources. This makes state easier to track and reason about in larger projects.
  • Rendering: pybevy uses the Bevy Engine, which provides a modern, high-performance renderer that supports both 2D and 3D, and can use the GPU effectively.

When to choose which?

  • Pygame: Excellent for beginners, smaller projects, and when you want a simple, direct, and imperative control loop.
  • PyBevy: A better fit for larger, more complex games where performance and code organization are critical. The ECS architecture scales much better.

PyBevy vs. Godot (with Python/GDScript)

Godot is a full-featured, open-source game engine with a powerful editor.

  • Architecture: Godot is scene-tree based. Everything is a Node, and you build your game by composing nodes in a tree. Logic is added via scripts (usually GDScript or C#) attached to these nodes.
  • Workflow: Godot is editor-first. Most of your work, from level design to UI layout, is done in the visual editor.
  • Rendering: Godot has its own highly-optimized 2D and 3D renderers with a rich feature set.

PyBevy's Approach:

  • Architecture: pybevy is code-first and ECS-based. The "scene" is defined by the entities and components you spawn in your code.
  • Workflow: Your primary tool is your code editor. While you can load scenes (e.g., from Blender via glTF), the core logic and structure are defined in Python.
  • Rendering: pybevy leverages Bevy's renderer, which is also modern and powerful, but the feature set may differ from Godot's.

When to choose which?

  • Godot: Ideal for developers and teams who prefer a visual, editor-driven workflow. It's an all-in-one package that is fantastic for rapid prototyping and for artists and designers to participate directly.
  • PyBevy: A great choice for developers who prefer a code-centric approach, want the specific performance benefits of Bevy's ECS, or are building tools and simulations where a heavy editor is not needed.

PyBevy vs. Panda3D

Panda3D is a powerful, open-source 3D game engine with a long history.

  • Architecture: Panda3D uses a traditional scene graph, which is a hierarchical tree of nodes (similar to Godot, but typically managed more from code).
  • State Management: Generally follows an object-oriented model, where game objects are classes with their own state and methods.
  • Rendering: A mature and flexible 3D rendering engine.

PyBevy's Approach:

  • Architecture: pybevy's ECS is fundamentally different from a scene graph. In a scene graph, logic and data are often tied to the nodes in the hierarchy. In ECS, logic (systems) is decoupled from data (components).
  • Modernity: pybevy is built on Bevy, which uses modern graphics APIs (like Vulkan, Metal, DX12) and a modern language (Rust). This can lead to significant performance advantages.

When to choose which?

  • Panda3D: A solid, mature choice for complex 3D games, especially if you are already comfortable with traditional OOP and scene graph architectures.
  • PyBevy: A more modern alternative for those interested in the data-oriented design of ECS and the performance potential of the Bevy/Rust ecosystem.

Conclusion

Choose pybevy if:

  • You love Python but want the performance of a modern Rust engine.
  • You believe in a data-oriented, code-first approach to development.
  • You are building a game or simulation where scalability and performance are key.
  • You enjoy the flexibility of composing behavior from small, reusable components.
# This file is for explanation only and does not contain runnable code.
pass