Lacrima Castle
HelpSearchMembersCalendar

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> DHE Codecs, Dissecting the games
whoyodaddy
post Sep 23 2012, 03:27 AM
Post #1


Had 2 cookies than ate 1
****

Group: Arcs
Posts: 190
Joined: 4-January 06
From: U.S.A
Member No.: 36



Hello all. I've started a GitHub repo for a project Rai and I have essentially been working in for five years very sporadically, the same project that provided a lot of the RiviPSP content on the site.
It's where we nerd out and hack proprietary file formats in St!ng games.

BUT WAIT
You can help too. That's why started a repo. There's a wiki on the repo where I am documenting our efforts in decrypting these files, and a number of python files needing coding. Trust me, you can probably help. Python is super easy to learn (you can practically read it as is, though some of this code will require some studying up), and even if you're not in the mood to code, you can help with the wikis and other stuff. Dunno, there's plenty to be done though.

My only request is that you not upload files from the games, whether directly from the game or decrypted by the tools, to the repo. I don't want legal issues, and these files take a lot of space and make working with the repo slow.

Help out if you can, and if you can't... Learn! Seriously, there's a lot that can be done and a lot of the main stuff can be learned in a weekend.
For example, one thing that needs to be done is the LIM decoder. I even have the spec for the LIM file format up in the wiki, and an algorithm that only needs to be translated into python (although I wrote it with python more or less in mind, so it's pretty simple to figure out). And you don't need to solve everything to contribute! Even adding one line of code or documentation to the wiki helps.

My current goal is to get all of the archive decrypting tools documented and maybe even coded (they are the easiest of all to code) so that it's easier for people to start probing and working with the files we actually want.


~~~
user posted image
Even a hero is just a person. And people are suseptable to all kinds of injury or pain.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
DavidSchinkel
post Sep 25 2012, 05:32 AM
Post #2


Shy
*

Group: Arcs
Posts: 42
Joined: 10-June 10
From: Gig Harbor, Washington
Member No.: 2071



Huh. A BMP to LIM converter is feasible.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Hayashi Tenshi
post Sep 25 2012, 08:25 PM
Post #3


Dew Prism
******

Group: Flunkies
Posts: 313
Joined: 18-October 08
From: Prowler
Member No.: 1799



I think there's a couple of St!ng formats we could feasibly create. I think the AMP file format is also quite sufficiently dissected (though I haven't put up the spec yet) that we could make custom sprite sheets for RiviPSP with fair ease.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
tempest drake
post Jan 15 2013, 08:48 PM
Post #4


Shy
*

Group: Arcs
Posts: 36
Joined: 9-May 09
Member No.: 1879



For those not following the project, progress has been slow. I've been drifting between six or seven projects, and I'm the only one working on it as far as I know, so this is what is done so far:

-DAR and AFS archives are extricable
-Gungnir TPL files, except for sprites, are extricable

Technically you could use the TPL class to extract other TPL files, even sprite ones, but there are some issues. For non-Gungnir TPL files, the colors are in BGRA format, whereas for Gungnir they're in a more normal RGBA format. I haven't figured out how to determine coloring order yet. As for sprites, with how they work you could extract all of the pixels into an image you could then decipher into the specific sprite you wanted, but sprite construction is still something I'm working on incorporating into the class. I have it all figured out (or so I think), I just haven't yet written out the algorithm.


Edit: MAYBE if you were into GameCube hacking you've encountered TPL files before. It's a texture format used by a lot of GC games, but St!ng likes to do their own thing. I imagine they were introduced to the format when they made Evolution Worlds, and now they use it for some of their disc-based games, but a modified one. (Heavily modified as of Gungnir.)

This post has been edited by Dr Sturm: Jan 16 2013, 01:51 AM


~~~
IPB Image
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Yukira
post Jan 17 2013, 12:27 AM
Post #5


Shy
*

Group: Arcs
Posts: 35
Joined: 12-June 06
Member No.: 134



Sturm, did you look at my Gungnir dropbox work with picture viewer?


~~~
IPB Image
Dept.Heaven Episodes 1 Union 2 !!!
Lolz =))
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Bass EX
post Jan 17 2013, 10:12 PM
Post #6


Lazy


Group: Arcs
Posts: 18
Joined: 18-January 08
From: Hangar 18
Member No.: 1686



I don't know what picture viewer is, and the terms together are far too vague for Google to produce results. My guess is that it is the Windows preview software, in which case I haven't access to such a thing.


~~~
There are two words that will open up many doors for you: 'Pull' and 'Push'.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
drag10
post Jan 19 2013, 02:04 PM
Post #7


Lazy


Group: Arcs
Posts: 17
Joined: 8-April 08
Member No.: 1720



It's a program I wrote in C++ that views files from Gungnir. displayTPL.exe.

It requires OpenGL and GLUT, unfortunately. Teach me Python displays.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Seth-Rah
post Jan 19 2013, 07:19 PM
Post #8


Lazy


Group: Arcs
Posts: 17
Joined: 3-March 09
Member No.: 1848



You could use PyGame or wxPython to run pyOpenGL through a windowed interface. I'm just making classes that can process the data in the files and then return it in a usable way, using Python because of the readability of the code, simple cross-platform usability and large amount of libraries. Right now all it does is output a png, but it could easily be adjusted to return pixel data that could be ouput to a UI surface. With some of the formats I've been trying to plan ahead for insertion/creation.

Now that I think about it, I have Objective C/GL code from when I was outputting the RiviTPL files to a cocoa GL surface.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Sajo
post Jan 22 2013, 03:51 AM
Post #9


Lazy


Group: Arcs
Posts: 21
Joined: 7-January 06
From: VA, USA
Member No.: 39



BAHAHAHA
I have Gungnir sprites. I just went through 330 Julios making sure they were all working, so I think I have the algorithm down (even worked out some surprises*)
IPB Image


* As for surprises, the start read parameter in the assembly blocks, the little short in the middle of the six-byte arrays, is actually two values crammed into one. The most significant six bytes are the row, the least significant ten the column.


Pretty sure the animation information is in the associate .bin files, which I've finally started poking through. But for now I'm going to keep working with TPLs, rip all the Gungnir sprites and see if I can reconcile the program with Sting's different hackings of the TPL files.

Regarding that, the sprite above has a third TPL section that I haven't figured out. There's a 32 byte header followed by the exact same palette, twice. It has the same format marker in the TPL header as sprite assembly info (the 0xFFFF). I imagine as I get to generic enemies it will turn out to be alternate palettes, but I don't know why they needed to include it for Julio if his palette doesn't change. WE SHALL SEE.


~~~
user posted image
:The Solitary Angel, Ledah:
You are quiet and reserved though your love of solitude doesn't keep you from making contact with others. Not given to sharing aspects of your personal life and history, you value loyalty above all else and present a very sophisticated and cultured, if remote, front.
<br><br><a title="Take this quiz at Quizilla" href="http://www.quizilla.com/redirect.php?statsid=57&url=http://quizilla.com/users/Stroud-chan/quizzes/Which%20Riviera%3A%20The%20Promised%20Land%20character%20are%20you%3F"> Which Riviera: The Promised Land character are you?</a><BR> <font size="-2">brought to you by <a title="Quiz, Horoscope, Flash Games, Poems - Quizilla!" href="http://www.quizilla.com/redirect.php?statsid=56&url=http://www.quizilla.com">Quizilla</a></font>
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
AzureDemon
post Jan 23 2013, 02:20 AM
Post #10


Lazy


Group: Arcs
Posts: 16
Joined: 23-September 08
Member No.: 1785



Regarding bin files (for Gungnir animations)...
Still kind of working on it. The structure as far as I can tell consists of a header of 20 bytes (two addresses, two run lengths and one unknown item), followed by two blocks of offsets, the first block pointing to the second and the second to another block, which contains code of some sort that I'm presuming describes animation frames but I'm still working on deciphering it. Following the second block is some semi-mysterious data, but I think the "code of some sort" references it, and I think it actually references the frames as the constructed frames from the TPL files. This section is only present for TPL files with many sprites. However, I know that in this code:
CODE
0x01 = End Command (0x20 and 0x51 will both be met by this at the end)
0x20 = Animation Start
    0x10 = Frame description (three parameters)
        B1: Unknown
        B2: Frame number (from TPL)
        B3: Unknown
0x51 = Animation Start (larger sprites)
    0x## = First four bytes following 0x51 are always a number, power of 2
    0x50 = Frame Description (four parameters)
        B1: Unknown
        B2: Offset of Frame Info in mysterious section
        B3: Unknown
        B4: Unknown

0x23 and 0x21 are other probable commands


What might make it extra hard: Some of the frames I've been extracting from the TPLs are hands (and feet and other limbs). They're frames intended to be pasted over weapons which are pasted over hands, giving the illusion of holding an item.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 15th September 2025 - 05:43 AM