Category: Programming

  • [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…)
  • [AoNW] Fog of War: Separating What Exists from What the Player Knows

    Fog of war looks like a visual feature. The map gets darker. Unknown territory disappears. Previously explored land stays dim. Enemy units appear and vanish. It feels like something that belongs mostly to rendering.

    But in AoNW, fog of war is not just an overlay. It is one of the systems that forced me to separate three different ideas:

    • what exists in the game world
    • what a player has discovered
    • what a player can currently see

    That distinction matters everywhere. It affects rendering, selection, movement, combat previews, AI decisions, event visibility, and eventually multiplayer.

    (more…)
  • [AoNW] Rendering a Hex World with Flutter and Flame

    Age of New Worlds is built in Flutter, but the map itself is not a normal Flutter widget tree.

    That was one of the first architectural decisions I had to make. A 4X game has a lot of ordinary UI: menus, panels, buttons, overlays, localization, routing, settings, loading states, and HUD elements. Flutter is excellent for that.

    But the game map is different.

    (more…)
  • [AoNW] Commands, Reducers, and Why the Renderer Does Not Own the Game

    When I started building AoNW, it was tempting to let the map renderer become the center of the game.

    That would have been natural. The renderer is where the player clicks. It knows which hex is under the pointer. It owns the camera, visual layers, hover states, unit markers, movement previews, fog overlays, particles, and the general feeling of interacting with the world.

    But in a 4X game, that is exactly why the renderer should not own the game.

    (more…)
  • [AoNW] My attempt to build a hex-based 4X strategy game with Flutter and Flame

    Age of New Worlds is my attempt to build a hex-based 4X strategy game for iOS, MacOS, Android platforms with the kind of systems I love: exploration, expansion, city growth, production choices, research, turn pressure, and the slow emergence of a readable strategic map.

    At the current stage, the game already has the core loop in place. I can start a match, explore a hex map, found cities, move units, manage production, choose research, improve tiles, handle turn flow, and save or load the game. There is also a map editor and a growing set of developer tools around balance and content iteration.

    The interesting part, at least for this series, is not only what the game does. It is how the project is shaped so it can keep growing.

    (more…)
  • Fast Sylius Plugins Contribution Setup

    If you want to start contributing to a Sylius plugin and don’t want to waste time on manual setup, DDEV is a great tool that helps you configure a working environment in just a few minutes.

    In this post, I’ll show you how to do it using SyliusTpayPlugin as an example. This project is a perfect fit — not only because of its technical specifics, but also because it’s active, you can get valuable code reviews, and it’s a great starting point for your Open Source contributions.

    (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

  • Symfony 7.3 – New features that grabbed my attention

    Symfony 7.3 may be a “minor” release, but these five additions will shave boilerplate off everyday code, boost performance where it hurts and generally make life nicer for Symfony developers.

    (more…)