Users browsing this thread: 1 Guest(s)
Hyper light drifter
#1
So I wonder is there any sprite sheet for hyper light drifter? if not could someone rip it for me or at least tell me how to do so I'm using the sprites for a project I've been working on
Reply
Thanked by:
#2
This is not a request forum.
God is good.  Big Grin


An old fart who sits on a chair, giving animation and pixeling advice,... and calls everyone son...
Reply
Thanked by:
#3
Oh hey I've been working on ripping this game among my other projects. I guess I'll share what I know. This ended up being kinda image-heavy so I stuck them all in spoilers

From what I've discovered, there is no easy way to extract the sprites from this game in an organized manner. It's possible, yes, but tedious! So I'll cover both the easy way (which will net you the disorganized sprites) and the hard way (organized sprites).

So to start off, nearly all of the game's content is stored in the .exe. Extract it with 7-Zip or your preferred unzipping program (You might get a checksum error but it doesn't affect anything so you can ignore it) and you'll see this in the folder you extracted to:

See that big ".data" file? That's where our sprites are stored. It has all the sounds in it too if you're interested in those. Now, for the easy way:

If you don't have one already, download a general ripping program like DragonUnPACKer or X-Ripper. I used DragonUnPACKer so I'll show the steps for that; I don't remember how X-Ripper works but it should be similar. So start up the program and open the .data file. DragonUnPACKer will open HyperRipper:

Click the formats tab and scroll through the formats list, and make sure "PNG" is checked. Then click the search tab and click "Search"; the program will scan for all PNG's and when it's done it will display a list of all of them. If you're looking for specific sprites you can click on a png file to preview it so you know which one to extract. To extract a file, right click on it, click "Extract file to" and then "Without conversion". To extract everything at once, click a PNG in the list, hit ctrl + a on your keyboard to select the whole list, then right click and extract. If you extracted everything you'll have 151 PNG's in the folder you extracted to, and they'll look like this:

If you don't care about them not being organized, then you don't have to read any further if you don't want to because I'm gonna cover the harder way next.

Hyper Light Drifter was made with Game Maker, and generally games made with this engine have their data stored in a "data.win" file. Remember our ".data" file? That's actually a data.win file wrapped in extra lines of data. Because of this extra data it's unreadable by dedicated Game Maker-ripping programs (one of which we are going to use in a bit).

For this step you're going to need a hex editor (I am using HxD https://mh-nexus.de/en/hxd/). Open the .data file with the hex editor. We are going to delete the extra data; this part is tricky so read carefully. Usually hex-editing programs show somewhere the offset (the "location" in the file) of the byte you've highlighted. In HxD's case, it's in the bottom left corner. By default it automatically highlights offset 0 when you first open a file, the very first byte in the file. If you highlight more than one byte HxD will show the first and last offest you've selected at the bottom of the window, under a "Block" label.

First we are going to delete the unnecessary code at the beginning of the file. Highlight offest 0 to 3A6F3 and delete it using backspace. It's a lot of code to select, so to speed things up HxD has a select option to automatically select the block of code you want, using the beginning and ending offsets. Click the "Edit" tab, and click "Select block". Make sure the window looks like this, with your beginning and ending offset entered, before you click "OK":

Once you hit "OK" it will select all of the code in those offsets, and you can press backspace to delete it. So now when you scroll to the top, where the beginning of the file is, it should look like this:

See the word "FORM" on the right? That's actually what the dedicated ripper programs look for when opening a file, to check if it's a data.win or not. But because of the extra data that's still at the end, it still won't be readable.

To delete the extra data on the end highlight offset 24562EB0 to 2458AD0B. You can use the "Select block" option again to highlight the code and just as before, press backspace to delete it. So now the end of the file should look like this:

If you followed all these steps correctly, you should now have a readable data.win file! So save this as "data.win". We are going to open this in a dedicated ripper next. There are a lot of programs that can rip Game Maker games out there but for this game in particular the only one I've had success with is UndertaleModTool https://github.com/krzys-h/UndertaleModTool/releases. Open your data.win file in UndertaleModTool and there should be a list of items on the left side. Expand "Sprites" and you will now have a list of every animation. Double click an animation and you will see something like this:

You can click on every "UndertaleTexturePageItem" to preview the sprites in the animation in the box below. To rip all the sprites in the animation, click "Export all frames", select where you want to export and UndertaleModTool will dump all the sprites in the animation in a new folder, in order:

Rinse and repeat for all the animations you want. This is why it's so tedious because as far as I can see this program has no bulk export option for individual sprites. I've found other tools that can bulk export all the sprites but because there are so many in this game, all of them crash. And I know they're working fine because they rip another Game Maker game I have that has less sprites perfectly... Or maybe my laptop's crappy, I don't really know at this point.

I think I covered everything. Hope this helps!

Edit, I'm not sure if anyone will see this but I'm sharing it anyway: I found a way to export all the sprites at once! UndertaleModTool's dev branch and the latest release both include a script to export all the sprites, but they have an issue where it crops them instead of exporting the sprites in each animation with equal dimensions. Here's the modified script which will work with the previous release, 0.2.0, which does not have this issue:

Code:
using System.Text;
using System;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using UndertaleModLib.Util;

int progress = 0;
string texFolder = GetFolder(FilePath) + "Export_Textures" + Path.DirectorySeparatorChar;
TextureWorker worker = new TextureWorker();

Directory.CreateDirectory(texFolder);

UpdateProgress();
await DumpSprites();
HideProgressBar();
ScriptMessage("Export Complete.\n\nLocation: " + texFolder);

void UpdateProgress() {
    UpdateProgressBar(null, "Sprites", progress++, Data.Sprites.Count);
}

string GetFolder(string path) {
    return Path.GetDirectoryName(path) + Path.DirectorySeparatorChar;
}


async Task DumpSprites() {
    await Task.Run(() => Parallel.ForEach(Data.Sprites, DumpSprite));
}

void DumpSprite(UndertaleSprite sprite) {
    for (int i = 0; i < sprite.Textures.Count; i++)
        if (sprite.Textures[i]?.Texture != null)
            worker.ExportAsPNG(sprite.Textures[i].Texture, texFolder + sprite.Name.Content + "_" + i + ".png");

    UpdateProgress();
}

Paste this code into notepad and then make sure you save it as a .csx file, otherwise it won't work. From there, once you have your data.win loaded up, click "Scripts", "Run other script", and select the csx file you just made. The tool will make a new folder and dump all the sprites in it (This will take a while because this game has so many sprites but at least it doesn't crash like the other tools I've tried did XD)
Reply
#4
Hey there! I have just gotten into modding some games and was looking for some PNG Sprites for HLD and found this thread.

I have created the .data file, and then attempted to edit it. The start and the end of the code looks like the screenshot, but I am being given an error when attempting to open it with the UndertaleModTool that you linked to that says "Seeking beyond end of the stream".

I have double checked the file at is ends on the same byte that your screenshot does and begins with "FORM", so I'm not sure what I could be doing wrong. Any help would be really appreciated.
Reply
Thanked by:
#5
(12-15-2020, 04:47 PM)TamiJo Wrote: (snip)

Hey there! so, I appear to be unable to replicate this issue. Unsure Just to be sure, are you running version 0.2.0? If not, try using that version, you'll need it to use the script anyway: https://github.com/krzys-h/UndertaleModT.../tag/0.2.0
Reply
Thanked by: TamiJo
#6
Thank you, modern wizard. You are in fact amazing! Big Grin Usually these simple things are the issue.
Reply
Thanked by:
#7
i made an acc just to say thanks Sei! (i know its been quite some time since this thread was made lol)

although i was not trying to rip the sprites i used ur method to rip the wav files from the .data file.
i was wondering if u knew of any way to organize audio files automatically?

anyway thanks Big Grin
Reply
Thanked by:
#8
(04-07-2022, 08:48 PM)chrisiguess Wrote: i made an acc just to say thanks Sei! (i know its been quite some time since this thread was made lol)

although i was not trying to rip the sprites i used ur method to rip the wav files from the .data file.
i was wondering if u knew of any way to organize audio files automatically?

anyway thanks Big Grin

It doesn't work for me and it's because I have another version of the game :/
I just need to remove the extra line at the end, but I don't know what offset is
Reply
Thanked by:


Forum Jump: