Page 1 of 1

.gfx files

Posted: Fri Apr 22, 2005 2:40 pm
by Ishamael
Hi
how can i import this kind of files to Ogre? or do you know a tool that can convert it to a format that ogre can handle.

/Ishamael

Posted: Fri Apr 22, 2005 2:53 pm
by :wumpus:
Please explain what kind of files it are and what program produces them, I have no clue.

Posted: Fri Apr 22, 2005 3:05 pm
by Ishamael
the files are from an old DOS game. i dont know much about them. i dont realy think they are any 3d models. hope this little info can help you.

Posted: Fri Apr 22, 2005 3:07 pm
by :wumpus:
Probably you will need to write your own parser/converter then, unless someone already made one.. But this is not exactly ogre specific, try google :)

Posted: Fri Apr 22, 2005 5:30 pm
by Imperil
There isn't a standard .gfx format.. I know warcraft II used a .gfx extention as well as many other games.

Therefore you will have to write your own parser because there is no standard.. but if it is from a DOS game that should be relatively easy as it won't be very complicated.

Posted: Fri Apr 22, 2005 5:45 pm
by :wumpus:
Imperil wrote: Therefore you will have to write your own parser because there is no standard.. but if it is from a DOS game that should be relatively easy as it won't be very complicated.
I wouldn't count on that. Whereas nowadays games generally use standard formats for images or simple uncompressed (fast to load) custom formats, back in the DOS times some games used some tricky compression and optimization schemes like grouping per image plane (ModeX etc), compiled sprites, seperate mask bitmaps instead of alpha.. those were the times :-)

Posted: Fri Apr 22, 2005 6:17 pm
by Imperil
Yeah I guess I shouldn't have said that.. I know that my own files in DOS were very simple but there were some with pretty heavy compression.

Posted: Fri Apr 22, 2005 6:32 pm
by Ishamael
build a parser, right... how do i do that now :P i would like u to give me an nice explnation of what to do :)

Posted: Fri Apr 22, 2005 7:53 pm
by Imperil
Ishamael wrote:build a parser, right... how do i do that now :P i would like u to give me an nice explnation of what to do :)
1.) Reverse engineer the file.
2.) Look at the source for other exporters/converters.
3.) Write a parser to get the data from the file you know how to reverse engineer.
4.) Write a converter for the data you pull out using the parser.

:)

Posted: Fri Apr 22, 2005 7:58 pm
by Ishamael
I have done some reversed engineering, but only on program, how can i do that on i file that i dont know anything about?

Posted: Tue Apr 26, 2005 5:53 am
by Kentamanos
Ishamael wrote:how can i do that on i file that i dont know anything about?
The short answer is: you can't

Obviously you have to know something about the files (if nothing else, the name of the files might be your only clue). Reversing the format could also be done by disassembling/debugging the program in question to see how it reads the files. Pretty non-trivial stuff.

Before you attempt to reverse engineer the format, I'd recommend doing a lot of searches to see if anyone else has. I have no idea what game you're talking about, but perhaps seeing if anyone ever wrote mods or tools for that game would be a better start.

What are you trying to use these (2D you think?) graphics for? Legal issues aside, perhaps it would be easier to somehow screenshot these using a DOS emulator or something (if it's REALLY a DOS game).