{"slug": "building-a-live-observatory-for-an-ai-civilization-simulator-was-harder-than-i", "title": "Building a Live Observatory for an AI Civilization Simulator Was Harder Than I Expected — TPECKA180", "summary": "Independent developer TPECKA180 built Living Planet Global Observatory, a public website that receives structured telemetry from a local-language-model-driven civilization simulator running on the developer's own computer. The simulator, Living Planet, uses Python and Pygame with local LLMs controlling countries' economic, diplomatic and military decisions, and the developer kept the game fully functional offline by creating a separate Broadcast Edition and a one-way telemetry pipeline in which the simulation remains authoritative and the site only observes.", "body_md": "I'm TPECKA180, an independent developer working on Living Planet, an experimental civilization simulator powered by local language models.\n\nIn my previous articles, I discussed autonomous AI civilizations and my plans to eventually let them learn from their own decisions.\n\nThis time, I want to talk about a completely different engineering challenge: building a public website that receives and displays data from a simulation running on my personal computer.\n\nThe idea sounded relatively simple.\n\nThe implementation turned out to be considerably more complicated.\n\nLiving Planet is a simulation built with Python and Pygame in which independent countries are controlled by local language models.\n\nCountries make decisions about economic development, diplomacy, research, territorial expansion and military conflicts. The game engine validates their proposed actions and determines the consequences.\n\nWhile developing the simulation, I started thinking about how interesting it would be to let other people observe these artificial civilizations without requiring them to download the game or run a language model themselves.\n\nImagine opening a website and watching an artificial civilization develop over several days or weeks.\n\nYou could observe economic growth, military conflicts, diplomatic changes, technological discoveries and unexpected strategic decisions.\n\nThat idea became Living Planet Global Observatory.\n\nThe important distinction is that I don't want the website to display prerecorded scenarios or randomly generated statistics.\n\nI want it to receive information from an actual simulation running on my computer.\n\nThe obvious solution would be to stream the game as video.\n\nHowever, video has several limitations.\n\nViewers cannot easily explore historical economic data, compare countries, examine individual events or interact with charts.\n\nA video stream shows what is currently visible on the screen, but it doesn't provide structured access to the simulation's underlying state.\n\nInstead, I wanted to transmit structured telemetry.\n\nThe website should eventually receive information such as:\n\nThis transforms the website from a simple viewing platform into something closer to an experimental research dashboard.\n\nUnfortunately, it also introduces an entirely new set of problems.\n\nOne of my most important requirements is that the game must remain fully functional without the website.\n\nLiving Planet was designed to run locally. I don't want its core simulation to depend on an internet connection or a remote service.\n\nIf the website becomes unavailable, the game should continue.\n\nIf a telemetry request fails, the simulation should continue.\n\nIf my internet connection disappears halfway through a simulation day, that should not prevent countries from making their decisions.\n\nThis requirement led to the decision to create a separate Broadcast Edition rather than immediately modifying the stable public release.\n\nThe experimental edition can be developed and tested independently while preserving the existing game.\n\nConceptually, the architecture looks like this:\n\n```\nLOCAL COMPUTER\n    |\n    |-- Living Planet simulation\n    |-- Local language model\n    |-- Local database\n    |-- Telemetry module\n    |\n    v\nBroadcast protocol\n    |\n    v\nRemote telemetry receiver\n    |\n    v\nGlobal Observatory\n    |\n    |-- Live world\n    |-- Historical data\n    |-- Economic charts\n    |-- AI performance analytics\n```\n\nThe simulation remains the authority over the world.\n\nThe website is an observer, not a participant.\n\nOne of the first architectural questions was determining what information should actually leave the computer.\n\nThe game contains much more information than a public dashboard needs.\n\nThere are internal simulation structures, model contexts, private country information, hidden prompts, intermediate outputs and implementation-specific details.\n\nSending everything would be a poor design decision.\n\nIt would increase network traffic, expose unnecessary information and make the website heavily dependent on the internal architecture of the game.\n\nInstead, the telemetry system needs a clearly defined public representation of the simulation.\n\nThe website should receive only the information explicitly intended for publication.\n\nFor the experimental Broadcast Edition, hidden prompts, internal reasoning and raw model outputs are excluded from public telemetry.\n\nThe objective is to observe the consequences of AI decisions, not expose every internal component involved in producing them.\n\nAnother challenge is determining how often the game should transmit information.\n\nSending the entire world state after every minor change would be inefficient.\n\nOn the other hand, sending only individual changes introduces synchronization problems.\n\nImagine a website receives information about a country's economy, but misses the previous update that changed its territorial ownership.\n\nIt may then display a combination of data that never actually existed in the simulation.\n\nTo address this problem, the experimental telemetry architecture uses snapshots and incremental updates, also known as deltas.\n\nA snapshot represents a defined state of the simulation.\n\nA delta describes changes relative to a previous state.\n\nThe advantage of this approach is that the system can potentially avoid repeatedly transmitting unchanged information.\n\nThe disadvantage is that incremental updates require careful handling of ordering, missing messages and recovery.\n\nA receiver needs to know whether an incoming update belongs to its current state.\n\nIf something is missing, applying subsequent updates blindly could produce incorrect results.\n\nOne possible recovery strategy is to request or wait for a new complete snapshot rather than attempting to reconstruct an unknown state.\n\nThis is one of the reasons why designing a telemetry system is substantially more difficult than simply exporting a JSON file.\n\nThe experimental Broadcast Edition introduced a protocol called LPTP v1, or Living Planet Telemetry Protocol.\n\nThe purpose of defining a protocol is to establish a predictable contract between the game and the observation system.\n\nThe website should not need to understand every internal Python object used by the game.\n\nInstead, it should understand a documented telemetry representation.\n\nThe protocol needs to address several important questions:\n\nWithout such a contract, every significant game update could potentially break the website.\n\nThe initial development work included protocol documentation, schemas and local telemetry generation.\n\nHowever, generating protocol messages locally is not equivalent to proving that the complete remote broadcasting system works.\n\nThat distinction matters.\n\nAnother mechanism introduced during development was a hash chain.\n\nThe general idea is that consecutive telemetry records can be cryptographically linked, making it possible to detect certain inconsistencies in the recorded sequence.\n\nFor example, if a record depends on the hash of its predecessor, modifying or removing an earlier record may cause subsequent verification to fail.\n\nThis is useful when dealing with a simulation that produces historical records over time.\n\nHowever, a hash chain does not solve everything.\n\nIt does not automatically prevent an unauthorized sender from submitting an entirely new sequence of fabricated records. It also does not guarantee that the underlying simulation data is correct.\n\nAuthentication, access control, message validation and trustworthy state generation are separate problems.\n\nThe objective is to use integrity verification as one layer of the overall architecture, rather than treating it as a complete security solution.\n\nDuring development, a resource-management issue involving SQLite descriptors was identified and corrected.\n\nThis was a useful reminder that adding telemetry to an existing application can expose problems that may not be obvious during normal gameplay.\n\nA short simulation session might never reveal a resource leak.\n\nA simulation running continuously for days or weeks is a different situation.\n\nDatabase connections, file handles and background operations need predictable lifetimes.\n\nA small leak can become a major stability problem when an operation is repeated thousands of times.\n\nThis becomes particularly important when telemetry generation, database access and simulation execution coexist within the same application.\n\nThe intermediate development report recorded the correction of the SQLite descriptor leak.\n\nI consider this type of issue just as important as the visible features of the website.\n\nA beautiful dashboard is useless if the application supplying its data gradually becomes unstable.\n\nUnlike a conventional cloud-hosted application, the actual simulation is intended to run on my personal computer.\n\nThat introduces several constraints.\n\nMy computer may be turned off.\n\nMy internet connection may become unavailable.\n\nThe simulation may be stopped for maintenance.\n\nThe computer may be busy running a local language model or other development tools.\n\nThe website must be designed around these possibilities.\n\nIt should distinguish between several conditions:\n\nDisplaying stale information as if it were currently live would be misleading.\n\nI would rather show an explicit offline or waiting-for-data state than invent activity to make the website look more impressive.\n\nAnother architectural concern is network exposure.\n\nA public observation website should not require unrestricted access to my computer, local database or AI inference service.\n\nThe intended architecture is based on a narrowly defined telemetry channel.\n\nIdeally, the local application initiates an authenticated outbound connection and transmits only approved public data.\n\nThe public website should not be able to execute commands inside the game or modify the world state.\n\nThe observer must remain an observer.\n\nThis also means that the remote receiver needs to validate incoming messages and impose reasonable limits on data sizes, update frequency and resource consumption.\n\nThese are engineering requirements for the remote integration, not claims that every security mechanism has already been deployed.\n\nA live map is interesting, but historical data is what could eventually make the observatory genuinely useful.\n\nI want visitors to be able to examine how artificial civilizations change over time.\n\nThe initial design focuses on retaining and displaying the most recent ten simulation days on the website.\n\nPotential future analytics include:\n\nThese metrics could reveal patterns that are difficult to notice while manually watching the simulation.\n\nFor example, a country may appear successful because it expands rapidly, while historical economic data reveals that its development is becoming increasingly unsustainable.\n\nThe observatory could eventually make such relationships much easier to examine.\n\nHowever, historical analytics introduce additional requirements involving storage, aggregation, session identification and missing data.\n\nIf only one snapshot exists, it is impossible to establish a meaningful historical trend.\n\nThe dashboard needs to communicate that limitation rather than generate artificial graphs.\n\nLiving Planet runs language models locally.\n\nI am particularly interested in observing the relationship between model performance and the behavior of artificial civilizations.\n\nA model producing more tokens per second is not necessarily making better strategic decisions.\n\nLikewise, a country generating longer responses is not necessarily developing a more effective economy.\n\nI want to eventually compare several different metrics:\n\nThese measurements could help distinguish raw inference performance from actual usefulness inside the simulation.\n\nThe observatory should eventually make that comparison visible.\n\nFor now, deeper AI analytics remain a development goal rather than a completed public feature.\n\nAccording to an intermediate development report, the isolated experimental Broadcast Edition successfully completed 533 tests.\n\nThe local telemetry module, protocol-related work and portable Windows build reached an initial development checkpoint.\n\nThis was encouraging, but it did not mean that the entire observatory was finished.\n\nThere is a major difference between:\n\nEach represents a different level of confidence.\n\nPassing hundreds of automated tests does not prove that a remote deployment will behave reliably under real-world network conditions.\n\nThat still requires end-to-end integration and operational testing.\n\nThe intermediate development work also encountered a packaging limitation.\n\nA portable Windows build was produced, but creating a conventional installer was blocked by the absence of Inno Setup in the available development environment.\n\nThis is not a fundamental architectural problem, but it illustrates how many unrelated components become involved in a project like this.\n\nThe simulation itself may work.\n\nThe telemetry module may work.\n\nThe website may exist.\n\nYet the complete distribution and deployment workflow may still be unfinished.\n\nSoftware development rarely progresses as a single uninterrupted sequence of successful implementations.\n\nThe public website already exists and introduces the simulation, its mechanics, screenshots, development roadmap and release information.\n\nIt also contains dedicated Live World and Analytics sections.\n\nThe public page I am discussing currently presents an explicit waiting-for-broadcast state rather than simulated live statistics.\n\nThe local telemetry foundation has been developed separately, but I am not claiming that the full remote broadcasting pipeline has been successfully validated.\n\nThere is still a difference between a website designed to receive live data and a fully operational live observation service.\n\nI want to preserve that distinction throughout development.\n\nThe next major engineering milestone is establishing reliable end-to-end communication between the simulation and the website.\n\nI want to investigate how the system behaves when:\n\nThe system should handle these conditions without damaging the local game or displaying misleading information.\n\nI also want to measure the actual overhead introduced by telemetry collection.\n\nLiving Planet already performs computationally expensive local inference. The observation system should not consume unnecessary resources or significantly interfere with the simulation.\n\nThe website initially looked like the relatively easy part of the project.\n\nI expected the difficult work to be related primarily to artificial intelligence and simulation mechanics.\n\nInstead, building the observatory introduced questions about distributed systems, database resource management, synchronization, protocol compatibility, security, data consistency and historical storage.\n\nThe most valuable lesson so far is that building a dashboard is not the same as building a reliable observation system.\n\nA dashboard displays information.\n\nAn observation system must also establish where that information came from, whether it is complete, whether it is current and whether it can be trusted.\n\nThose are substantially different engineering problems.\n\nEventually, I want Global Observatory to become a public window into an autonomous artificial world.\n\nVisitors should be able to return after several days and discover that civilizations have developed technologies, formed alliances, experienced economic crises or changed their strategic priorities.\n\nIn the future, if the planned self-learning architecture becomes operational, the observatory could also help investigate how individual civilizations adapt through experience.\n\nThat is still a distant research direction.\n\nFor now, the more immediate challenge is considerably simpler to describe, but difficult to implement correctly:\n\nReliably transmitting the state of a locally running simulation to a public website without compromising the independence, stability or integrity of the original application.\n\nI'm interested in hearing from developers who have built similar telemetry systems.\n\nHow would you approach reliable state synchronization between a continuously running local simulation and a remote public dashboard?\n\nWould you prioritize complete snapshots, incremental updates, event sourcing, or some combination of these approaches?\n\n**Project links:**\n\nDeveloper: TPECKA180\n\n*Disclosure: This article was drafted with AI assistance based on project documentation, an intermediate development report and the publicly available project website.*", "url": "https://wpnews.pro/news/building-a-live-observatory-for-an-ai-civilization-simulator-was-harder-than-i", "canonical_source": "https://dev.to/tpqcka180/building-a-live-observatory-for-an-ai-civilization-simulator-was-harder-than-i-expected-tpecka180-3m68", "published_at": "2026-11-28 17:03:26+00:00", "updated_at": "2026-11-28 17:13:58.799651+00:00", "lang": "en", "topics": ["artificial-intelligence", "large-language-models", "ai-agents", "ai-tools"], "entities": ["TPECKA180", "Living Planet", "Living Planet Global Observatory", "Pygame", "Python"], "also_reported_by": [], "takeaway": "Decouple telemetry from the simulation by running a separate Broadcast Edition that pushes structured state to a remote observer, so failed requests or lost connectivity never block the local model-driven game loop.", "recommendation": {"advice": "Keep the simulation authoritative and send only curated structured telemetry to observers, so a failed or offline dashboard never stalls the local game loop.", "playbook": "production-ops", "playbook_url": "https://wpnews.pro/playbooks/production-ops"}, "alternates": {"html": "https://wpnews.pro/news/building-a-live-observatory-for-an-ai-civilization-simulator-was-harder-than-i", "markdown": "https://wpnews.pro/news/building-a-live-observatory-for-an-ai-civilization-simulator-was-harder-than-i.md", "text": "https://wpnews.pro/news/building-a-live-observatory-for-an-ai-civilization-simulator-was-harder-than-i.txt", "jsonld": "https://wpnews.pro/news/building-a-live-observatory-for-an-ai-civilization-simulator-was-harder-than-i.jsonld"}}