While in the dentist's office yesterday, I had a brainstorm regarding mapping: why not run a real-time simulated annealing algorithm to automatically generate the global coordinate grid? When I got home, I took a few hours to implement it, and last night I booted an initial version into the game.
These new position values don't currently do anything, as I'm still working out the bugs and looking for general problems. One thing that appears to cause quite a bit of trouble are nonlinear 'portal' links that bridge a large distance; another major problem are god/builder rooms that link to unusual locations for plot device reasons.
Flagging these troublesome exits isn't something we can currently do, but it's become clear that we will need to do so in order to make the grid coherent.
Finding the problem exits is also difficult, but it's made somewhat easier by an extension to one of our existing mapping routines. By calculating a 'stress energy' for the linkages in each room in the map, I can get a pretty graph showing where maximum grid distortion occurs. These points of maximum distortion usually occur near a positional anchor, which are used to set the position of continents or isolated zones.
However, once the map for a given area has stabilized, the maximum distortion points typically indicate one of the nonlinear links described above. Once the approximate location is known, finding and marking the link is substantially easier.
All in all, I think this is working well enough that we may be able to use it globally for all area placement. Over the next week or two I'll be generating some area and room maps based on this data, and we should be able to refresh the god area and room maps on the web pages soon.
Thursday, September 17, 2009
Subscribe to:
Post Comments (Atom)
2 comments:
Update: This has been working very well. The newbie islands are almost entirely synced up, which isn't really surprising given how linear they were to begin with.
The mainland is much slower, given its much larger size, but it's also training up nicely. There are a lot more nonlinear links though, and there are parts of the grid where the coordinates are still highly strained.
Further update: Still tweaking this. I discovered that by careful selection of the update algorithm, I can make badly broken links strain the map much less badly, as well as making them easier to find. This change will go in soon and the grid will have to resync.
Overall, looking good.
Post a Comment