Jump to content

  • Log In with Google      Sign In   
  • Create Account


Custom File Editing, Hex, Binary, Text


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 KingofNoobs   Members   -  Reputation: 301

Like
0Likes
Like

Posted 22 November 2012 - 06:10 AM

Hello,

I have created a custom file format for my engine which uses both standard text and binary data. Eventually I will implement creation of these files in a level or world editor, but for the time being I am editing them by hand. My question is how do I conveniently enter delimiting characters into the file, i.e. null and /n, etc. I have been using a hex editor, but it is not convenient for entering non-0 delimiters, and can introduce bugs if data is input at the wrong location (because I cannot intuitively tell where the delimiter should go, I have to count and use the side-bar text representation of the hex). Is there a better way which would allow me to type in '0' or something so that a normal text editor would know that this is a null and NOT a 0 char?

Thanks in advance.

- Dave Ottley

I wonder as I wander...

http://www.davesgameoflife.com


Sponsor:

#2 Yrjö P.   Crossbones+   -  Reputation: 1412

Like
1Likes
Like

Posted 22 November 2012 - 01:26 PM

That sounds painful. Any actual reason you can't keep your data in a more manageable form like all text, or in multiple files so that every file is either binary or text? Trying to squash everything together before you are even using an editor seems premature. It's easy to compress your data together later.

#3 Radikalizm   Crossbones+   -  Reputation: 2827

Like
3Likes
Like

Posted 22 November 2012 - 01:41 PM

Don't edit binary files by hand, seriously, that's just asking for a whole load of trouble.

If you're going to be using custom binary files a tool for creating and editing those files should be a priority, even if it's only temporary.
When I need to store data in a binary format I first of all work out a design for the format itself, then I write the required tools based on that design, and it's not until that's finished I start generating and working with the files themselves.
This way of working saves you from a whole lot of painful situations afterwards.

I gets all your texture budgets!


#4 prh99   Members   -  Reputation: 501

Like
1Likes
Like

Posted 22 November 2012 - 03:40 PM

At very least I would make a tool that convert formatted text files into the binary format, at least until you can write a proper editor. I don't know the specifics of your format but it shouldn't be too hard to write a tool that will take a say XML or JSON text file and do the conversion. There are parsers available like irrXML
Patrick




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS