New file format

This week there’s a big change in the storage of OCTGN data. Now each set or game definition is kept stored in one container file. So instead of having tons of files called 651708001.jpg, 651708002.jpg, and so on, there is just one single file, e.g. Urza’s Saga.o8s. (o8s being the file extension for OCTGN 2.0 sets). What does it change ?

  1. A little speed up during installation. Copying one big file is faster than copying 300 small ones.
  2. Smaller files. Two factors make this new format smaller. The format is compressed. Of course, compressed pictures like jpeg do not compress well, but there’s still a little gain. Then there’s a little known fact that files take up more space on your hard drive than their size. This is because of clustering. The smallest amount of space usable on your hard drive is fixed by your operating system and is called a cluster. It may be (completely fictive and random example) 100Ko. Every file is stored in an integer number of clusters. Which means that a file 234Ko big would use up 300Ko on your HD. If we store multiple files in one big file, we reduce the clustering since only the container is seen by the HD. And the smaller your files are, the more space is wasted. A test with a small set has shown a 12% improvement by using the new format.
  3. Easier sharing. One thing which has annoyed me with 1.x is how hard it is to share your files with a p2p system like bittorrent. Imagine you had many sets for one game, say approx. 500Mo of pictures. If you want to both play and share those, you had to keep both your installation and the definition available on your HD. Which is 100% wasted space, taking up 1Go on your HD. Now, since 2.0 doesn’t extract anything from the container, you can just share the same file you use to play.

A somehow related improvement is in the list of supported image formats. OCTGN 2.0 supports many file formats for your cards, counters, groups and markers. Of course you can use the common GIF, PNG, and JPEG formats. But I’d like to point out another good format supported: HD Photo. This format isn’t well spread yet, but its features are great. Amongst the many benefits of this format, let me just mention those relevant to OCTGN:

  1. It has a quite good lossless compression. PNG and GIF are lossless but they don’t compress well photo-like pictures. Of course, although it is good it’s nowhere near a lossy compression ratio.
  2. It has an excellent lossy compression. For a given compression ratio, it generally outperforms JPG. Which means either that you can have smaller files for the same quality, or that you can have better pictures for the same size! Be warned that this doesn’t work well on already-encoded files like existing JPG. Because the JPG algorithm already has altered the picture to fit its compression best, and it’s hard to beat that without sacrifying more quality. The comparison has to be done starting from the same good quality – preferably lossless – picture for both algorithms.
  3. It supports an alpha channel. JPEG can give good compression ratios on pictures, but it has a big drawback: it doesn’t support an alpha channel. HD Photo does. So for your pleasure, let me conclude this long post with a picture.

Rounded corner cards:

Rounded corners

Explore posts in the same categories:

10 Comments on “New file format”

  1. Gaspare Says:

    Is this 08s format similar to zip or rar? If so, using it is a great idea indeed!!
    But, wouldn’t be more simple to use zip or rar instead :D? I haven’t found anything related googling for “08s”. Have you created it from scratch or are there some programs that use is? I’m curious…

    About the new image format, I think it will be hard to use for old sets (not only for magic sets of course, but for every other game which have a set already scanned IMHO), because it would mean that some guys have to start a new scanning project using that format… It would be hard…

    Anyway, for the newcoming sets it could be a good addition 🙂

    Thanks for all the efforts you put in this project, sign me for the upcoming beta!!



  2. jods Says:

    o8s is a custom extension, it doesn’t exist in Google yet 😉
    o8d are deck files and o8g are game definitions.

    The file format itself is based upon Open Packaging Convention (OPC). You can google this one. To explain it briefly, it’s mostly a zip file (you can open it if you rename the o8s extension to zip) with a few additionnal requirements like a relationship part.

  3. Gaspare Says:

    I do understand, but how could I create a o8s file starting from the scans I already have? It will be a tool to create those archives?

    Besides, I forgot to ask you a question that don’t regard this new functionalities, but to me is really important 🙂

    Will octgn 2.0 support notebook widescreen 16:9 or 16:10 resolutions like 1280×800, 1440×900 or 1680×1050 pixels?

    This is because I have bought a notebook 😀 and i’d like to play octgn on it, among the other things 🙂

  4. jods Says:

    Building a set is a relatively easy process. I would like to try to publish a tool, though. But as usual time is my constraint. <_<
    Your main problem currently is that I haven’t officially published the game definition format, and I won’t because I don’t consider it final yet.
    But rest assured that OCTGN 2.0 is built to enable custom games.

    About the widescreen. I don’t see why you’d have any problem.
    Moreover, the table is better than the “virtual resolution” concept 1.x uses, so you should be able to use your full screen surface to play. See one of my previous posts on the table (I think it was titled “The table, it moves!”).

    Kind regards,

  5. Chops Says:

    Do the .08s files contain just the images, or also the text associated with the cards?

  6. Wihl Says:

    Will it be possible to download cards that aren’t known?

    For example, me and a friend of mine are playing. I’ve downloaded a new set that has was released just a few hours ago. Will my friend be able to automatically download the card images when i place them on the ‘table’? I’ve had a lot of problems with people using the same sets but from different people :/

  7. jods Says:

    .o8s files can contains any and all information related to a set. Including: card images, card texts, standard decks, counters, tokens, …

    The automatic download from your opponent is a 1.x feature, which is gone. (At least currently). I don’t think it was extremely useful since you can easily exchange the set file before playing, but I understand there are a few scenarios where this feature is nice to have.

    The ‘same set from different people’ is another problem, which is much harder to solve. There’s no way to prevent people to build ‘equivalent’ sets in fundamentally incompatible ways. My current idea to help mitigate this problem is to digitally sign the sets. Which means that OCTGN will issue warnings if you try to install a set not approved by the game creator. But of course, I cannot completely prevent you to do so…

  8. Kendal Says:

    Thank you. Everything sounds fantastic. I can’t wait until the program is finalized. But please take your time and get everything you wanted to implement before release.

    I’m sorry if my previous posts were suggesting that you rush to get it out for Christmas.

    I and I think most would want the best program possible even if it means waiting longer for it.

    Thanks again. You rock. 🙂

  9. Gryc Says:

    Can we _please_ have some regular preview releases? Screenshots are nice and all, and I know everything’s not finalized, but some of us would like to play around with OCTGN2.0 sometime before 2009 >_>

  10. Gaspare Says:

    @Gryc: previews are made if there is something new to preview… Be patient and soon you’ll see something usable I’m sure 🙂

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: