- read every tile
- for each tile read all the modf and mddf entries
- discard the entries not placed on the current tile (eg entry.pos isn't inside the tile)
- discard duplicates
- read the filenames
- create the model/wmo instances and add them to a list
-> [tile -> [(mdf, filename)]] where (mdf, filename) is unique by transformation, only entries with inside (tile, .pos) are stored
- create 2 lists for each tile, one for the wmo and one for the m2
- assign a new uid for the instances (starting from 0)
- add every model/wmo instances to the lists of every tiles they are on
-> [[tile] -> [(uid, m*df, filename)] where uid is 0..n, all entries where intersect (tile, .extends) are stored
- load each tile without the models/wmos
- save the tile with the model/wmo instances from step 2
- save the highest uid on the disc to not have to repeat the process ever again
- Every entity has a globally unique id in 2I, 1O
- uniqueness of newly placed objects is guaranteed by storing highest uid on disk
- does not work with parallel work by multiple editors on same map, or requires a central fix-pass every so often, which is undesirable -> requires one pass after a fuckup which still can exist -> valid and good for single-person work