Jump to content
Posted 09 September 2006 - 08:03 PM
Posted 09 September 2006 - 08:06 PM
Posted 09 September 2006 - 09:05 PM
Original post by Promit
Well, text based formats are certainly way, way better for debugging, hand edits, etc. But at runtime or at least for production code, binary formats should be in use. So the ideal case is that your content build compiles the text formats into a binary format and packages that. Your game then loads the binary format.
Posted 09 September 2006 - 09:20 PM
Posted 09 September 2006 - 09:29 PM
Original post by Promit
So the ideal case is that your content build compiles the text formats into a binary format and packages that. Your game then loads the binary format. (Optionally your game can load the text format directly if necessary.)
Posted 09 September 2006 - 09:42 PM
- Accuracy: Floating-point numbers can be a real pain, but at least with a binary-based format you'll always get out the exact same value that was put in. With text-based formats, you'll probably have to limit the number of values in the mantissa so you don't have to read in 30 characters for a tiny value. Whilst the difference between 0.000000005 and 0.00000001 is pretty damned minimal, it can have an affect on objects with a paticularily small scale or where extreme accuracy is required (Very, very rare, but I have seen it happen).
Posted 09 September 2006 - 09:46 PM
<Node Type="Screen" Name="Screen1" Viewport="0 0 1 1" />
<Node Type="RenderObject" Name="RenderObject1" Col="1 1 1 1" Pos="0 0 0" Rot="0 0 0" Scale="1 1 1" CamPos="0 0 -9" CamRot="0 0 0" CamFov="60" ScaleByAspect="false" />
Posted 09 September 2006 - 10:07 PM
Posted 09 September 2006 - 10:16 PM
Ie. two types of node: one that can contain other nodes (the ones with paranthesis) and one that can contain a string (the ones with the colon/semicolon). The result is much less syntactic noise, less (one) special characters to 'escape', making it easier to read, write and parse. The only functionality that is lost is the ability to do text markup easily, such as specifying that a range of text should be bold (since strings cannot contain nodes descriping this).
Posted 09 September 2006 - 10:30 PM
Original post by Joakim_ar
ronnybrendel: Saving floating point values in hexadecimal kinda defeats the purpose of XML being easy to read. And besides I don't think the processing time required to parse a number means anything compared to the disk access.
Posted 09 September 2006 - 10:34 PM
Quote:You entirely lose the ability to nest elements, though, which you don't do if you use s-expression format:
Original post by Xetick
As long as you only use attributes in an element you dont need an end tag so you can make it quite small actually. I'm doing this for my own project file format and find it as compact as you can get it without removing the self descripting that follows it.[...]
(Rootand if you're using Lisp, Code Is Data Is Code, so you only have to write one scripting system.
:Text "Hello. How are you?"
:Good "Good. How are you?"
:Evil "Shut Up!"
Quote:Don't forget that converting text to binary involves a lot of math (for floating point numbers), and thus without a _LOT_ of effort, you will actually get less precision than is actually available in your floating point format.
Original post by Delfi
[...]please read what you wrote, it is totally wrong, you don't seem to understand how floating point numbers work! every number in memory can be reprisented with text description, but the 0.000000005 tolerance is NOT from conversion, it is what is actually stored in the data.[...]
Posted 09 September 2006 - 10:42 PM
Posted 09 September 2006 - 11:09 PM
Original post by Extrarius
As far as community friendly, editing files manually is not at all community friendly, whatever information they store. You really would be better served by creating editors for things that don't already have editors.
For extensibility, binary formats can be just as extensible by using some kind of 'tagged format' somewhat like the TIFF image format or WAV audio format.
Posted 09 September 2006 - 11:23 PM
Posted 09 September 2006 - 11:57 PM