Category: DDD

  • [AoNW] From Hotseat to Multiplayer: Making the Server Authoritative

    Age of New Worlds started with local play. That was the right place to begin. A 4X game already has enough moving parts before networking enters the picture: turns, units, cities, production, research, fog of war, saves, UI state, and AI. Adding multiplayer too early can turn every feature into a distributed-systems problem.

    But I did not want local play to become a dead end.

    So even while the game focused on hotseat, I tried to shape the architecture around a future server-backed model. The main rule was simple:

    Local play can be convenient, but multiplayer must be authoritative.

    (more…)
  • [AoNW] Saving game: Snapshots, Event Logs, and Migrations

    Saving a sounds simple until the game starts becoming a real 4X game.At the beginning, it is tempting to think of saving as one operation:

    jsonEncode(gameState)

    That works for a prototype. It does not work for long.

    (more…)
  • [AoNW] The Domain and Application Layers: Where the Game Actually Lives

    A 4X has many different kinds of decisions. Some are game rules. Some are player workflow. Some are persistence. Some are rendering. Some are network concerns. If I let all of them live in the same place, every new feature becomes harder than it should be.

    So the project uses a DDD-inspired split between the domain layer and the application layer.

    The domain layer answers: what is true in the game?

    The application layer answers: how do I perform a use case around that truth?

    (more…)
  • [AoNW] General Architecture Overview

    Age of New Worlds is strongly DDD-inspired. I use domain boundaries, application ports, infrastructure adapters, commands, events, projections, and persistent snapshots because a 4X game becomes complicated very quickly. The architecture is there to answer one question:

    How do I keep the game understandable when rendering, UI, AI, saving, hotseat play, and multiplayer all want to touch the same state?

    (more…)
  • Experimenting with Event Sourcing and Ecotone

    I’ve just published a new repo, a side project where I’m experimenting with Event Sourcing, CQRS, and the Ecotone framework in a Symfony 7 environment.

    This is a personal learning project, not something production-ready. The goal is to better understand how to design event-driven systems in PHP using real-world structures like aggregates, value objects, and projections. As a playground, I’m building a turn-based strategy game (inspired by Civilization) -just enough to have a meaningful domain to model.

    Right now, the repo includes:

    • Symfony 7.3 backend with Ecotone (commands, events, projections),
    • Early frontend setup using Vite, Symfony UX and PixiJS for rendering a hex map,
    • A bunch of evolving domain logic for turns, players, and cities.

    Again – this is an experimental setup for learning, so expect the code to change frequently. But if you’re also exploring Ecotone or curious how event sourcing might work in a Symfony project, feel free to check it out, leave feedback, or just follow along.

    github.com/ernestwisniewski/symfony-of-ages

  • Projections – Transforming Events into Read Models

    In an event-sourced architecture, the entire history of changes to the application’s state is stored as a sequence of events. However, to effectively work with this data, we often need optimized read models. This is where projections come into play. In today’s post, I’ll show you how to set up and implement projections in Ecotone, allowing you to easily transform events into the current state of your system.

    (more…)
  • Strategic DDD – Key Building Blocks and Their Role in Architecture

    Domain-Driven Design is an approach that helps build software reflecting real-world business logic. Within DDD, we distinguish building blocks – essential elements of domain modeling. Here’s their breakdown and application.

    (more…)
  • Introduction to Domain-Driven Design: What Benefits Does It Bring to Business?

    In the world of rapidly changing business requirements, creating software that effectively meets user needs is a key challenge. This is where Domain-Driven Design (DDD) comes in—a methodology that places the business domain at the center of the application design process.

    (more…)