• Advertisement
Sign in to follow this  
  • entries
    177
  • comments
    531
  • views
    163684

File format sadness

Sign in to follow this  

149 views

Work has taken its toll on development of both GB.Net and Sandbox. Today was the first time I've been able to do much all week :(

Anyway I have a question for you all. It's about the file format used for Sandbox projects. Here are the three options I'm considering:

1) An IFF chunk type format. The problem with this is that I can't seem to find what the size on disk of an image is before writing it. Is there a function in .Net to do this? This method is my current way of saving the projects, but it's causing a lot of headaches which is why I'm asking this.

2) A virtual directory, sort of like the DooM WADs but a lot better. This fixes the problems with the IFF format, but requires a lot more management.

3) Using actual directories. Basically the project is just a directory and it uses whatever files happen to be in its sub-directories. The editor would of course come with an option to "package" the project.

4) TileStudio style scripting. Basically you would come up with the file format(s), although of course I'll include a pre-made one. The problem with this that it really confuses newbs as they can't seem to grasp the idea of changing/multiple formats. You wouldn't believe the number of e-mails I got after posting my TileStudio stuff where most of their problems where that they were too damn lazy to learn about TileStudio scripting.

(forget 4, that would mean having to create two file formats, one used by the editor and another for scritping.)

I'm guessing most people would go with 2?

I'd really would like to know what everyone thinks, I can't go much further without deciding on a file format.

Having an entry without a screenshot is a sin, so here is the image import dialog. Before I just allowed the user to import any old image, which caused a mess in the code because it had to keep track of which ones where animated(gifs). Now I just turn animated gifs into a sprite sheet when they're imported:



Yeah I like group boxes, they look a lot cleaner then a bunch of labels everywhere.
Sign in to follow this  


4 Comments


Recommended Comments

Guest Anonymous Poster

Posted

I would go with all three...and four. You could use the provider pattern. ASP.NET makes use of it for many of it's managers.

Here's a great link to start you off if interested: http://msdn.microsoft.com/asp.net/downloads/providers/default.aspx.

Here's a good video of the provider pattern being implemented:
http://msdn.microsoft.com/msdntv/episode.aspx?xml=episodes/en/20060518ASPNETSS/manifest.xml

Essentially, you define a provider interface that has the properties and methods necessary to manage your repository system (in .NET, this is an abstract class that inherits from ProviderBase) and a manager object (in .NET, this is a singleton object) that manages the provider instances that are defined in the web.config (or, for a WinForms app, the app.config). Then, all you would need to do is implement the provider interface for the difference types of repository serializations you stated. The code that uses the said "repository" manager object only operates on the provider interface and, therefore, doesn't care how it is implemented.

Then, I would start with the easiest implementation - a directory structure. Implement the others later so you can get back to the cool stuff. No code changeswhen you want to use a different serialization scheme - just an app.config change.

Hope this is useful somehow.

Share this comment


Link to comment
Well thanks, but I think I'll stick with my current plan of implementing 2 and maybe 4 later. I understand what you're saying, but I think having so many options might confuse users, and I'm trying to make this as newb-friendly as possible.

Share this comment


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement