2012 PC Port Level and Save Editing Guide

List of names and corresponding objects:

Common objects:

regate : Ideya Palace (level must have at least 1)

mandara : Normal (not hidden) Blue Chip

kakusi : Hidden Blue Chip (area must be paralooped to make them appear)

sonata : Star Chip

single : Orange Ring

bumper : Bonus Ball (has a field which specifies the number of links to open)

plate : Pair of yellow Rings


A-Life save file structure

In the 2012 remastered version of NiGHTS into Dreams for PC, there is a file called Nights.sav that contains various data about the player's progress, including data related to the Nightopians or A-Life found in each stage except Twin Seeds. In this game, there are 7 blocks of data for A-Life, one for Spring Valley, Splash garden, Mystic Forest, Frozen Bell, Soft Museum, Stick Canyon, and Spring Valley (Christmas).

Header

Each of the 7 blocks of A-Life data is preceded by a 12-byte header which is divided into the following values:

Example header: 0D 01 0E 00 00 00 00 00 25 49 32 40

The data in this header can be broken down as follows:


# of displayed Nightopians (integer): 0D = 13
# of
displayed Mepians (integer): 01 = 1
Total # of
displayed A-Life (integer): 0E = 14


All of the above values count only the Nightopians and Mepians that appear in the Nightopian Collection. This is important because there are actually several "hidden" Nightopians in each level, typically used as stage decorations. These include the cheering crowd of Nightopians near the train station in Frozen Bell.

The first and second ones are used to generate the numbers in the bottom left corner of the collection screen, while the last controls how many total Nightopians/Mepians are actually displayed in the collection and in the level.


Purpose unknown/seems unused (5 bytes): 00 00 00 00 00
Average happiness (float): 25 49 32 40 = 2.78571438789368

Average happiness is calculated whenever the player successfully completes a stage and defeats the boss. It is an average of all of the non "hidden" A-Life's moods, which range from 0 (angry) to 3 (very happy). This value affects where NiGHTS' head is placed on the happiness meter on the bottom right of the Nightopian collection screen. If average happiness is exactly 3 (all Nightopians/Mepians are very happy) then the Nightopian version of Dreams Dreams will play upon viewing the collection.

If this value is set to be less than 0, NiGHTS' head will appear at the left side of the happiness meter as if the value were exactly 0. If it is set to be greater than 3, Dreams Dreams does not play and NiGHTS' head appears on the right side of the meter as if average happiness were exactly 3.

Data

After the header portion of each block of Nightopian data is room for the data of up to 40 Nightopians. Each "line" of data has 32 bytes in it. The function of many of these bytes is unknown, but a few have been uncovered. I will attempt to list the "natural" range of values for each number. Here's an example line:

Byte Number:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32

00 23 4C 03 06 1E 06 0B 6F 03 00 00 00 00 12 E8 44 13 00 00 BB 04 00 00 E6 13 00 00 E2 08 00 00


Blue: purpose unknown

Green: purpose partially known but unclear


1. Purpose unknown. Natural values include 00, 18, and 19.


2. The last 2 bits of this byte are used to store a Nightopian's mood. 0 is angry, 1 indifferent, 2 happy, and 3 very happy. The first nibble seems to always be either 0 or 2 and has unknown purpose. The second nibble is either 0, 1, 2, or 3, as described above.


3. This byte is divided into two nibbles that have different effects. The first one controls a Nightopian's speed, with 0 being stationary and F being extremely fast (normal values are around 4). The second seems to control how reactive or irritable the Nightopian is to the player's presence. If the second nibble is 0 or 1, the Nightopian will not react at all to the player, even if it is angry or very happy. Values between 2 and D inclusive will show a minor reaction, such as staring if the Nightopian has a negative mood, and waving and smiling if it has a positive mood. Values E and F have a strong reaction, with a negative mood causing rapid flying and staring at the player, and a positive mood causing the Nightopian to follow the player's position.


4. Purpose unknown. The first nibble is usually 0 but sometimes 1, and the second nibble seems to range from 0 to 6.


5. Purpose unclear. Natural values usually range from 0 to 1E (the most common value) but is sometimes larger. Setting this value to 00 causes that Nightopian to appear in a dazed state as if it has just bred.


6. Purpose unknown. Has the same range as byte 5, and they are often the same.


7. This byte, which can take any value from 0 to FF (usually less than 15 however), determines the Nightopian's "special" behavior that is displayed in the Nightopian collection. Nightopians perform this behavior whenever they are undisturbed but will stop if the player character gets too close. For large values, the in-game behavior is often different from the animation displayed in the Nightopian collection, making it difficult to catalog all possible behaviors.


8. Purpose unknown. Has a similar range to byte 7.


9. The first nibble determines the type and life stage of a Nightopian, including whether or not it is treated as a Mepian. This nibble seems to be treated as four bit flags whose effects can be combined. Generally, only values of 1, 2, 4, 5, 6, D, and E are legitimate, although 7 and F sometimes appear.


If the first bit is 1, this marks a Nightopian as being a "true" Mepian. The value of this bit is not directly affected by the Nightopian's actual parts, and because of this it is possible to create Mepians with all Nightopian parts or Nightopians with Nightmaren parts by hacking. However, only "true" Mepians can produce a King Pian.


The second bit marks a Nightopian as a King Pian if its value is 0. Since a Nightopian cannot be both a Mepian and a King Pian, a combination of these two flags is invisible and crashes the game when viewed in the Nightopian Collection.


The third bit determines whether a Nightopian has adult AI. If 1, it will behave like a normal adult Nightopian. If the third bit is 0 and the fourth (egg) bit is not set, it will be a "hidden" or "decorative" Nightopian that does not move and cannot be interacted with (by paralooping, etc).


The fourth bit causes a Nightopian to appear as an egg on the Nightopian Collection screen, although it will appear an an adult in-game if the third (adult AI) bit is 1.


A table of the bits' combined effects is as follows:

Nightopian byte 9

9. cont. The second nibble seems to influence how high the Nightopian will fly, with higher numbers flying higher.


10. Seems to designate which lap or lap "segment" a Nightopian is currently on, as adult non-"hidden" Nightopians are always confined to one of NiGHTS' paths to allow NiGHTS to interact with them. Common values for the first nibble are 0, 1, 4, 8, and C, and the second nibble is usually between 0 and 3, inclusive. This seems to be the most important factor in a Nightopian's position.


11-14. These determine which Mepian or Nightmaren parts a Nightopian has. The parts each byte determines are 11: body, 12: head, 13: arms, and 14: legs. A 0 value for any of these causes that part to be a normal Nightopian part. 1, 2, and 3 are used for the different Nightmaren types that are native to a particular level. Higher values than 3 can be used but are buggy and often appear as white cubes or cones in game, while appearing as various non-native Nightmaren parts in the Nightopian Collection screen. These values have no bearing on a Nightopian's ability to produce a King Pian, as this is determined by byte 9.


15. Appears to influence a Nightopian's position in the level, limited to the current lap it's in. Natural values are generally less than 10 but are sometimes higher.


16. This byte, which can range from 0 to FF, seems to determine how close a Nightopian is to being ready to breed, with higher being closer. If this value is 43 or higher, the Nightopian will immediately attempt to breed as soon as it finds a mate.


17-32. Purpose unclear. Appear to be 4 integer values which either have 4 bytes each or are 2-byte integers separated by 2 bytes of padding. Seem to be related to a Nightopian's position. Have little effect on adult non-"hidden" Nightopians as they are confined to positions on NiGHTS' flight paths.