<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Faldon Forums - 2026/6/22 Update (Server-Side-Only)]]></title>
	<link rel="self" href="https://www.faldon.org/feed/atom/topic/7831/"/>
	<updated>2026-07-10T21:48:42Z</updated>
	<generator>PunBB</generator>
	<id>https://www.faldon.org/topic/7831/</id>
		<entry>
			<title type="html"><![CDATA[Re: 2026/6/22 Update (Server-Side-Only)]]></title>
			<link rel="alternate" href="https://www.faldon.org/post/74134/#p74134"/>
			<content type="html"><![CDATA[<p>Yeah we use a single threaded model for everything really, besides a few things on C# System.Threading.Tasks and network stuff. Mostly Timer architecture and a minor sleep between processing received packets =&gt; processing item/player/mobile &quot;delta&quot; changes =&gt; sending packets in batches to client =&gt; etc. Database is SQLite. </p><p>I&#039;d say in gaming, multi-threading would only make sense for when you are NOT reading or modifying live game objects. So</p><p>* Pathfinding<br />* Map generation<br />* Dabatase<br />* Packet statistic analysis<br />* Logging</p><p>I am taking out ConcurrentDictionary as it&#039;s weight we don&#039;t really need.... Trying to avoid locking mechanisms overall.</p>]]></content>
			<author>
				<name><![CDATA[RealCatbert]]></name>
				<uri>https://www.faldon.org/user/5207/</uri>
			</author>
			<updated>2026-07-10T21:48:42Z</updated>
			<id>https://www.faldon.org/post/74134/#p74134</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: 2026/6/22 Update (Server-Side-Only)]]></title>
			<link rel="alternate" href="https://www.faldon.org/post/74133/#p74133"/>
			<content type="html"><![CDATA[<p>I use a single thread for the main server loop.</p><p>I use multithreading for things like login (accounts are global and not per-server, so it&#039;s a remote call), and for loading maps quickly, and at some point I will use it for pathfinding, but I would never use multithreading for the main server loop.</p><p>People may disagree, but to me, multithreading in the main server loop would be a source of endless problems for minimal gain.</p><p>CPUs are quite fast, and in an RPG, most actions are very simple:<br />- &quot;Move item from A to B&quot; is memory copy + zero the old memory.<br />- &quot;Attack monster A&quot; is just a bit of math (and perhaps a script call).<br />- etc<br />Multithreading makes sense where actions are heavyweight, and I don&#039;t know what actions those would be.</p>]]></content>
			<author>
				<name><![CDATA[James]]></name>
				<uri>https://www.faldon.org/user/2/</uri>
			</author>
			<updated>2026-07-08T10:54:00Z</updated>
			<id>https://www.faldon.org/post/74133/#p74133</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: 2026/6/22 Update (Server-Side-Only)]]></title>
			<link rel="alternate" href="https://www.faldon.org/post/74132/#p74132"/>
			<content type="html"><![CDATA[<div class="quotebox"><cite>James wrote:</cite><blockquote><p>Hard to say. We basically never run into the monster limit. You can only fight so many monsters. My interest is mostly so I can have more/smaller maps.</p></blockquote></div><p>Yeah the &quot;running out of IDs&quot; on other server predictably led to not targetable monsters, disappearing NPCs and so forth in early woes on the other one. </p><p>I believe the fix was to use a better data structure (ConcurrentDictionary&lt;int, NPCMonster&gt; vs an ArrayList&lt;MonsterId (int)&gt; and confirm existence per map when necessary. The issue was IDs were being reused when not necessary (spawned monster should just always use their database NPCID serial) and summons/tamed can use the flexible list, when they die, player logs out or leave map rehydrate the map list accordingly.</p><p>That and to use Lock/SemaphoreSlim in the Map class&#039; GetFreeNPCId() function...</p>]]></content>
			<author>
				<name><![CDATA[RealCatbert]]></name>
				<uri>https://www.faldon.org/user/5207/</uri>
			</author>
			<updated>2026-07-07T20:45:49Z</updated>
			<id>https://www.faldon.org/post/74132/#p74132</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: 2026/6/22 Update (Server-Side-Only)]]></title>
			<link rel="alternate" href="https://www.faldon.org/post/74130/#p74130"/>
			<content type="html"><![CDATA[<p>Hard to say. We basically never run into the monster limit. You can only fight so many monsters. My interest is mostly so I can have more/smaller maps.</p>]]></content>
			<author>
				<name><![CDATA[James]]></name>
				<uri>https://www.faldon.org/user/2/</uri>
			</author>
			<updated>2026-07-07T09:20:27Z</updated>
			<id>https://www.faldon.org/post/74130/#p74130</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: 2026/6/22 Update (Server-Side-Only)]]></title>
			<link rel="alternate" href="https://www.faldon.org/post/74128/#p74128"/>
			<content type="html"><![CDATA[<div class="quotebox"><cite>James wrote:</cite><blockquote><p>The server keeps track of monsters in a static two-dimensional array (map, monster number).<br />It does this because when I first started it, I didn&#039;t know you could allocate memory in Visual Basic. Still at this point, it uses fairly little memory allocation.<br />It&#039;s specific to the server. The client does not use it.</p></blockquote></div><p>Yeah ours did much the same. Each map had a dictionary with key = npc_id (1 to 8192 client id and DB serial for spawn mobs) and data of mob data. On leave or die remove, on spawn/enter add. Runs into issues early on when summons ate up a lot of IDs since 8192 seems client max. It is sorta smart to just have a global collection for monsters disassociated from a map tbh.</p>]]></content>
			<author>
				<name><![CDATA[RealCatbert]]></name>
				<uri>https://www.faldon.org/user/5207/</uri>
			</author>
			<updated>2026-07-06T09:38:23Z</updated>
			<id>https://www.faldon.org/post/74128/#p74128</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: 2026/6/22 Update (Server-Side-Only)]]></title>
			<link rel="alternate" href="https://www.faldon.org/post/74125/#p74125"/>
			<content type="html"><![CDATA[<p>The server keeps track of monsters in a static two-dimensional array (map, monster number).<br />It does this because when I first started it, I didn&#039;t know you could allocate memory in Visual Basic. Still at this point, it uses fairly little memory allocation.<br />It&#039;s specific to the server. The client does not use it.</p>]]></content>
			<author>
				<name><![CDATA[James]]></name>
				<uri>https://www.faldon.org/user/2/</uri>
			</author>
			<updated>2026-06-25T15:53:43Z</updated>
			<id>https://www.faldon.org/post/74125/#p74125</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: 2026/6/22 Update (Server-Side-Only)]]></title>
			<link rel="alternate" href="https://www.faldon.org/post/74124/#p74124"/>
			<content type="html"><![CDATA[<p>I always wondered what gsTag was actually for. We reversed it as some expression of 8192 and mapid and 2048 and npcid. But I dont think &quot;other faldon&quot; ever used the NPC tag for anything. Unsure if old client used it for anything specific, tbh</p>]]></content>
			<author>
				<name><![CDATA[RealCatbert]]></name>
				<uri>https://www.faldon.org/user/5207/</uri>
			</author>
			<updated>2026-06-24T00:44:38Z</updated>
			<id>https://www.faldon.org/post/74124/#p74124</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[2026/6/22 Update (Server-Side-Only)]]></title>
			<link rel="alternate" href="https://www.faldon.org/post/74119/#p74119"/>
			<content type="html"><![CDATA[<p>I&#039;ve changed the game scripting, so there is no longer any distinction between an &quot;NPC ID&quot; and an &quot;NPC tag ID&quot; inside scripts.</p><p>You shouldn&#039;t notice this unless there I introduced any bugs with this, but if you see any quest bugs, etc., definitely let me know. Thank you!</p><p>God bless.</p><p>James</p>]]></content>
			<author>
				<name><![CDATA[James]]></name>
				<uri>https://www.faldon.org/user/2/</uri>
			</author>
			<updated>2026-06-22T13:56:02Z</updated>
			<id>https://www.faldon.org/post/74119/#p74119</id>
		</entry>
</feed>
