Posted: Thu Mar 10, 2011 6:35 pm Post subject:
Any Programmers out here?
How can we code a simple program in Borland Delphi to read and write MIX files. The Mix File format information is given below, any sincer help is appreciated. Thnx.
Code:
===================
THE .MIX FILES
===================
You probably already know the format of these files, but I will add a
description here for completeness.
The MIX file consists of two parts :
-A header including the index of all the files contained within
-A body containing all the files
It's format is :
Header : record
NumFiles : word; {Number of files in MIX}
DataSize : longint; {Size of body}
Index : array [1..NumFiles] of
record
ID : longint; {File ID}
Start : longint; {Offset of file from the start of the
body}
Size : longint; {file size}
end;
end;
The ID field is computed from the original filename, which is not stored in
the MIX.
The records are always sorted by the ID field (the numbers are signed
longints).
Note that the offsets are relative to the start of the body so to find the
actual offset in the MIX you have to add the size of the header which is
NumFiles*12+6
Quote:
All the above info written on MIX Files just goes over my head anyway
Instead of translating hes code, what is buggy somewhat anyways, just learn the whole logic and format and write your own.
Thats what we are doing man. We cant find a proper information on those so called mix files, even westwood & EA sites does not contain any info on the files used by TS or RA2. QUICK_EDIT
Westwood and EA sites would not. Perhaps sometime down the line i will produce one for the TS format (is there a difference between TS and RA2 formats?), we need a new mix exploring application >_> QUICK_EDIT
Also Known As: evanb90 Joined: 20 Feb 2005 Location: o kawaii koto
Posted: Fri Mar 11, 2011 6:46 pm Post subject:
Among other things. Like a map editor. _________________ YR modder/artist, DOOM mapper, aka evanb90
Project Lead Developer, New-Star Strike (2014-)
Former Project Lead DeveloperStar Strike (2005-2012), Z-Mod (2006-2007), RA1.5 (2008-2013), The Cold War (2006-2007) QUICK_EDIT
Also Known As: banshee_revora (Steam) Joined: 15 Aug 2002 Location: Brazil
Posted: Fri Mar 11, 2011 9:12 pm Post subject:
CCHyper wrote:
Westwood and EA sites would not. Perhaps sometime down the line i will produce one for the TS format (is there a difference between TS and RA2 formats?), we need a new mix exploring application >_>
That would be appreciated.
Anyway, I don't think that TS and RA2 mix files are different at all. QUICK_EDIT
I got a ton of code for TS that trys to copy how the RA95 Editor works, very buggy, perhaps its work a beta release if i can get the mouse to work right. QUICK_EDIT
Stealth Killer I hope this tool finish. Dont forget to make it able to open protected file. _________________ "I'll be staying strapped cuse my mac-eleven make my nuts bigger" QUICK_EDIT
Olaf's MIX code is totally cryptic and incomprehensible. Most of his code is, but that one's the worst by far. Unless you've studied maths maybe don't even attempt to make any sense of it. Your best chance is to directly translate C++ code to Delphi. Trying to understand it is a waste of time, you could easily write a new game in that time.
I attached the MIX loading code (C++) from a former... project of mine. It should be way more comprehensible than Olaf's work, however I left a huge part of Olaf's code untouched, for obvious reasons.
It could load TS and RA2 mixes, not sure about earlier versions, it's too long ago. I won't be able to give any support either. If there are any headers missing, I can offer them, though.
Also Known As: banshee_revora (Steam) Joined: 15 Aug 2002 Location: Brazil
Posted: Sat Mar 12, 2011 1:32 pm Post subject:
Thanks, pd
I'll take a look at it, although I'll still need some help to convert the cryptic blowfish and the bignum stuff to Delphi, because that's the part I'm stuck with. QUICK_EDIT
Thanks for this help PD. Now I have something to work on. And ArvinCool we will do our best to make it a smart one to read those protected ones too. _________________ QUICK_EDIT
"bignums" are nothing but arrays of unsigned integers. Have a look at the typedefs. Those functions are arithmetic operations.
There's a lot of pointer typecasting involved there, so in Delphi, where that isn't possible, you might be better off representing those bignums using unsigned byte arrays. That will be a lot of work for sure, but there's not much you can do really.
I can try translating a simple example, though my Delphi knowledge is extremely limited. If you know your way around bitshifting and arithmetic operations, you shouldn't have too much of a problem translating these monsters.
What they are for and why they are needed, I don't know. The whole decryption can most likely be achieved in easier ways, but as mentioned, research on that is probably wasted time. QUICK_EDIT
so where do we report bugs? Example, the String editor often crashes. Very annoying. _________________ "I'll be staying strapped cuse my mac-eleven make my nuts bigger" QUICK_EDIT
Also Known As: banshee_revora (Steam) Joined: 15 Aug 2002 Location: Brazil
Posted: Mon Jan 09, 2012 6:01 pm Post subject:
@ArvinCool & few others: this is not how do you report a bug.
You have to:
- explain what happened (the bug you are reporting).
- what you were doing at the moment the bug happened.
- what have you done before the bug happened.
- describe your hardware, operational system, etc.
And post your bug reports at the links Olaf just posted above.
Sentences such as "String editor often crashes" means nothing for a software developper. We do not have crystall balls. The more you detail, the better. QUICK_EDIT
Simple C Application to calculate Mix File ID http://freecnc.org/dev/mix-format/, I would request C++ professionals to give a similar code for TS and RA2 Mix files that just reads and writes mix files and adds or removes files from mix files ( it should be simpler, and by simpler I mean no external headers, units or something like that, they really blow my head as I'm new in cpp)
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum