[Solved] Undo MapInfos.Json Corruption?

I'm an idiot, I pushed my luck and put off creating a new backup for my game because it would "Take too long" now here I am with months worth of progress gone. Or am I? yes, I've lost some special attacks, an enemy, lots of weapons, items, and armor. I also lost a file to corruption called "MapInfos".

So I did the standard thing of replacing files that were corrupted with ones from the backup, Lost progress, etc. and I launched RPG maker to see, as said earlier, That I lost about a couple months worth of progress. specifically, the maps. Over half of my maps were gone because of this, and I was gonna have a mental breakdown at this point.

However, I remembered something that got my attention. None of the Map files were corrupted. Just the MapInfos.Json. So I checked the JSON files to see that I could theoretically re-add my "lost" maps to the game by manually adding them to MapInfos.

So I looked through MapInfos.Json as well as some of my maps and learn a decent amount of what I need to know to re-add the maps, Some of it is basic, some of it isn't.

What I know:
  • the MapInfos file follows a basic template for adding maps, it goes like this:
    • Code:
      {"id":ID,"expanded":true/false,"name":NAME,"order":ORDER,"parentId":PID,"scrollX":NUMBER,"scrollY":NUMBER},
  • The ID is the number that represents that map, it can be seen when first creating a map under the name it will be "Mapxxx" the Xs represent numbers (Example: Map045)
  • Name is the what will be in the text bock in the top left of general settings (next to display name)
  • Order is the order in which it appears in On the list below the map's tileset (From top to bottom)
  • The parent ID is the ID of the map that the other map will under and indented in (that's the best way I can describe it) Example:
    • TrevorHouse (Parent)
      • TrevorRoom
      • Bathroom

What I don't know:
  • I don't know what expanded means, I don't know what a map would need to have "expanded" set to true.
  • I don't know what ScrollX and ScrollY mean. Sometimes they're whole numbers, and sometimes they're decimals that go on for a long time. I thought it might be the width/height in tiles multiplied by 48 (I thought 48 because a single tile is 48 pixels by 48 pixels), However, This is not the case.
    • I checked this by going to a map that was on MapInfos.Json (In my case, Map 1 since it was the easiest to find), got the width and height, and multiplied both by 48 and the numbers were off
      • ScrollX is set to 772, but when I multiplied the width (17) by 48, I got 816
      • ScrollY is set to 494.6 (the six goes on forever but it's rounded to 7 on the thirteenth decimal point), but when I multiplied the height (13) by 48, I got 624.
Other important stuff:
Technically when adding a new map manually, I wouldn't need to know Order or ParentID. I could set Order to the map Id and it would appear on the bottom of the list, and from there I could sort it manually. For parent I could set it to 0, This sets it to have no parent, So I could set the Parent later in the engine itself.

I can also determine what the map name is by either the map's display name or The events inside the map. This can be done by looking into a map's JSON file. If I can't determine what the map's name was by that, I could easily just set the name to "Map(ID)" and then look at the map in the engine itself to determine what it was.

TL;DR
I need to know what Expanded, ScrollX, and ScrollY mean, and How I can determine what they are/whether it's true or false by looking inside a Map's JSON file. Heck Just knowing If these variables are even important would be helpful, since as of now, I'm just assuming that they're important.

If anyone knows the solution to my problem and can tell me what I can do to save my months of progress, I would be forever in your debt.
I don't think any of the things in mapInfos even matters except for the editor, isn't even used in game at all from what I've seen, only thing that matters is the ID, which is the data folder map name json, I think you could have it just
Code:
{"id":1,"expanded":true,"name":"1","order":1,"parentId":0,"scrollX":0,"scrollY":0},
copy it the amount of maps, and use a number increment for id name and order, not sure if name is needed. Oh and remove comma at end, on last map.
as said, the mapinfos aren't used in the game - they are just used to organise the map tree in the editor.

as for replacing mapinfos, there is an easy way to get a working mapinfo file.

go to your project, and check the highest number in the mapfiles.
then make a new project - important, don't use any other project for this unless you know exactly what you're doing.
add new (empty) maps to the new project, until the map number/ID reaches the highest map number you found.

then make a backup of your damaged project (to prevent any further mistakes when trying to repair it)
copy the mapinfo file (and only that file, nothing else) into the damaged project.

you can now load all maps again, but you will have lost the tree structure of the map tree. that you'll have to re-do manually.
But it's probably less work than to reconstruct all data by code.

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/solved-undo-mapinfos-json-corruption.118090/