Project Perfect Mod Forums
:: Home :: Get Hosted :: PPM FAQ :: Forum FAQ :: Privacy Policy :: Search :: Memberlist :: Usergroups :: Register :: Profile :: Log in to check your private messages :: Log in ::


The time now is Thu Mar 28, 2024 9:43 am
All times are UTC + 0
Any Programmers out here?
Moderators: Community Tools Developpers
Post new topic   Reply to topic Page 1 of 1 [26 Posts] Mark the topic unread ::  View previous topic :: View next topic
Author Message
Stealth Killer
Cyborg Soldier


Joined: 06 Nov 2009
Location: Planet Earth

PostPosted: Thu Mar 10, 2011 6:35 pm    Post subject:  Any Programmers out here? Reply with quote  Mark this post and the followings unread

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

Back to top
View user's profile Send private message
Banshee
Supreme Banshee


Also Known As: banshee_revora (Steam)
Joined: 15 Aug 2002
Location: Brazil

PostPosted: Thu Mar 10, 2011 9:43 pm    Post subject: Reply with quote  Mark this post and the followings unread

I'm also interested in this code Laughing.

I've tried several times to translate Olaf's XCC code to delphi, but I've failed.

Back to top
View user's profile Send private message Visit poster's website Skype Account
Stealth Killer
Cyborg Soldier


Joined: 06 Nov 2009
Location: Planet Earth

PostPosted: Fri Mar 11, 2011 3:20 am    Post subject: Reply with quote  Mark this post and the followings unread

Oh what a tragedy........
Let me know Banshee if you make it, i'm trying too.

_________________

Back to top
View user's profile Send private message
CCHyper
Defense Minister


Joined: 07 Apr 2005

PostPosted: Fri Mar 11, 2011 2:57 pm    Post subject: Reply with quote  Mark this post and the followings unread

Instead of translating hes code, what is buggy somewhat anyways, just learn the whole logic and format and write your own.

Back to top
View user's profile Send private message
Stealth Killer
Cyborg Soldier


Joined: 06 Nov 2009
Location: Planet Earth

PostPosted: Fri Mar 11, 2011 4:10 pm    Post subject: Reply with quote  Mark this post and the followings unread

CCHyper wrote:
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.

Back to top
View user's profile Send private message
CCHyper
Defense Minister


Joined: 07 Apr 2005

PostPosted: Fri Mar 11, 2011 5:47 pm    Post subject: Reply with quote  Mark this post and the followings unread

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 >_>

Back to top
View user's profile Send private message
EVA-251
General


Also Known As: evanb90
Joined: 20 Feb 2005
Location: o kawaii koto

PostPosted: Fri Mar 11, 2011 6:46 pm    Post subject: Reply with quote  Mark this post and the followings unread

Among other things. Like a map editor. #Tongue

_________________
YR modder/artist, DOOM mapper, aka evanb90
Project Lead Developer, New-Star Strike (2014-)
Former Project Lead Developer Star Strike (2005-2012), Z-Mod (2006-2007), RA1.5 (2008-2013), The Cold War (2006-2007)

Back to top
View user's profile Send private message Send e-mail Visit poster's website
Banshee
Supreme Banshee


Also Known As: banshee_revora (Steam)
Joined: 15 Aug 2002
Location: Brazil

PostPosted: Fri Mar 11, 2011 9:12 pm    Post subject: Reply with quote  Mark this post and the followings unread

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.

Back to top
View user's profile Send private message Visit poster's website Skype Account
CCHyper
Defense Minister


Joined: 07 Apr 2005

PostPosted: Sat Mar 12, 2011 2:08 am    Post subject: Reply with quote  Mark this post and the followings unread

EVA-251 wrote:
Among other things. Like a map editor. #Tongue


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.

Back to top
View user's profile Send private message
ArvinCool
Tiberian Beast


Joined: 01 Jun 2008

PostPosted: Sat Mar 12, 2011 12:46 pm    Post subject: Reply with quote  Mark this post and the followings unread

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"

Back to top
View user's profile Send private message
pd
Laser Commando


Joined: 19 Jun 2005
Location: Gone

PostPosted: Sat Mar 12, 2011 1:17 pm    Post subject: Reply with quote  Mark this post and the followings unread

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.



MIX.zip
 Description:

Download
 Filename:  MIX.zip
 Filesize:  12.64 KB
 Downloaded:  361 Time(s)


Back to top
View user's profile Send private message
Banshee
Supreme Banshee


Also Known As: banshee_revora (Steam)
Joined: 15 Aug 2002
Location: Brazil

PostPosted: Sat Mar 12, 2011 1:32 pm    Post subject: Reply with quote  Mark this post and the followings unread

Thanks, pd Smile

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.

Back to top
View user's profile Send private message Visit poster's website Skype Account
Stealth Killer
Cyborg Soldier


Joined: 06 Nov 2009
Location: Planet Earth

PostPosted: Sat Mar 12, 2011 1:46 pm    Post subject: Reply with quote  Mark this post and the followings unread

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.

_________________

Back to top
View user's profile Send private message
CCHyper
Defense Minister


Joined: 07 Apr 2005

PostPosted: Sat Mar 12, 2011 3:01 pm    Post subject: Reply with quote  Mark this post and the followings unread

Forgot about Folkor pd, shame you stop working on that Sad

Back to top
View user's profile Send private message
pd
Laser Commando


Joined: 19 Jun 2005
Location: Gone

PostPosted: Sun Mar 13, 2011 1:48 am    Post subject: Reply with quote  Mark this post and the followings unread

"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.

Back to top
View user's profile Send private message
Ivosh
Civilian


Joined: 02 Jan 2012

PostPosted: Tue Jan 03, 2012 9:38 pm    Post subject: Reply with quote  Mark this post and the followings unread


Back to top
View user's profile Send private message
Olaf van der Spek
Medic


Joined: 28 Dec 2002

PostPosted: Wed Jan 04, 2012 7:28 pm    Post subject: Reply with quote  Mark this post and the followings unread

CCHyper wrote:
Instead of translating hes code, what is buggy somewhat anyways, just learn the whole logic and format and write your own.

Got a link to your bug report?

Back to top
View user's profile Send private message
Olaf van der Spek
Medic


Joined: 28 Dec 2002

PostPosted: Wed Jan 04, 2012 7:34 pm    Post subject: Reply with quote  Mark this post and the followings unread

Banshee wrote:

I've tried several times to translate Olaf's XCC code to delphi, but I've failed.

You should just move to C++ Wink

Back to top
View user's profile Send private message
Banshee
Supreme Banshee


Also Known As: banshee_revora (Steam)
Joined: 15 Aug 2002
Location: Brazil

PostPosted: Thu Jan 05, 2012 12:27 am    Post subject: Reply with quote  Mark this post and the followings unread

Olaf van der Spek wrote:

You should just move to C++ Wink






Back to top
View user's profile Send private message Visit poster's website Skype Account
Guest
Guest




PostPosted: Thu Jan 05, 2012 8:44 pm    Post subject: Reply with quote  Mark this post and the followings unread

well, pds diss to Olafs code is kinda hilarious Laughing Laughing Laughing

Back to top
CCHyper
Defense Minister


Joined: 07 Apr 2005

PostPosted: Thu Jan 05, 2012 11:03 pm    Post subject: Reply with quote  Mark this post and the followings unread

Olaf van der Spek wrote:
CCHyper wrote:
Instead of translating hes code, what is buggy somewhat anyways, just learn the whole logic and format and write your own.

Got a link to your bug report?


pd, VK and various people who have studied the code have told me there is bugs in the save routines.

Back to top
View user's profile Send private message
Olaf van der Spek
Medic


Joined: 28 Dec 2002

PostPosted: Fri Jan 06, 2012 12:20 pm    Post subject: Reply with quote  Mark this post and the followings unread

CCHyper wrote:
pd, VK and various people who have studied the code have told me there is bugs in the save routines.

It's not going to get fixed if nobody posts a bug report...

Back to top
View user's profile Send private message
ArvinCool
Tiberian Beast


Joined: 01 Jun 2008

PostPosted: Fri Jan 06, 2012 9:09 pm    Post subject: Reply with quote  Mark this post and the followings unread

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"

Back to top
View user's profile Send private message
Olaf van der Spek
Medic


Joined: 28 Dec 2002

PostPosted: Sat Jan 07, 2012 5:37 pm    Post subject: Reply with quote  Mark this post and the followings unread


Back to top
View user's profile Send private message
Banshee
Supreme Banshee


Also Known As: banshee_revora (Steam)
Joined: 15 Aug 2002
Location: Brazil

PostPosted: Mon Jan 09, 2012 6:01 pm    Post subject: Reply with quote  Mark this post and the followings unread

@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.

Back to top
View user's profile Send private message Visit poster's website Skype Account
Stealth Killer
Cyborg Soldier


Joined: 06 Nov 2009
Location: Planet Earth

PostPosted: Sat May 19, 2012 5:28 pm    Post subject: Reply with quote  Mark this post and the followings unread

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)

Any help Plzzzzzzzz ??????

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [26 Posts] Mark the topic unread ::  View previous topic :: View next topic
 
Share on TwitterShare on FacebookShare on Google+Share on DiggShare on RedditShare on PInterestShare on Del.icio.usShare on Stumble Upon
Quick Reply
Username:


If you are visually impaired or cannot otherwise answer the challenges below please contact the Administrator for help.


Write only two of the following words separated by a sharp: Brotherhood, unity, peace! 

 
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


Powered by phpBB © phpBB Group

[ Time: 0.1830s ][ Queries: 13 (0.0103s) ][ Debug on ]