Editing
Textdata NN.dat
From Raynegard Wiki
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
'''<code>NN.dat</code>''' (part of [[BIN textdata]]) is the numbered family of item/NPC/monster object-definition files (<code>5.dat</code>, <code>8.dat</code>, <code>16.dat</code>, β¦ <code>92.dat</code>). Despite the <code>.dat</code> extension every file is plain CP949 text. == Record format == Each file is line-based: <pre> <record count> <Korean name> β <English name> β one record = 3 lines <stat line: space-separated ints> β β¦ repeated <count> times </pre> Example (<code>8.dat</code>, record 1, a ring): <code>λ μΈκ° 루μ§μ</code> / <code>Reynega_rugia</code> / <code>8 1 1 1 22 492 100000 5000 0 0 0 0 0 0</code>. == Loading pipeline == * <code>Struct_Setup_DatFiles @ 00483ff0</code> β loops all 60 slots, each calling <code>TextArchive_Load_Dat_From_Array @ 00484080</code>, which reads the count then the 3 lines per record. * <code>TextFile_Dat_FileNum_to_value @ 00485760</code> β the authoritative <code>NN.dat</code> β slot-index switch (see [[BIN textdata]] for context). * <code>DatFiles_FileNum_value_to_DatType @ 00485650</code> β slot value (0β59) β one of 14 record types (<code>Dat_Type</code> 0β0xD). * <code>Vtable_DatFiles_DecodeFuncs[Dat_Type] @ 00485618</code> β a 14-entry table of per-type decoders. Each decoder <code>sscanf</code>s an exact number of stat-line fields, <code>operator_new</code>s the record, and copies the parsed columns into it. Decoders are recursive (decode one record, tail-call the next). * <code>TextDatFiles_GetSlotEntry(g_TextDatFiles, datEnum, idx) @ 00485ac0</code> β runtime fetch of record <code>idx</code> from a loaded slot. == Record types == {| class="wikitable" ! Type !! Decoder !! Category !! <code>.dat</code> files !! Stat cols !! Carries |- | 0 || <code>0048422b</code> || [[Weapons]] (katana/sword/axe/spear/bow/bowgun) || 16β22, 62, 63 || 44 || header + 6 stats + weapon block |- | 1 || <code>0048453f</code> || [[Armor]] || 23β31, 61 || 16 || header + 6 stats + sprite/variant |- | 2 || <code>0048468c</code> || [[Rings]] || 8, 32 || 14 || header + 6 stats |- | 3 || <code>004847b7</code> || [[Emblems]] || 9, 33 || 8 || header only (no stats) |- | 4 || <code>00484882</code> || Medicine / food || 10, 11, 34 || 10β11 || header + recovery + effect name |- | 5 || <code>0048496d</code> || Money || 15 || 8 || header (no price) |- | 6 || <code>00484a18</code> || Scrolls || 38β43 || 33 || header + skill/effect params |- | 7 || <code>00484bd9</code> || Books || 44β47 || 8 || header only |- | 8 || <code>00484c80</code> || Misc items (ore / monster-item / letter) || 35, 36, 37, 48, 49 || 8 || header only |- | 9 || <code>00484d33</code> || Monsters || 64β69, 73, 78, 79 || 32 (31 parsed) || monster block |- | 0xA || <code>00484f8b</code> || Monster (special) || 70 || 36 || monster block (extended) |- | 0xB || <code>00485235</code> || NPCs (field/party) || 5, 74, 75 || 8 || header + refs (no shop) |- | 0xC || <code>00485305</code> || NPC shopkeepers (incl. Au) || 77 || 22 (21 parsed) || header + shop-type + category flags |- | 0xD || <code>004854f8</code> || Monsters || 89β92 || ~3 || sparse / mostly empty |} '''Item vs entity split:''' only weapon/armor/ring carry the 6-stat block. Emblem, money, book, and misc items are header-only (8 cols) β a name + price, nothing more. Consumables add a recovery value + an effect-name string; scrolls add skill params. Monsters/NPCs use the entity layout instead of the item layout. == Common header (every record) == Built by the root constructor <code>DatRecord_InitHeader @ 00483e80</code>: {| class="wikitable" ! Offset !! Type !! Field |- | <code>0x00</code> || <code>char[0x10]</code> || Korean name (CP949) |- | <code>0x11</code> || <code>char[0x10]</code> || English name (<code>_</code> β space) |- | <code>0x24</code> || int || col1 = dat file number |- | <code>0x28</code> || int || col2 = record index (1-based) |} == Column β offset mapping == The constructors copy parsed columns sequentially into 4-byte fields starting at <code>0x24</code>: : '''col<sub>n</sub> β record offset <code>0x24 + 4Β·(n β 1)</code>''' (col1β<code>0x24</code>, col2β<code>0x28</code>, col3β<code>0x2c</code>, β¦) Verified by the weapon record: 44 cols, last field at <code>0x24 + 4Β·43 = 0xd0</code>. A few fields are single bytes rather than ints. === Item families (weapon / armor / ring / emblem / consumable / scroll / book / misc) === Share the item base (<code>ItemRecord_InitBase @ 004862c0</code> β <code>β¦_InitBase2 @ 00486a30</code>), which fills <code>0x2cβ0x40</code>, then a per-type extension: * '''Ring''' (<code>RingRecord_Init @ 00486930</code>): +<code>0x44β0x58</code> β 14 fields total (<code>0x24</code>β<code>0x58</code>). * '''Armor''' (<code>ArmorRecord_Init @ 004861b0</code>): +<code>0x44β0x60</code> β 16 fields. * '''Weapon''' (<code>WeaponRecord_Init @ 00486b10</code>): +<code>0x44β0xd0</code> β 44 fields; a byte at <code>0x68</code> (col 18), plus a run of ~15 id-like values (col 26+) that look like sprite/effect/skill references. === Entities (NPC / monster) === Use the root header (<code>0x24</code>/<code>0x28</code>) then category fields from <code>0x2c</code>: * '''Monster''' (<code>MonsterRecord_Init @ 00485c10</code>): <code>0x2c</code> (byte) then ints <code>0x30β0x9c</code> β 29 fields (31 parsed; the 32nd column on the line isn't read). Example <code>64.dat</code> "Weldok": <code>64 1 36 1 0 0 620 62 79 354 β¦ 160 120 100 350 50 85 150 233 61 β¦</code>. HP/stats not yet labelled (consumed server-side). * '''NPC''' (<code>NpcRecord_Init @ 00485f90</code>, via <code>NpcRecord_InitBase @ 004860d0</code>): ints <code>0x2c</code>/<code>0x30</code>, a byte <code>0x34</code>, ints <code>0x38β0x40</code>, then a 14-byte block <code>0x44β0x51</code>. Example <code>77.dat</code> "Noick": <code>77 1 121 85 0 0 75 57 0 β¦</code>. == Common header columns (cols 1β8, item records) == {| class="wikitable" ! Col !! Offset !! Meaning !! Confidence |- | 1 || <code>0x24</code> || dat file number || confirmed |- | 2 || <code>0x28</code> || record index (1-based) || confirmed |- | 3 || <code>0x2c</code> || sub-type / grade (small: 0β3) || tentative |- | 4 || <code>0x30</code> || sub-type / grade (small) || tentative |- | 5 || <code>0x34</code> || item level / sort key (e.g. 22, 47, 52) || tentative |- | 6 || <code>0x38</code> || icon bitmap index || confirmed (leader-emblem icon) |- | 7 || <code>0x3c</code> || buy price || confirmed (shop gold check) |- | 8 || <code>0x40</code> || sell price || inferred (buy/sell pair) |} Header-only items (emblem/money/book/misc, 8 cols) end here. Money (<code>15.dat</code>) has <code>col7=col8=0</code> β it ''is'' currency, no price. Equippables continue with the 6-stat block below. == The 6 equip stat columns (confirmed) == Every equippable item record carries six stats at a fixed offset block <code>0x44β0x58</code> (cols 9β14), confirmed from the stat-display builder <code>FUN_004bacb0</code> (the item-detail panel): {| class="wikitable" ! Col !! Offset !! Stat |- | col9 || <code>0x44</code> || '''OFC''' β offense / attack |- | col10 || <code>0x48</code> || '''DEF''' β defense |- | col11 || <code>0x4c</code> || '''AGL''' β agility |- | col12 || <code>0x50</code> || '''LUCK''' |- | col13 || <code>0x54</code> || '''LIFE''' |- | col14 || <code>0x58</code> || '''FOOD''' |} The on-screen order differs from the record order β the header (<code>misccaption_u.txt</code> line 1) reads <code>LIFE FOOD OFC DEF AGL LUCK</code>, and <code>FUN_004bacb0</code> re-orders fields to match. It prints two rows: the item's stat values, and a '''SPEC''' row (<code>misccaption_u.txt</code> line 2) with the <code>%+d</code> equip delta. Cross-checks: rings (<code>8.dat</code>) only ever set cols 9β12 (OFC/DEF/AGL/LUCK), never LIFE/FOOD; armor <code>23.dat</code> col10 = DEF (main stat), col11 = AGL; weapon <code>16.dat</code> katana col9 = 110 (OFFENSE), col11 = 65 (AGL). These offsets are identical across item types β weapons carry the same 6 at <code>0x44β0x58</code>, plus their weapon-specific columns beyond. == Weapon block (cols 15β44, <code>0x5c</code>β<code>0xd0</code>) == Example <code>16.dat</code> katana: <code>β¦ 9 120 0 1 2 148 0 255 0 0 0 | 463 436 489 490 491 492 589 590 539 540 541 542 601 602 | 2 1 38 1 0</code>. * '''cols 15β25''' β weapon params (attack range/speed/hit-rate class; <code>0x68</code>/col18 is a byte). Consumed by the attack/combat path (server-side for damage). * '''cols 26β39''' β a run of 14 sprite/animation sequence ids (<code>463β¦602</code>, in the sprite-archive range) β the weapon's swing/effect frames, loaded by the animation system on equip. * '''cols 40β44''' β display/misc; col42 (<code>0xc8</code>) = catalog icon (read by <code>Stuct_Setup_cpt_panel_catalog</code>). == Consumables / scrolls == * '''Consumable''' (type 4, 10β11 cols): header + col9 = recovery amount (e.g. food <code>600</code>) + a trailing effect/skill-name string. * '''Scroll''' (type 6, 33 cols): header + col9β¦col15 = skill/effect params (skill id, power, level req), rest padding. == Monster block (<code>0x2cβ0x9c</code>, ~30 fields) == <code>MonsterRecord_Init</code> writes cols 3+ as HP / base stats / AI / drop data. These are read by the '''server''' combat/AI β the client only uses the monster record for its sprite/name β so the columns aren't labelled here. == Confirmed column labels (field-consumer trace) == {| class="wikitable" ! Record !! Col / offset !! Meaning !! Evidence |- | Item (all types) || col7 = <code>0x3c</code> || buy price || <code>State_NpcShopBuy_Tick @ 00467fd0</code>: buy allowed only if <code>record->0x3c <= player.money</code>, then sends <code>0x35</code>. Ring col7=100000, weapon 9000, matches. |- | Item || col8 = <code>0x40</code> || sell price (inferred) || Not consumer-confirmed, but the buy/sell pair β ring col8=5000 vs buy 100000; weapon col8=900 vs buy 9000. |- | NPC/shop (type 0xB/0xC) || col7 = <code>0x3c</code> || shop-type code || <code>State_NpcShopBuy_Tick</code> case 0 switches on <code>npcRecord->0x3c</code>, accepts <code>0x44,0x47,0x4a,0x4d,0x50,0x53</code> = letters D G J M P S (shop kinds). |- | NPC/shop || cols 9β22 = <code>0x44</code>β<code>0x51</code> (14 bytes) || per-category "sells this" flags || same function loops <code>npcRecord[i + 0x44]</code>, <code>i = 0..13</code>; each nonzero byte adds item-category <code>i</code> to the shop's list (14 categories: Katanaβ¦MonsterItem). |- | Item / emblem || col6 = <code>0x38</code> || class/icon bitmap index || <code>cpt_panel_status_widget_Draw</code>: for the party-leader emblem (dat 9), <code>record->0x38</code> is passed to <code>File_Read_Bitmap_Archive</code> as the icon image id. |} '''Server relevance:''' col7 (buy price) is the value the shop's gold check uses; an equipped item's col9β14 bonuses (OFC/DEF/AGL/LUCK/LIFE/FOOD) are applied to the wearer's totals. The player's ''total'' stats (base + all equipped bonuses) are computed server-side and pushed via packets <code>0xC001</code>/<code>0xC002</code> β the client never re-derives totals from records. == See also == * [[BIN textdata]] * [[textdata cptNN.txt]] β the flavor-text companion file, paired by dat number
Summary:
Please note that all contributions to Raynegard Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Raynegard Wiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Page actions
Page
Discussion
Read
Edit
History
Page actions
Page
Discussion
More
Tools
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Navigation
Main page
Reddit Community
Discord Server
Recent changes
Random page
Help about MediaWiki
Special pages
Search
Tools
What links here
Related changes
Page information