On this page, I put things that used to be on other pages, but have since been superceded with better, newer, or more fun ideas. This page is just an archive of things that have never come to pass. Pass on in silence.
Assume the world is a 2D grid of heights. This grid has some (relatively large) resolution -- say 100km or so. You can edit a world at this resolution, and things should be fast enough.
However, we've solved the problem at this point by reducing the resolution. This works for overview maps, but what about when you zoom in?
Each point on the map has associated with it another data structure, which may or may not be present (if this level of detail has been supplied). It may or may not be loaded from disk if it hasn't been used before. It is a grid, 10km square, broken into a 10x10 grid of its own, centered at the larger map's point.
Apply recursively to whatever level of detail is needed.
There are problems when editing. If you move the outer point, do the substructures get edited at the same time? Can the substructures specify higher points than the point of the supertype? More thought needed here.
But as a general approach, probably a good one.
This may be a little preliminary, but I was thinking about storing 2D topological information in 1D Java arrays. So you'd have something like:
public class TopologicalData {
/**
* A flattened 2D array of points in this resolution/area of the map
**/
public final long[] heights = new long[64*64];
/**
* Links to more detail for each point. May be Absent or NotLoaded.
**/
public final TopologicalData[] detail = new TopologicalData[64*64];
}
Accesses to this data would be cooked into 2D accesses. This would eliminate some object creation as well as limiting the number of array bounds checks done.
I need a good name for the fantasy mapper, and haven't come up with anything good yet. I wrote these points down in my notebook, and am transcribing them here.
Any ideas?