Samtastic
He/Him
Player (154)
Joined: 11/30/2012
Posts: 775
How do I run the java file?
Enjoys speedrunning, playing and TASing Oddworld games! Has TASed: Oddworld: Abe's Oddysee in 12.06.13 (with Dooty) Oddworld: Adventures II in 20.03.78 (with Dooty) Oddworld: Abe's Exoddus 100% in 2:08:28.4 (with Dooty) Oddworld: Abe's Oddysee 100% in 1:05:01.65 Oddworld: Abe's Exoddus in 37:18 Oddworld: Abe's Exoddus in 37:15 Oddworld: Abe's Exoddus 100% in 2:!5.44.12 Oddworld: Abe's Oddysee any% in 13:01.3 Oddworld: Abe's Oddysee any% in 12:59.95 Oddworld: Abe's Oddysee 100% in 1:04:16.27 Oddworld: Abe's Oddysee 100% in 1:04:01.07 Currently working on: Waiting for Windows TAS Tools to work so I can TAS PC version of Exoddus.
Samsara
She/They
Senior Judge, Site Admin, Expert player (2239)
Joined: 11/13/2006
Posts: 2822
Location: Northern California
Samlaptop wrote:
How do I run the java file?
Don't quote me on this, but I hear Java works really well for that.
TASvideos Admin and acting Senior Judge 💙 Currently unable to dedicate a lot of time to the site, taking care of family. Now infrequently posting on Bluesky
warmCabin wrote:
You shouldn't need a degree in computer science to get into this hobby.
Editor, Experienced player (570)
Joined: 11/8/2010
Posts: 4036
EDIT: I just remembered that TAS Movie Editor's C# source is available, and it reads PXMs! Maybe we could take the header+input binary reading from that. No need to reinvent the wheel, as they say.
Samlaptop wrote:
How do I run the java file?
I'll repost my instructions from earlier, with some additions: 1: Name your PJM file "convert.pjm" for DualShock output, or "convert_pad.pjm" for Gamepad/Standard Controller output and place it in the same folder as PJMConverter.jar. 2: Double-click on PJMConverter.jar. As long as you have Java installed, it will quickly convert your file into an Input Log.txt, which will appear in the same folder. Open this file. 3: Create a new movie in BizHawk while running your game if you haven't already, then Stop Recording. 4: Open the BK2 as an archive. (If using 7-Zip to open it, go to Tools>Options>Folders and set the working folder to Current.) 5. Open the archive's Input Log.txt, delete everything and copy-and-paste the entire Input Log.txt file that was generated by the program there. 6. Save the text file and close it as well as the BK2 archive. You now have a converted BK2! This will work for PJMs in text format, aka PXM Version 2 (not PXMs or PJMs in binary mode). Thank you to AdituV for starting work on the binary portions: I'm quite the beginner at both binary and C#. Reading the PXM/PJM header will be needed for incorporation into BizHawk, so I look forward to seeing what you come up with.
BALIST0N wrote:
but your code is so nice to read ! (many comments, clear functions etcc)
Thank you! I tried to make it easy to read.
Player (75)
Joined: 8/26/2015
Posts: 70
Heh, I forgot about that too. I guess my project is cancelled after all, as it's basically just a X-to-BK2 log converter with user file format definitions. Also, less on topic, I'm less keen on the control flow in your code, CoolKirby. It's clear if you have time to read through it all, but less clear to get an overview of the steps involved. That is, I'd prefer to see a structure more like this (in C#, but it's rather similar to Java)
    public static void Convert(string path) {
        bool dualShock = false;

        // Automatic try-finally to dispose of the file handle.
        // StreamReader is analogous to BufferedReader
        using(StreamReader sr = new StreamReader(path)) {
            PJMHeader h = ParseHeader();
            if(h.P1ControllerType == ControllerType.AnalogController) {
                dualShock = true;
            }

            int numLines = countLines(dualShock);
            InputLog log = parseFile(sr, dualShock, numLines);
        }
    
        using(StreamWriter sw = new StreamWriter(outputPath)) {
            saveFile(sw, log, dualShock);
        }
    }

That is, I'd like to see a method describing the order of steps, rather than each step then calling the next. Your commenting is awesome, though. I'm way too lazy on that :P
Samtastic
He/Him
Player (154)
Joined: 11/30/2012
Posts: 775
Here is the PXM movie I want to conver to bk2: http://dehacked.2y.net/microstorage.php/info/646449625/movie.pxm
Enjoys speedrunning, playing and TASing Oddworld games! Has TASed: Oddworld: Abe's Oddysee in 12.06.13 (with Dooty) Oddworld: Adventures II in 20.03.78 (with Dooty) Oddworld: Abe's Exoddus 100% in 2:08:28.4 (with Dooty) Oddworld: Abe's Oddysee 100% in 1:05:01.65 Oddworld: Abe's Exoddus in 37:18 Oddworld: Abe's Exoddus in 37:15 Oddworld: Abe's Exoddus 100% in 2:!5.44.12 Oddworld: Abe's Oddysee any% in 13:01.3 Oddworld: Abe's Oddysee any% in 12:59.95 Oddworld: Abe's Oddysee 100% in 1:04:16.27 Oddworld: Abe's Oddysee 100% in 1:04:01.07 Currently working on: Waiting for Windows TAS Tools to work so I can TAS PC version of Exoddus.
Samtastic
He/Him
Player (154)
Joined: 11/30/2012
Posts: 775
So how am I going to convert the pxm file now into bk2?
Enjoys speedrunning, playing and TASing Oddworld games! Has TASed: Oddworld: Abe's Oddysee in 12.06.13 (with Dooty) Oddworld: Adventures II in 20.03.78 (with Dooty) Oddworld: Abe's Exoddus 100% in 2:08:28.4 (with Dooty) Oddworld: Abe's Oddysee 100% in 1:05:01.65 Oddworld: Abe's Exoddus in 37:18 Oddworld: Abe's Exoddus in 37:15 Oddworld: Abe's Exoddus 100% in 2:!5.44.12 Oddworld: Abe's Oddysee any% in 13:01.3 Oddworld: Abe's Oddysee any% in 12:59.95 Oddworld: Abe's Oddysee 100% in 1:04:16.27 Oddworld: Abe's Oddysee 100% in 1:04:01.07 Currently working on: Waiting for Windows TAS Tools to work so I can TAS PC version of Exoddus.
Editor, Experienced player (570)
Joined: 11/8/2010
Posts: 4036
Wow, that looks a lot better! I agree, that flows better than just jumping to the next function (and having to accumulate all those variables). It actually inspires me to continue working on this. How far did you get in your code for reading PXMs? Samlaptop, we haven't made the converter yet. We have to code a way to read the header and input first, then we'll test it out with your movie.
Player (75)
Joined: 8/26/2015
Posts: 70
I'm actually just writing the binary-format PJM code into BizHawk now as a way to help test another change I made. As PXM is essentially compatible with binary PJM, I'm very close to untested but done. My working branch is at https://github.com/adituv/BizHawk/tree/MovieReflection Edit: I've tried converting SamLaptop's movie file with my WIP code, but I can't easily check it's converted correctly. Could you please verify it please or tell me where the file is incorrect? http://tasvideos.org/userfiles/info/25668746554308743
Samtastic
He/Him
Player (154)
Joined: 11/30/2012
Posts: 775
AdituV wrote:
I'm actually just writing the binary-format PJM code into BizHawk now as a way to help test another change I made. As PXM is essentially compatible with binary PJM, I'm very close to untested but done. My working branch is at https://github.com/adituv/BizHawk/tree/MovieReflection Edit: I've tried converting SamLaptop's movie file with my WIP code, but I can't easily check it's converted correctly. Could you please verify it please or tell me where the file is incorrect? http://tasvideos.org/userfiles/info/25668746554308743
It looks good but it fails to replay and can't find sync settings.
Enjoys speedrunning, playing and TASing Oddworld games! Has TASed: Oddworld: Abe's Oddysee in 12.06.13 (with Dooty) Oddworld: Adventures II in 20.03.78 (with Dooty) Oddworld: Abe's Exoddus 100% in 2:08:28.4 (with Dooty) Oddworld: Abe's Oddysee 100% in 1:05:01.65 Oddworld: Abe's Exoddus in 37:18 Oddworld: Abe's Exoddus in 37:15 Oddworld: Abe's Exoddus 100% in 2:!5.44.12 Oddworld: Abe's Oddysee any% in 13:01.3 Oddworld: Abe's Oddysee any% in 12:59.95 Oddworld: Abe's Oddysee 100% in 1:04:16.27 Oddworld: Abe's Oddysee 100% in 1:04:01.07 Currently working on: Waiting for Windows TAS Tools to work so I can TAS PC version of Exoddus.
Player (75)
Joined: 8/26/2015
Posts: 70
Right, oops, I forgot to store the sync settings in there. This new version looks a lot better, I hope, and the input looks about right. http://tasvideos.org/userfiles/info/25689396370941157
Samtastic
He/Him
Player (154)
Joined: 11/30/2012
Posts: 775
AdituV wrote:
Right, oops, I forgot to store the sync settings in there. This new version looks a lot better, I hope, and the input looks about right. http://tasvideos.org/userfiles/info/25689396370941157
It looks good and it actually opens up perfectly in Bizhawk. Now I just need to go into TASstudio and fix the X at the start. Once that's all sorted Abe should be up and running! Thanks for the conversion AdituV!
Enjoys speedrunning, playing and TASing Oddworld games! Has TASed: Oddworld: Abe's Oddysee in 12.06.13 (with Dooty) Oddworld: Adventures II in 20.03.78 (with Dooty) Oddworld: Abe's Exoddus 100% in 2:08:28.4 (with Dooty) Oddworld: Abe's Oddysee 100% in 1:05:01.65 Oddworld: Abe's Exoddus in 37:18 Oddworld: Abe's Exoddus in 37:15 Oddworld: Abe's Exoddus 100% in 2:!5.44.12 Oddworld: Abe's Oddysee any% in 13:01.3 Oddworld: Abe's Oddysee any% in 12:59.95 Oddworld: Abe's Oddysee 100% in 1:04:16.27 Oddworld: Abe's Oddysee 100% in 1:04:01.07 Currently working on: Waiting for Windows TAS Tools to work so I can TAS PC version of Exoddus.
Editor, Experienced player (570)
Joined: 11/8/2010
Posts: 4036
Awesome work, AdituV! I wasn't even close to adapting this to BizHawk's code structure.
Samtastic
He/Him
Player (154)
Joined: 11/30/2012
Posts: 775
Well, I couldn't get the entire movie to sync but I am in the process of redoing all the frames in a new movie and I can use some frames that will sync. This converted file will help me a lot when it comes to the DDG sections when Abe is invisible! Thanks a lot AdituV!
Enjoys speedrunning, playing and TASing Oddworld games! Has TASed: Oddworld: Abe's Oddysee in 12.06.13 (with Dooty) Oddworld: Adventures II in 20.03.78 (with Dooty) Oddworld: Abe's Exoddus 100% in 2:08:28.4 (with Dooty) Oddworld: Abe's Oddysee 100% in 1:05:01.65 Oddworld: Abe's Exoddus in 37:18 Oddworld: Abe's Exoddus in 37:15 Oddworld: Abe's Exoddus 100% in 2:!5.44.12 Oddworld: Abe's Oddysee any% in 13:01.3 Oddworld: Abe's Oddysee any% in 12:59.95 Oddworld: Abe's Oddysee 100% in 1:04:16.27 Oddworld: Abe's Oddysee 100% in 1:04:01.07 Currently working on: Waiting for Windows TAS Tools to work so I can TAS PC version of Exoddus.
Editor, Experienced player (570)
Joined: 11/8/2010
Posts: 4036
Looks like the PJM/PXM Importer was merged into BizHawk's code less than an hour ago. Way to go, AdituV!