<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://Selrach2040.com/wiki/index.php?action=history&amp;feed=atom&amp;title=Textdata_enkeifile.txt</id>
	<title>Textdata enkeifile.txt - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://Selrach2040.com/wiki/index.php?action=history&amp;feed=atom&amp;title=Textdata_enkeifile.txt"/>
	<link rel="alternate" type="text/html" href="https://Selrach2040.com/wiki/index.php?title=Textdata_enkeifile.txt&amp;action=history"/>
	<updated>2026-07-04T08:00:25Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.4</generator>
	<entry>
		<id>https://Selrach2040.com/wiki/index.php?title=Textdata_enkeifile.txt&amp;diff=58&amp;oldid=prev</id>
		<title>127.0.0.1: Technical breakdown (via create-page on MediaWiki MCP Server)</title>
		<link rel="alternate" type="text/html" href="https://Selrach2040.com/wiki/index.php?title=Textdata_enkeifile.txt&amp;diff=58&amp;oldid=prev"/>
		<updated>2026-07-02T11:22:20Z</updated>

		<summary type="html">&lt;p&gt;Technical breakdown (via create-page on MediaWiki MCP Server)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;enkeifile.txt&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; (20,824 bytes, part of [[BIN textdata]]) is the world zone geometry file. Despite the name (&amp;#039;&amp;#039;enkei&amp;#039;&amp;#039; 遠景 = &amp;quot;distant view/scenery&amp;quot;), this is &amp;#039;&amp;#039;&amp;#039;zone/area definition data&amp;#039;&amp;#039;&amp;#039;, not scenery placement.&lt;br /&gt;
&lt;br /&gt;
== Format ==&lt;br /&gt;
&lt;br /&gt;
Line 1 = zone count (&amp;lt;code&amp;gt;256&amp;lt;/code&amp;gt;). Each row: &amp;lt;code&amp;gt;sscanf(&amp;quot;%d,%lf,%lf,%lf,%s&amp;quot;)&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! # !! Type !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| 1 || int || zoneId (1-based; stored &amp;lt;code&amp;gt;−1&amp;lt;/code&amp;gt; internally)&lt;br /&gt;
|-&lt;br /&gt;
| 2 || double || circle center X&lt;br /&gt;
|-&lt;br /&gt;
| 3 || double || circle center Z&lt;br /&gt;
|-&lt;br /&gt;
| 4 || double || circle radius&lt;br /&gt;
|-&lt;br /&gt;
| 5 || string || zone name (CP949; set once, from the zone&amp;#039;s first row)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The first row of each zoneId creates the &amp;lt;code&amp;gt;World_Zone_Entry&amp;lt;/code&amp;gt; (0x460 bytes) with its name; &amp;#039;&amp;#039;&amp;#039;every row adds one circle&amp;#039;&amp;#039;&amp;#039; &amp;lt;code&amp;gt;(x, z, radius)&amp;lt;/code&amp;gt; to that zone. A point is &amp;quot;inside&amp;quot; the zone if it lies within &amp;#039;&amp;#039;&amp;#039;any&amp;#039;&amp;#039;&amp;#039; of the zone&amp;#039;s circles — so a zone = union of up to 30 circles, plus a name. Blank lines are skipped.&lt;br /&gt;
&lt;br /&gt;
== Loading (Ghidra) ==&lt;br /&gt;
&lt;br /&gt;
String address &amp;lt;code&amp;gt;004e4f54&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;Struct_Setup_GameWorld_struct @ 0049eb23&amp;lt;/code&amp;gt; → &amp;lt;code&amp;gt;Load_Enkeifile_File @ 0049edd0&amp;lt;/code&amp;gt; builds the 256-entry &amp;lt;code&amp;gt;g_pGameWorld-&amp;amp;gt;zone_array&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* The point array lives at struct offset 304 (Ghidra mislabels this &amp;lt;code&amp;gt;inner_event_queue&amp;lt;/code&amp;gt;/&amp;lt;code&amp;gt;inner_event_count&amp;lt;/code&amp;gt;) — really a ≤30-entry circle list, 24 bytes each (3 doubles).&lt;br /&gt;
* Containment test: &amp;lt;code&amp;gt;Object_ContainsPoint @ 0049dfa0&amp;lt;/code&amp;gt; — AABB-tests then loops the circles via &amp;lt;code&amp;gt;Object_IsWithinRadius_w_Bearing&amp;lt;/code&amp;gt;.&lt;br /&gt;
* After zones are built, the loader also allocates &amp;lt;code&amp;gt;node_array&amp;lt;/code&amp;gt; (count from &amp;lt;code&amp;gt;gWorldData_Get_World_Count&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
This &amp;lt;code&amp;gt;zone_array&amp;lt;/code&amp;gt; is the target that every effect/interaction table (see [[textdata bgmtable.txt|the time-windowed world tables]] and [[textdata event.txt]]) resolves ids &amp;lt;code&amp;gt;&amp;amp;lt; 10000&amp;lt;/code&amp;gt; against, and that &amp;lt;code&amp;gt;Character_ScanNearbyObjects&amp;lt;/code&amp;gt; tests the player against.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[BIN textdata]]&lt;br /&gt;
* [[textdata landscape.dat]]&lt;br /&gt;
* [[textdata event.txt]], [[textdata bgmtable.txt]]&lt;/div&gt;</summary>
		<author><name>127.0.0.1</name></author>
	</entry>
</feed>