erictom333 wrote:My original draft of MCPS used a base-64 apgcode instead of rle. Would that be preferable?
How much smaller is it compared to the current apgcode? We have enough different formats as it is, and it seems that the suffix portion of the apgcode serves pretty well. I'm trying to convert what I can over to it. That it is position independent and minimal for transforms is a definite positive for lists and hierarchies. (It does make encoding/decoding a bit more involved...) A lot depends on how the sizes of the various formats compare. Maybe take some of the stampcollections and see how they'd code up, and how much space they'd use.
Of course, allowing native RLE should be allowed as an alternative or fallback.
Your translation of what I showed would work. It's mostly a matter of those who will be using such a format agreeing to what things mean, and the best way to encode the parts.
For example, I'm kinda partial to using an underscore as a separator, since the apgcode already does that. In a lot of contexts, the underscore is also considered an alphanumeric character, where the comma or semicolon isn't. (Then again, a minus isn't one, either) Those should be used in the hierarchy as separators.
I like the apgcode/wcode because it encodes an object in what feels like a unique and natural way. It doesn't depend on setting a bounding box, or having to calculate one. I once tried to use SOF more, but it had the problem of having up to eight different possible encodings, which made sorting difficult. Adding the transform as an apgcode suffix takes care of that problem.
Speaking of transforms-- I've been trying to come up with a good way to "naturally" encode the possible transforms.
- LifeObject Transforms A.png (15.98 KiB) Viewed 990 times
My first attempt was to basically go try and do something where rotations and reflections would follow how the object appeared. The eight possible ways lay out nicely in a sort of cube, but the weird thing was that it seemed "natural" for the horizontal and vertical reflections to not be adjacent to the identity transform. Here it's the glide reflection which is adjacent. The only problem is that rotation on the bottom layer is reversed from that on the top, so clockwise and counter-clockwise don't seem to match. (At least the way I visualize it. Maybe it's because of a Coriolis force...)
- Hamming Transforms.png (17.43 KiB) Viewed 990 times
Then I thought of trying something like a Hamming code. I actually like this one better. Movement between vertices can be logical, and the rules simple. What was surprising was that the elementary operations were "rotate counter-clockwise", "turn 180 degrees", and "glide reflect".
Operators can be combined/chained by taking the three bit code and dividing it "abb". Take the two operators and simply xor the first bit. The next two bits are almost as simple-- add them, but treat 0b11 as -1, not 3.
I finally came up with this just this weekend, so I may be missing something obvious, but it seems to work well. (Maybe someone who has studied Group Theory this century can do a better job, or point out how this problem has already been solved.)
Then there's the issue of coming up with way to specify Glider/xWSS direction and phasing. I've got some ideas, but they're kinda ugly.