Background:
I'm working with a group of colleagues (programmers/academics) on a procedural generation tool for RPGmaker. Our goal is not to create an in-game random generator, but rather a stand alone tool that can be used to generate maps (based on certain criteria) which could then be edited in RPGmaker. Much of the pleasure is in the fine tuning, but I believe a degree of procedural generation can be a wonderful assist.
To do this, we're going to take some preexisting procedural map generating tools, based on semi-realistic environmental modeling, and build a program that outputs their value into a map.json file (compatible with RPGmaker); we will also need to amend the mapinfos.json file so that new maps can then be seen in RPGmaker.
In so far as I can tell -- each map.json file refers to a "tilesetId", which can be found in the tileset.json file (in the "data" folder). Following this, there are six "levels" of value, presented in a single array (total length = map height * map width * 6). I have every reason to believe that "6" is not a set number, rather it is determined by the user (database -> tilesets).
Problem:
Assuming that I am working with a default map tileset "Overworld", if I place grassland in the upper left corner, it predictably changes the first item in the array from "0" to "2816". Changing other values to "2816" will predictably add new grasslands (this gets more complicated for other objects). However, I have no idea how/where this number "2816" is set from. In tileset.json, there is no number "2816". I know the file that it references "World_A2.png"... but I can't figure out how a location on that file gets coded to a specific number -- in fact I can't figure out where than number comes from at all.
While it's reasonably easy, though tedious, for me to hard code the values, I worry that this would make the generator we're building much less useful for the community, as it would necessitate a great deal of a hard coding whenever a person wanted to make use of a non-standard tileset. Alternatively, if the generator can load a tileset (with tags, rules, etc), I could see the program being much more useful.
To repeat my question: how does an area on a .png file come to receive an index number (that also contains movement information) in RPG maker? -- more to the point, is there a file in RPG maker that keeps track of this "conversion table"?
I would appreciate any direction in this matter. If I got anything wrong, please correct.
Rest assured, I will upload a version of the terrain generator as soon as we can get it working.
If I posted this in the wrong area, I apologize.