From: Aloril <al...@ik...> - 2001-04-11 04:49:58
|
Bach: {id: "12", objtype: "obj", parents: ["human"], pos: [4.5, 6.5, -1.0]} In binary2 above might be: First dictionary entry that defines most of things from above as constant. Then assuming 16 bits is enough of accuracy for position in some small world: use fixed point float for pos. float -> fixed: f*2 fixed -> float: f/2 *\00212\011\000\015\000\376\377 Explanation: type byte (42 / "*"), string length (2 / "\002"), id string value (49, 50 / "12"), pos[0] (9, 0 / "\011\000") pos[1] (13, 0 / "\015\000"), pos[2] (254, 255 / "\376\377") Note server defines all dictionary entries. Binary1_beta as with many characters escaped and newlines added: \012\004\010\002id\00212\010\007objtype\003obj \011\007parents\001\010\005human \011\003pos\003\004\200\200\200\200\200\200\200\0112 \004\200\200\200\200\200\200\200\0152 \006\200\200\200\200\200\200\200\0104 (note that could use less accuracy in binary1 also by simply having less bits in mantissa part and appropriately decreasing exponent part: this would remove 1/3 from above) -- Cyphesis RPG v0.0.10: http://cyphesis.worldforge.org _______________________________________________ Protocols mailing list Pro...@ma... http://mail.worldforge.org/lists/listinfo/protocols |