<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[In-game System Design]]></title><description><![CDATA[In-game System Design]]></description><link>https://ingamesystemdesign.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Sun, 06 Sep 2026 19:15:50 GMT</lastBuildDate><atom:link href="https://ingamesystemdesign.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Information Propagation between Game Entities (And how to make this better)]]></title><description><![CDATA[In the previous article, we saw, how most games actually do not implement a networking system ; rather they make you think so by manipulating logic. Alright, now you’re asking “what if we made the game’s communication as real as real-life networking?...]]></description><link>https://ingamesystemdesign.hashnode.dev/information-propagation-between-game-entities-and-how-to-make-this-better-1</link><guid isPermaLink="true">https://ingamesystemdesign.hashnode.dev/information-propagation-between-game-entities-and-how-to-make-this-better-1</guid><category><![CDATA[Game Development]]></category><category><![CDATA[networking]]></category><dc:creator><![CDATA[Saadman Sakib]]></dc:creator><pubDate>Fri, 15 Aug 2025 19:24:48 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1755285833855/baca6787-6f37-4278-abaf-92e321ef182f.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>In the previous article, we saw, how most games actually do not implement a networking system ; rather they make you think so by manipulating logic. Alright, now you’re asking <strong>“what if we made the game’s communication as real as real-life networking?”</strong> - that’s a big shift from <em>illusion design</em> to <strong>true in-game network simulation</strong>.</p>
<p>Lets first see what actually happens when we implement a full-scale networking system inside a game.</p>
<h2 id="heading-what-happens-if-we-replace-illusions-with-real-tcpudp-like-simulation">What happens if we replace illusions with real TCP/UDP-like simulation</h2>
<p>Instead of <code>NPCManager.BroadcastEvent(alert)</code>, we’d have something like:</p>
<ol>
<li><p><strong>Every NPC (or device) has an IP/port</strong> in a virtual in-game network.</p>
</li>
<li><p><strong>Guard’s walkie-talkie</strong> → sends a UDP packet with <code>"ENEMY_SPOTTED"</code> payload to a broadcast address.</p>
</li>
<li><p><strong>Phone calls</strong> → simulated as a TCP connection with handshake, latency, even possible dropouts.</p>
</li>
<li><p><strong>Emails</strong> → stored on in-game mail servers with actual message headers and retrieval via POP3/IMAP-like logic.</p>
</li>
</ol>
<p>This would turn the game world into a <strong>mini Internet</strong> that operates fully inside the simulation. It will be fun to pause here and think a bit about what possibilities it can unlock!</p>
<hr />
<h2 id="heading-benefits-amp-new-possibilities">Benefits &amp; New Possibilities</h2>
<p>Here’s what we can gain:</p>
<h3 id="heading-1-emergent-gameplay-from-actual-network-conditions"><strong>1. Emergent gameplay from actual network conditions</strong></h3>
<ul>
<li><p>If radios rely on UDP, <strong>packet loss</strong> or <strong>jamming</strong> can actually prevent guards from alerting others.</p>
</li>
<li><p>If phones use TCP, <strong>high latency zones</strong> (mountains, underground) would cause delayed calls.</p>
</li>
<li><p>You could introduce <strong>hacking mechanics</strong>! Intercepting guard messages, injecting fake alerts, sending prank emails.</p>
</li>
</ul>
<p>It will truly be helpful for gamers who want to enjoy real mechanics of tech devices, and also will require players to be more creative, to bend technology to work for them in challenging situations, which can make a strategy game more immersive. Imagine, in Hitman, you just find you can cut the building’s network cables, so the guards would only rely on communicating at shouting distance.</p>
<hr />
<h3 id="heading-2-unification-of-communication-logic"><strong>2. Unification of Communication Logic</strong></h3>
<p>This also helps in game dev’s perspective. Right now, most games have <strong>separate hardcoded systems</strong> for:</p>
<ul>
<li><p>Guard alerts</p>
</li>
<li><p>Phones</p>
</li>
<li><p>Emails</p>
</li>
<li><p>NPC chatter</p>
</li>
</ul>
<p>With a <strong>single network simulation layer</strong>, they’re all just “data packets over channels.”</p>
<ul>
<li><p>Less duplication in concepts ( since you’re reusing the same network layer).</p>
</li>
<li><p>Any new communication type (fax, drone feed, pager) is trivial to add, just another client in the same network.</p>
</li>
</ul>
<hr />
<h3 id="heading-3-player-interactable-network"><strong>3. Player-interactable network</strong></h3>
<p>If the game exposes this network to the player:</p>
<ul>
<li><p>You could run a <strong>packet sniffer</strong> in-game to see guards’ communications.</p>
</li>
<li><p>Hack security cameras by finding their IPs.</p>
</li>
<li><p>Inject false orders to NPCs.</p>
</li>
<li><p>Spread misinformation, like telling guards the enemy is in another location.</p>
</li>
<li><p>Create multiplayer missions where players actually spoof each other’s messages!</p>
</li>
</ul>
<hr />
<h3 id="heading-4-true-cross-system-integration"><strong>4. True cross-system integration</strong></h3>
<p>If radios, phones, and even door locks use the same network, cutting one network hub might:</p>
<ul>
<li><p>Stop all guard alerts.</p>
</li>
<li><p>Disable doors.</p>
</li>
<li><p>Kill the power to CCTV.<br />  This <strong>makes sabotage feel more believable</strong>.</p>
</li>
</ul>
<hr />
<p>So being in your mini internet seems much more fun ; you hack, you sniff packets, you manipulate conversations, find creative ways to blend in behind enemy lines. What’s stopping game developers to adopt it? Lets see.</p>
<h2 id="heading-drawbacks-amp-why-most-games-avoid-it">Drawbacks &amp; Why Most Games Avoid It</h2>
<h3 id="heading-1-performance-cost"><strong>1. Performance cost</strong></h3>
<ul>
<li><p>Real network simulation means actual message queues, routing logic, failure modes.</p>
</li>
<li><p>NPC count × message frequency can blow up CPU usage, especially in large worlds (<em>GTA</em>, <em>Hitman</em> scale).</p>
</li>
</ul>
<h3 id="heading-2-complexity-of-ai-programming"><strong>2. Complexity of AI programming</strong></h3>
<ul>
<li><p>Right now, AI just calls a function: <code>AlertNearbyGuards()</code>.</p>
</li>
<li><p>With real networking, you have to code:</p>
<ul>
<li><p>Address resolution.</p>
</li>
<li><p>Packet formats.</p>
</li>
<li><p>Protocol handshakes.</p>
</li>
<li><p>Error handling.</p>
</li>
<li><p>Message encryption (if the story needs it).</p>
<p>  Hmm. That’s <strong>massively more code</strong>, not less.</p>
</li>
</ul>
</li>
</ul>
<hr />
<h3 id="heading-3-more-points-of-failure"><strong>3. More points of failure</strong></h3>
<p>Debugging becomes harder.</p>
<p>Is the guard not responding because:</p>
<ul>
<li><p>He didn’t get the packet?</p>
</li>
<li><p>The server dropped it?</p>
</li>
<li><p>His radio battery is “dead” in-game?</p>
</li>
<li><p>Or is the AI broken?</p>
</li>
</ul>
<p>With illusions, it’s just “check if <code>guard.isAlerted</code> is true.<br />With simulation, it’s “trace the entire packet route and see where it died.”</p>
<hr />
<h3 id="heading-4-player-confusion"><strong>4. Player confusion</strong></h3>
<p>If you don’t explain the network system well, players may think “the game is broken” rather than “my sabotage worked.”</p>
<hr />
<h2 id="heading-so-is-it-worth-it">So… is it worth it?</h2>
<ul>
<li><p><strong>For realism-heavy, hacking-focused games</strong> (<em>Watch Dogs</em>, <em>Uplink</em>, immersive sims like <em>Deus Ex</em>) → Yes, partial real network simulation can make gameplay richer.</p>
</li>
<li><p><strong>For stealth-action games like <em>Hitman</em></strong> → Not worth the CPU/complexity hit for little gameplay gain, unless the hacking/sabotage mechanics are core to the story.</p>
</li>
<li><p><strong>For GTA-style games</strong> → They often simulate network failures only in special missions; a full system would be overkill!</p>
</li>
</ul>
<p>We can't say that every game needs this or doesn't. In short, it’s like discovering fire. Powerful, but it doesn’t yet have the right context to become a steam engine. Let's take a break, and afterward, we'll learn how to make network simulation help us keep the fun alive while reducing costs and minimizing complexities.</p>
]]></content:encoded></item><item><title><![CDATA[Information Propagation between Game Entities (And how to make this better)]]></title><description><![CDATA[Do you ever wonder, in modern games, how NPCs communicate each other over phone? What’s going on behind the curtain? Did they actually implement a miniature system equivalent to what we call a real life mobile network? Or is the game just playing tri...]]></description><link>https://ingamesystemdesign.hashnode.dev/information-propagation-between-game-entities-and-how-to-make-this-better</link><guid isPermaLink="true">https://ingamesystemdesign.hashnode.dev/information-propagation-between-game-entities-and-how-to-make-this-better</guid><category><![CDATA[Game Development]]></category><category><![CDATA[System Design]]></category><category><![CDATA[networking]]></category><dc:creator><![CDATA[Saadman Sakib]]></dc:creator><pubDate>Mon, 11 Aug 2025 17:31:01 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1754928030037/a05cd6ab-9bde-401f-92c8-14066255bd93.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Do you ever wonder, in modern games, how NPCs communicate each other over phone? What’s going on behind the curtain? Did they actually implement a miniature system equivalent to what we call a real life mobile network? Or is the game just playing tricks with your mind?</p>
<p>Alright colleague, we’re basically talking about <strong>information propagation</strong> between game entities, whether it’s guards in <em>Hitman</em> yelling into their walkie-talkies or Niko Bellic answering his cousin Roman’s calls in <em>GTA IV</em>.</p>
<p>At its core, there are <strong>two big layers</strong> here:</p>
<ol>
<li><p><strong>The game logic layer</strong>, which decides <em>what</em> information gets shared and <em>who</em> receives it.</p>
</li>
<li><p><strong>The simulation layer</strong>, which works so that it “feels” real to the player (walkie-talkie animation or phone ringing sound).</p>
</li>
</ol>
<h3 id="heading-step-1-npc-detects-an-event"><strong>Step 1 : NPC detects an event</strong></h3>
<ul>
<li><p>A <strong>guard AI</strong> has a <strong>perception system</strong> (be it <strong>field of view</strong> or <strong>hearing radius</strong>)</p>
</li>
<li><p>Once Agent 47 is spotted, the guard changes his <strong>AI state</strong> from <em>Idle</em> → <em>Alerted</em>.</p>
</li>
</ul>
<h3 id="heading-step-2-event-triggers-a-broadcast"><strong>Step 2 : Event triggers a broadcast</strong></h3>
<ul>
<li><p>The guard triggers a <strong>message</strong> like <code>"ENEMY_SPOTTED"</code>.</p>
</li>
<li><p>This message is posted to a <strong>central dispatcher</strong> (like an <strong>AI Manager</strong> or <strong>Event Bus</strong>), or directly to nearby NPCs via a <strong>query system</strong>.</p>
</li>
</ul>
<pre><code class="lang-cpp">Event alertEvent = { type: ENEMY_SPOTTED, location: guard.position };
AIManager.Broadcast(alertEvent, guard);
</code></pre>
<h3 id="heading-step-3-determining-nearby-npcs"><strong>Step 3: Determining “nearby” NPCs</strong></h3>
<ul>
<li><p>Games use <strong>spatial partitioning</strong>. Here comes the concepts of Grid and Quadtree!</p>
<ul>
<li><p><strong>Grid system</strong>: The map is divided into grids or cells; each NPC knows which cell they’re in.</p>
</li>
<li><p><strong>Quadtree / Octree</strong>: Hierarchical structures to quickly find all entities near a position.</p>
<p>  The alert system queries : <em>Which NPCs are within N meters, possibly within line-of-sight or same building zone?</em></p>
</li>
</ul>
</li>
</ul>
<p>For a simplified example:</p>
<pre><code class="lang-cpp">List&lt;NPC&gt; nearby = SpatialSystem.QueryCircle(guard.position, ALERT_RADIUS);
<span class="hljs-keyword">for</span>(NPC npc : nearby) 
{
    npc.ReceiveEvent(alertEvent);
}
</code></pre>
<h3 id="heading-step-4-npc-reaction-logic"><strong>Step 4: NPC reaction logic</strong></h3>
<ul>
<li><p>Guards who receive the alert switch state: <em>Idle</em> → <em>Suspicious</em> → <em>Investigating</em> → <em>Attacking</em>.</p>
</li>
<li><p>They may <strong>move to the event location</strong>, or <strong>assist</strong> the original guard.</p>
<h2 id="heading-why-it-feels-like-a-walkie-talkie-call">Why it ‘feels’ like a walkie-talkie call</h2>
<p>  Because, the simulation layer now comes into play. Even if the AI message takes place instantly, the game might:</p>
<ul>
<li><p>Play a walkie-talkie animation.</p>
</li>
<li><p>Delay NPC movement to match the “call time.”</p>
</li>
<li><p>Restrict alerts to “realistic” ranges or zones so it doesn’t feel like telepathy.</p>
</li>
</ul>
</li>
</ul>
<p>    This is <strong>illusion design</strong>, the actual message-passing is instant but abstract, and wrapped in believable presentation!</p>
<hr />
<h2 id="heading-in-game-phones-vs-real-mobile-networks">In-game Phones vs. Real Mobile Networks</h2>
<p>    So now we know, it’s all about illusion design. Same goes for <strong>in-game phone calls</strong>, there’s no cellular tower simulation. The logic is basically:</p>
<ul>
<li><p><code>Player receives call event</code> → trigger <strong>cutscene/audio</strong> → maybe spawn mission markers.</p>
</li>
<li><p>The game might want to simulate “signal loss” (mountains, tunnels), it’s just a <strong>trigger volume</strong> on the map that changes phone availability.</p>
</li>
</ul>
<p>    Currently games <strong>do not</strong> implement actual GSM, LTE, or TCP/IP stack. They just fake it with:</p>
<ul>
<li><p>State machines (<code>AVAILABLE</code>, <code>BUSY</code>, <code>OFFLINE</code>).</p>
</li>
<li><p>Timers for call duration.</p>
</li>
<li><p>Pre-recorded audio.</p>
</li>
<li><p>Optional world triggers to enable/disable calls.</p>
</li>
</ul>
<hr />
<h2 id="heading-the-knowledge-domain-event-driven-ai-communication">The Knowledge Domain: Event-Driven AI Communication</h2>
<p>    Quite interesting isn’t it? System Designer minds might hook up on this for a bit longer so I must mention stuffs around it. What we’re seeing belongs to <strong>game AI communication systems</strong>, and it’s used for:</p>
<ul>
<li><p><strong>Squad coordination</strong> (FPS games like <em>Halo</em>).</p>
</li>
<li><p><strong>Civilian panic spread</strong> (<em>Assassin’s Creed</em>).</p>
</li>
<li><p><strong>Quest &amp; cutscene triggers</strong> (RPGs).</p>
</li>
</ul>
<p>    There are common approaches like:</p>
<ol>
<li><p><strong>Centralized Event Bus</strong> : All AI events go through one manager. Simple, but can be heavy with many NPCs.</p>
</li>
<li><p><strong>Decentralized Broadcasting</strong> : NPC queries the environment for nearby listeners and sends events directly.</p>
</li>
<li><p><strong>Blackboard Pattern</strong> : A shared “blackboard” of facts in memory, where all NPCs can read/write. Great for coordination without direct messaging.</p>
</li>
</ol>
<hr />
<h2 id="heading-lets-sum-it-up">Let’s sum it up</h2>
<ul>
<li><p>NPC-to-NPC “communication” is <strong>just data sharing in memory</strong>.</p>
</li>
<li><p>There’s <strong>no TCP/UDP</strong>, no packet loss, no radio interference, unless the designers <em>choose</em> to simulate it for realism.</p>
</li>
</ul>
<p>    Now, if you’ve read this far, you’re probably wondering, what if we try to simulate a real life networking for in-game communication?</p>
<p>    We’ll get there, see exactly how we can do that, the pros and cons, why most games don’t adopt it, and how can we bend this idea to fit in! Until then, grab a coffee and stay connected!</p>
]]></content:encoded></item></channel></rss>