Skip to content

Instantly share code, notes, and snippets.

@nm004
Last active August 1, 2024 09:04
Show Gist options
  • Save nm004/9eabd7b94b644fd8365e503471aec6cf to your computer and use it in GitHub Desktop.
Save nm004/9eabd7b94b644fd8365e503471aec6cf to your computer and use it in GitHub Desktop.

About this document

This document is WIP.

This document gives you a techinial overview about Ninja Gaiden Sigma 2 (Ninja gaiden Master Collection PC)'s savedata.

You should be familiar with some programming language (C, C++, Java).

This document is written by Nozomi Miyamori and is in the Public Domain.

Savedata location

All savedata is stored under Documents\KoeiTecmo\NINJAGAIDENSIGMA2\<SteamID64>.

There are four sub-folders there:

  • STORYSAV -- for Story mode
  • CHAPSSAV -- for Chapter challenge
  • SYSTEMSAVE -- for System settings and other info
  • UESR_SETTING -- for Screen settings

Savedata naming

You can use any string for filename of savedata as long as it starts with STORYSAV, e.g. STORYSAV_NG+, STORYSAVE New Game Plus (Master Ninja), etc. (it does not require filename suffix like STORYSAV.DAT).

STORYSAV0.DAT is used for autosave in story mode. STORYSAV_xxx.DAT (xxx is digits) is used for manual save after completing a chapter.

CHAPSSAVEx.DAT (x is one or two digits) is used for Chapter Challenge.

Savedata format

Savedata for Story Mode and Chapter Challenge share completely the same format. You can use both savedata interchangeably.

Savedata is like a lightweight snapshot of a world. It is mapped to the program's memory, which will be described in the later section.

Savedata uses little-endian for storing values. We write values as big-endian hexadecimal here for readablity.

Here is the overview of the content of the savedata.

start	size	description
0	A00	About save data
A00	30	Some info for save data
D40	1A0	Flags
EE0	200	Number of found items
10E0	200	Number of found and used items
12E0	60	Upgrade item flags
13F0	2C0	Ryu's profile
16B0	2C0	Rachel's profile
1970	2C0	Ayane's profile
1C30	2C0	Momiji's profile
1EF0	70	Some info for the game

TODO: write about these content

Savedata on memory

Appendix: Savedata hex table

0	u16[]	About save data 1 (UTF-16LE Encoded String)
100	u16[]	About save data 2 (UTF-16LE Encoded String)
200	u16[]	About save data 3 (UTF-16LE Encoded String)

A00	i32	Savedata size w/o header (always 8280)
A0C	i32	CRC32 value
A14	i32	CRC32 value

A20	i32	this value / 60 = total playtime with this savedata

A24	i16	2 when a main game begins
A26	i8	Number of Life of Gods used
A27	i8	Equipping Talisman of Rebirth = 1 or not = 0

A34	i8	Character profile to be loaded (Ryu = 0, Rachel = 1, Ayane = 2, Momiji = 3)
A38	i8	Skill level (ACOLYTE = 1, WARRIOR = 2, MENTOR = 3, MASTER NINJA = 4)
A3A	i16	Loaded stage id


DD9	i8	Chapter Chalenge = 1 or not = 0

12FF	i8	Acquired Lives of the Thousand Gods (Chapter 1-1)

1340	i8	Hero mode = 1 or not = 0
1344	u32	Hero mode time limit

13BD	i8	Used Dragon Sword
13BE	i8	Used Vigoorian Flail
13BF	i8	Used Tonfa
13C0	i8	Used Eclipse Scythe
13C1	i8	Used Dragon's Claw and Tiger's Fang
13C2	i8	Used Kuasari-Gama
13C3	i8	Used Falcon's Talons
13C4	i8	Used Lunar Staff

13F0	i8	Enable this profile = 1 or not = 0
1454	i16	Current health
1456	i16	Max health
1458	i16	Health to be referred when a player gets hit
145A	i16	Max health that can be healed
1478	i16	Current ninpo slot (200 <-> 1 ninpo)
147A	i16	Max ninpo slot
147C	i16	Red health
147E	i8	Loaded costume id
147F	i8	Costume id to be loaded

1480	i16	Equipped melee weapon
1482	i8	Equipped melee weapon level
1484	i16	Equipped ranged weapon
1488	i16	Equipped ninpo
1489	i8	Equipped ninpo level
1490	i16	Equipped item (internal use)
1494	i16	Equipped item (internal use)
1498	i16	Equipped item (internal use)
149C	i16	Equipped item (internal use)

14A0	i32	Essense (have to be less than 0x7fffffff; otherwise crashed when opening menu)

14A4	i16	Item id
14A6	i8	Numbr of the item
14A7	i8	Level of the item

1EF0	u32	Random number 1
1EF8	u32	Random number 2
1EFC	u32	Total karma of the save data
1F00	u32	Aqcuired karma in the stage
1F04	u32	Total karma at the begining of the stage

1F0C	u32	This value / 60 = playtime of the chapter
1F10	u32	number of kills
1F14	u32	number of kills
1F18	u32	Number of last hits
1F24	u32	Aqcuired essence in the stage

1F4C	i8	Loaded the main game and the very begining ryu's equipment = 1 or not = 0
1F4E	i8	Chapter loading screen to be loaded (c1 = 00, c2 = 01, ..., c17 = 10)
1F4F	i8	Loaded chapter loading screen 

1F50	i16	Stage id to be loaded
1F55	i8	Load the initial state of the chapter = 1 or not = 0
1F56	i8	

00 Legendary Black Falcon (Default)
01 Traditional Dark Blue
02 Dragon Muscle Suit
03 Fiend Hayabusa
04 Choun Shiryu
05 Sigma 2 Hayabusa
06 Dead or Alive Throwback
00 Purifying Flame (Default)
01 Ascetic White
02 Sanzang
03 Indigo Happi
04 Red Skirt
05 Violet Maiden
00 Phantom Butterfly (Default)
01 Blossom of Miyama
02 Son Shokou
03 China Dress
04 Nocturnal Black Butterfly
05 Nocturnal Purple Butterfly
FF Default
0000 Shuriken
0001 Dragon Sword
0005 Internal Use (for (True) Dragon Sword)
0006 Art of the Inferno
0007 True Dragon Sword
0008 Herb of Spiritual Life
0009 Grains of Spiritual Life
000A Talisman of Rebirth
000B Lives of the Thousand Gods
000c Vigoorian Flail
0011 Tonfa
0012 Eclipse Scythe
0013 Dragon's Claw and Tiger's Fang
0014 Kuasari-Gama
0015 Falcon's Talons
0018 Lunar Staff
001A Internal Use (for Dragon's Claw and Tiger's Fang)
0021 Enma's Fang
0022 Windmill Shuriken
0023 Incendiary Shuriken
004B Life of the Gods
004C Jewel of the Demon Seal
004D Spirit of the Devils
004E Devil Way Mushroom
0052 Art of Wind Blades
0053 Art of Flame Phoenix
0066 Internal Use (for Eclipse Scythe)
0074 Muramasa's Omusubi
0092 Art OF Piercing Void
0093 Fiend's Bane Bow
0094 Internal Use (for Fiend's Bane Bow)
0098 The Reverse Wind Technique
0099 The Furious Wind Technique
009A The Technique of Shadowless Footsteps
009C The Flying Bird Technique
009D The Obliteration Technique
009E The Ultimate Technique
009F The Counter Attack Technique
00A0 Gatling Spear Gun
00B8 The Flying Swallow Technique
00BC The Technique of Unrivaled Soaring
00CC Blade of the Archfiend
00CD Internal Use (for Blade of the Archfiend)
00D3 The Technique of the Invisible Path
00DE Heart of Malevolent Flame
00DF Heart of Bestial Storm
00E0 Heart of Azure Lightning
00E1 Heart of Crimson Blood
00E3 Internal Use (for Kusari-Gama)
00F2 Notebook: Ultimate Technique
00F3 Notebook: Obliteration Technique
00F4 Notebook: Shadowless Footsteps
00F5 Notebook: Furious Wind
00F6 Notebook: Flying Bird
00F7 Notebook: Flying Swallow
00F8 Notebook: Reverse Wind
00F9 Notebook: Counter Attack
00FD Notebook: Invisible Path
0106 Jizo Statue Head
0116 The Technique of Ultimate Guidance
0117 Notebook: Ultimate Guidance
012C Yogenta's Notebook
012D Hachijuro's Notebook
012E Inukoma's Notebook
012F Izo's Notebook
0130 Koshimaru's Notebook (1)
0131 Koshimaru's Notebook (2)
0132 Denji's Notebook
0133 Hinomaru's Notebook
0134 History of the Castle of the Dragon
0135 The Four Greater Fiends, Part1
0136 The Four Greater Fiends, Part2
0137 The Four Greater Fiends, Part3
0138 The Rule of the King of Darkness
0139 The Vigoor Mythology
013A The Prayer of the Necromantale
0146 Inferno Hammer
0147 Type 666 Heavy Machine Gun
0148 Internal Use (for Rachel)
0149 The Magic of Raging Aphrodite
014A Fuma Kodachi
014B Flash Kunai
014C The Art of the Raging Montain God
014D Heavenly Dragon Naginata
014E Heavensong Bow
014F Internal Use (for Momiji)
0150 The Art of the Crimson Lotus
0151 Howling Cannon
0152 Internal Use (for Howling Cannon)
015A Internal Use (for Enma)
015B Double Sword Guard Charm
015D The Izuna Drop Technique
015E The Guillotine Throw Technique
0174 Internal Use (for Rachel)
FFFF Internal Use (for the others)
00 Debug level
01 Debug level
02 Debug level
03 Debug level
04 Debug level
05 Debug level
06 Chapter 1
07 Chapter 2
08 Chapter 3
09 Chapter 4
0A Chapter 6
0B Chapter 7
0C Chapter 9
0D Chapter 10
0E Chapter 12
0F Chapter 13
10 Chapter 14
11 Chapter 15
12 Chapter 16
13 Chapter 17
15 Chapter 1 no enemies
16 Debug level (obstacle course)
35 Chapter 8
36 Chapter 11
37 Chapter 5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment