Coder Social home page Coder Social logo

Question about DATMovieTool about mgsdatool HOT 4 CLOSED

gdkchan avatar gdkchan commented on September 9, 2024
Question about DATMovieTool

from mgsdatool.

Comments (4)

gdkchan avatar gdkchan commented on September 9, 2024 1

Well, the error is caused because it seems to read a packet with a invalid length at some point on the file. It may be a error reading the previous packet, or maybe it is actually supposed like this. I need at least a screenshot of the relevant part of the file open on a hex viewer/editor to figure this out.

You can replace the FromStream method inside MGSDATool/DATMovieTool/IO/Packet/RawPacket.cs with the following code:

public static RawPacket FromStream(EndianBinaryReader Reader)
{
    RawPacket Packet = new RawPacket();

    Packet.StreamId = Reader.ReadUInt32();
    
    try
    {
        Packet.Data = new byte[Reader.ReadUInt32() - 8];
        Reader.Read(Packet.Data, 0, Packet.Data.Length);
    }
    catch
    {
        throw new System.Exception("Invalid Length at Address " + Reader.BaseStream.Position.ToString("x16"));
    }

    return Packet;
}

It will throw an exception with a more descriptive message, and the address that is being read from the file when the error occurs. You can then open the demo.dat on a hex editor (that supports big files) and attach a screenshot here so I can analyse what it is trying to read.

Also, out of curiosity, does the other tools works with the japanese version?

from mgsdatool.

gdkchan avatar gdkchan commented on September 9, 2024 1

Good to know that the tool worked on the original version of the game at least. Looking this image looks like it is indeed reading data from the wrong place. I remember that when I was analyzing those files (and I may be wrong in some places, since I'm not really used to work with video containers :P), I figured that it stores data into separate packets, so portions of the video stream is inside one package, audio in another one, and subtitles also on its own packet. So I made the tool skip all packet types except the "subtitle" and "end of stream" ones, that's what interests us. The rest is threated as a "raw packet", and the tool just copies the content of those packets directly to the output file untouched, while "end of stream" is basically the end of a video. Normally it have a small header that is common to all packets and it indicates the type of the packet, and also it's length. The issue here is that one of the lengths read by the tool seems to be wrong, so it tries to create an array with a invalid size to store the "raw" data. To figure out more and try to fix the issue I would need the actual file to do my tests. Unfortunately those files are pretty big and I know that uploading them is infeasible, but if you ever decide to go this way I can take a look on it.

About the file being corrupt - Can't say for sure, from what I understood you tested it on the english version from 2013 and the japanese version from 2008. IIRC when my translator friends was translating the game, we used the english version from 2008, and it worked too. So looks like only the japanese version from 2013 have the issue, the file being corrupt seems pretty likely to me, but I can't say for sure without looking the file.

About missing text files - Unfortunately I didn't worked on those yet. Some of those may be textures through.

from mgsdatool.

Joonie86 avatar Joonie86 commented on September 9, 2024

Thanks for the quick reply, yes your tools worked for other files, and by the way, there's good news.

I was able to get a hold of the version from 2008 [the version gave me the error was later version that included the trophy came out in 2013 ish?], your tool was able to get all the subtitles from that version.

Although the reason is still unknown whether the issue was caused by the incompatibility with the game version or the bad rip, I'm attaching the screenshot that may give you some clue.

If you think the issue is the file being corrupted, let me know I'll close this issue right away

https://i.imgur.com/PZAhvjP.png

By the way, I have another question, I noticed that these assets extracted from demo,movie,speech and codec don't include UI scripts, I wonder if you worked on those as well. (For example: option menu and item description and such)

thanks in advance!

from mgsdatool.

Joonie86 avatar Joonie86 commented on September 9, 2024

Thanks for the detailed answer, I really appreciate it, I did some analysis, apparently demo.dat hasn't changed for both EU/US since 2008, so I suppose that the rip I have may have been corrupted, theoretically, demo.dat should be the same for both 2008 and 2013 versions [JPN].

So I guess there's nothing I should worry about,

I have one more question before I close this issue,

there are several scenerio.gcx files in this game, and so far I was able to extract scripts from the scenerio.gcx from init folder only by using speech.dat.

I was wondering if there's any other way to extract those scenerio.gcx from other archive as well [mg_setup and such].

From what I heard, Russian translation team was able to modify stagexx.dat file as well.

from mgsdatool.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.