
Unofficial Fanmade Level Editor for Secret Neighbor
This is a custom made editor that reads the official mapInfo.mapData files that the videogame Secret Neighbor uses for its own level editor, then recreates the maps in this unofficial editor.
​
As Secret Neighbor doesn't have any way to change the scale or edit objects after they've already been placed - and certain objects, like walls, are locked to a grid, - my level editor was built so anyone could make changes far beyond what the game allows.
This includes making objects bigger or smaller, flattening props so they look like images, or even moving, rotating and scaling the entire map (all at once) and leaving it outside of the intended playable area. Or turning your map completely upside down!


​It currently reads:
-
The names of every Game Object placed on the map.
-
The X, Y and Z positions.
-
The X, Y and Z rotations.
-
The X, Y and Z scales.
​
The editor also allows you to save your changes by writing to the same .mapData file, which can then be placed into the game and treated as if it were the same as any other map made officially.
An example of a map edited using my Unofficial Editor.

The same map as it appears in Secret Neighbor after saving my edits.

How it works:

Converting the data in Secret Neighbor's own save files to UTF-8 string and Hexadecimal allows everything to be read.
UTF-8 displays the text in a human readable way - this is the name of every object as well as the name and description of the map.
​
Hexadecimal allowed me to figure out what each byte meant.
By noticing patterns, I figured out that the position, rotation and scale (X, Y and Z for each) are all written with a fixed offset from the end of the object's name.
For example, the X position is always 6 bytes from the end of "(clone)".
(todo: creating new objects, object count number that changes)
The Editor and Code:
The first thing this does is load the mapInfo.mapData file from User/AppData/LocalLow
The user drops in their .mapData file generated when they create a Secret Neighbor map.

It reads the map file as a byte array, then converts it into ASCII string.
​
It uses the string to search for names of every object saved to the map (using the string array prefabNames derived from a text file of every object name in Secret Neighbor's editor).
​
When it finds an object, it finds the X, Y and Z byte values for position, rotation and scale (which are always at the same offset from the object name).
​
It creates a struct that stores the data that can be edited, so it can save it back when the user is done editing.