Advertisement
robn

Pioneer: Re: Savefile upgrades - a modest proposal

Jan 10th, 2015
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. From: Robert Norris
  2. To: pioneer-dev@pioneerspacesim.net
  3. Subject: Re: Savefile upgrades - a modest proposal
  4. Date: Wednesday, December 19, 2012 11:09 PM
  5.  
  6. On Wed, Dec 19, 2012 at 10:24:29PM +1100, Robert Norris wrote:
  7. > To mark this in the file for the parser, we'll store a double (or
  8. > float) as [ "d", "0x9.e0652141ef0dbf6p-3" ] (that's 1.23456789). Its
  9. > still relatively human-readable (maybe human-decipherable is a better
  10. > term).
  11.  
  12. Actually the pseudo-type information isn't necessary, because you'll
  13. retrieve this value through a GetDouble() or similar method, which knows
  14. how to do the special handling required. So just storing as a string
  15. will be fine.
  16.  
  17. For Lua data, just using the native JSON type information will be fine -
  18. it maps very closely to Lua's own types. See here for what I did for the
  19. RPC agent:
  20.  
  21. https://github.com/robn/pioneer/blob/rpc-agent/src/LuaRPCAgent.cpp#L78
  22.  
  23. I don't think the precision requirement for Lua data is quite as
  24. important, so the standard JSON double stuff should be just fine for
  25. that.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement