• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
Stainless

Strange graphics file format

18 posts in this topic

Has anyone come across a graphics file format that starts with IMF 

 

The file extension is TGA, but it's not readable as a TGA file.

 

I know the short at offset 8 is the image width, and the next short is the image height.

 

The images are either 24 bits per pixel or 32 and are not compressed, well the file sizes don't suggest they are compressed.

 

A 128 by 128 32 bit image is 65,804 bytes

 

I have tried the obvious skip the header and load the rest as pixels, no good

 

Anybody come across this file format?

 

0

Share this post


Link to post
Share on other sites

I haven't run into files like that in particular, but a bit of googling implies it may be an ImageForge file.

1

Share this post


Link to post
Share on other sites

Some games (IL2, Theatre of War) use a format that matches what you describe. You can check with this.

1

Share this post


Link to post
Share on other sites

Yes, that tool works so that is the correct file format.

 

I need to write my own loader for it though, I'll have a look at ImageForge and see if that gives me any clues.

0

Share this post


Link to post
Share on other sites

I don't think it's related to ImageForge, just a proprietary format made for those games. Did you try stripping the header (I think it has width, height and bit depth) and reading the rest of the file as a TGA image?

1

Share this post


Link to post
Share on other sites

I've tried reading the files in multiple ways.

 

Things like straight 32 bit per pixel. four bit planes one byte per pixel, etc. No luck. I'll keep hacking away.

 

hmmm.. I wonder if you are right, I'll read up on the TGA header

 

 

No doesn't look like it

 

49 4D 46 1A 31 30 00 01 80 00 80 00 01 04 04 04 04 04 04 04 04 04 02 02 04 02 02 02 01 04 04 04 02 02 02 02 04 04 04 04 04 02 04

 

I     M   F        1                |width|height|

 

I've never seen a header like that before, all those 4's and 2's confuse the hell out of me

Edited by Stainless
0

Share this post


Link to post
Share on other sites

I've stuck one of these graphics on the project page as 

 

2bladedmetall.tga

 

http://stainlessbeer.weebly.com/il2-mod-tool.html

 

I'm giving back to the IL2 community, a while ago I used some of their meshes for a demo (not a commercial product) and now I want to pay them back with an app that helps modders test their aircraft.

 

It's almost complete, I just have a couple of issues left to fix, this graphic issue is the most annoying

 

Any help would be gratefully received

0

Share this post


Link to post
Share on other sites

49 4D 46 1A 31 30 00 01 80 00 80 00 01 04 04 04 04 04 04 04 04 04 02 02 04 02 02 02 01 04 04 04 02 02 02 02 04 04 04 04 04 02 04

The section after the image width and height look like flags that were OR-masked together.

Edited by TheComet
0

Share this post


Link to post
Share on other sites

Okay getting somewhere ...

 

Looks like the pixels are stored as differences. Seriously strange.

 

Using that tool, I converted the IMF file to tga and compared the two files.

 

The TGA file starts with a pixel 9D,9D,9D,00   and I can see that in the IMF file.

 

The TGA version continues with a bunch of the same pixels, the IMF with a bunch of 0,0,0,0

 

Further on I can see a pixel 9c,9c,9c,03 and in the IMF file FF,FF,FF,00   

 

And again later on the TGA goes back to 9d,9d,9d  in the IMF file I can see 1,1,1,     

 

It doesn't all fit yet, but the mist is clearing a little

1

Share this post


Link to post
Share on other sites

It's some weird ass proprietary format:

 

7 bytes - magic

1 byte - mode (0 = 24 bit, 1 = 32 bit)

2 bytes - width

2 bytes - height

height bytes - color row modes (0 = ???, 1 = row is stored as diff starting from 0, 2 = row is stored as diff starting from previous row end value, 3 = ???, 4 = ???)

color row 1 (1 byte r, 1 byte g, 1 byte b)

color row 2

.. (up to height rows)

height bytes - alpha row modes (same as above)

alpha row 1 (1 byte a)

alpha row 2

... (up to height rows)

2

Share this post


Link to post
Share on other sites

I was wrong about the modes, mode 1 means it's the difference from the pixel at (x - 1, y), mode 2 means it's the difference from the pixel at (x, y - 1). Still no clue about the other modes.

Edit: mode 3 is the difference from (pixel[x - 1, y] + pixel[x, y - 1]) / 2 or something like that

Edited by Mona2000
2

Share this post


Link to post
Share on other sites

Brilliant catch, it's so close now. 

 

I have probably got an accuracy issue in mode 3, or a bug in my Paeth predictor, but most of the image is now correct.

 

Thanks guys

0

Share this post


Link to post
Share on other sites

Ok, this has been fun. It's a long time since I just stared at a hex editor looking for structure. Kinda miss it.

 

Anyway the problem above was caused by an initial value problem. In mode 4 the first pixel in a line has to be set to be the same as the pixel directly above it, in all other modes it has to be set to zero.

 

Then you run the relevant filter, really strange.

 

Well I have 24 of these graphics, my code now loads 23 of them perfectly. Why one graphic has a glitch, I don't know. The code will do what I need it to now, so I'm stopping.

 

Thanks for the help and ideas guys.

1

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0