Panda3D Direct + Astron + Networking - Distributed Objects, Interest Management and Cartesian Grid Demo

I’ve been working with Panda3D’s Direct distributed‑object system and Astron on a larger game project, so I created a small open‑source demo of some of the less obvious features.

Much of direct.distributed originates from Disney’s MMO development, yet newcomers often struggle to see how the pieces fit, especially when Astron serves as the networking backend.

This demo does not use Panda3D’s default CMU ClientRepository/ServerRepository pairing. Instead, it showcases the OTP‑style client/AI/UberDOG architecture built on Astron’s ClientAgent, State Server, and database services.

Panda3D’s CMU‑derived repositories illustrate the basic client/server DO model, including replication and zone interests. OTP, Disney’s game architecture, organizes client, Owner View, AI, and UberDOG roles, world hierarchy, and AI‑owned shards. Astron provides the ClientAgent, Message Director, State Server, and DBSS; the game assigns players to shards, and Astron routes their messages.

GitHub: GitHub - voarsh2/Panda3D-OTP-Networking-Demo: A small, runnable Panda3D world that shows how Direct distributed objects work with Astron: two clients, an UberDOG, an AI, a State Server, zones, and one database-backed object. · GitHub

Demo gif (please excuse the retro look)
611623b8-b1eb-4abd-ba3b-9cb0cf55f94f

The demo uses Panda3D 1.10.16 and Astron, and includes:

  • Client, AI, and UberDOG implementations with DC definitions.
  • Two clients observing AI‑authoritative distributed objects.
  • Owner Views, object generation/disable, and interest management.
  • A database‑backed object that persists across restarts.
  • Client‑managed and AI‑managed Cartesian‑grid interests.
  • A moving distributed object that crosses grid cells, entering and leaving client interest, and is generated or disabled accordingly.
  • Basic unit tests and runnable integration tests against Astron.
  • Documentation and references explaining how the Direct/Astron components fit together, with links to related projects and historical implementations.

Cartesian grid and interest management

The Cartesian grid is probably the most interesting part. It shows how Direct’s existing infrastructure can associate distributed objects with spatial cells and use those cells to manage which objects each client receives.

The example includes both client‑managed and AI‑managed interest windows, with two clients independently observing the same distributed world. Grid and interest regions are visualised, so you can see objects enter and leave interest as observers move between cells.

The demo is small and does not provide a complete MMO framework. It also omits Disney’s later SmoothGridChild/E movement telemetry. That functionality exists in historical Disney‑derived Panda3D forks, such as Sunrise’s disney_stable branch, which I’ve linked for anyone interested in more advanced grid‑movement implementations.

Existing work and related discussions

Useful examples of Direct and Astron networking already exist:

Applications typically supply or extend their own client, AI, and UberDOG repositories, with game-specific lifecycle handling. For examples of this separation of concerns, see Sunrise’s OTPClientRepository, PiratesClientRepository, and AIRepository.

My aim is to provide a smaller, focused reference where individual distributed‑object behaviours can be observed without digging through a complete game.

Older discussions that seemed relevant:

The last discussion was especially relevant to my interest in demonstrating what the older grid functionality can actually do.

Documentation and test coverage

One challenge with direct.distributed is understanding how its components are intended to work together. I wonder whether the distributed‑networking documentation could benefit from a clearer introduction to Astron and links to community‑maintained examples of this architecture. Panda3D’s docs cover the CMU‑derived DO and zone‑interest path, but I haven’t found a comparably small, runnable walkthrough showing how the OTP/Astron service roles fit together.

I’ve added tests covering:

  • Cartesian‑grid coordinate mapping
  • Interest windows
  • Object behaviour and location transitions

plus integration tests that exercise the actual Astron setup.

Given the earlier discussions about grid functionality and test coverage, I’m curious whether maintainers would find a small set of isolated upstream regression tests useful, particularly for CartesianGridBase, GridParent, and distributed‑object location changes.

I’d love to hear whether anyone finds the demo useful, especially the Cartesian‑grid examples, and whether there are other small examples of this functionality that I’ve missed.

I’ve been using this stack in my own projects, so I’ve also tried to incorporate some of the practical gotchas I’ve encountered, particularly around distributed‑object lifecycles, interest management, and grid‑cell transitions.

It’s an old system, but there’s still plenty of interesting functionality worth making more accessible. :slight_smile:

6 Likes