The Dink Network

Martridge - The DMOD Wizard

May 22nd, 04:26 PM
goblins.gif
drone1400
Peasant Male Romania
C# nerd 
What is this? The really short version is that it's a DFArc alternative running on .NET on Windows and Linux

The really long version is, go check out the github page: https://github.com/drone1400/martridge

Change Log: https://github.com/drone1400/martridge/blob/master/martridge/src/VersionInfo.txt

Update 2022-09-03
> V0.5.1.4 released on github

Update 2022-08-20
> V0.4.4 released on github

Update 2022-08-15
> V0.4.3 released on github
> V0.4.2 released on github
> V0.4.1 released on github
> Now using GithubReleases for hosting binaries

Update 2022-08-07
> V0.4.0 released on github and my OneDrive [Link Redacted]

Update 2022-07-24
> V0.3.0 is loaded on github now!
> Released binaries are currently on my OneDrive [Link Redacted]
> In the future I'll probably use GitHub releases, but for now I can't be arsed to learn how that works because it's late and I'm tired.

------------------------------
Original Post is below
------------------------------

A few months ago, I was chatting about this and that with Skurn and Bluedy over on the discords, when I had this idea...

FreeDink is cool, but it's kind of a hassle to install right for newcomers. Due to licensing issues and whatnot, you can't really distribute it bundled together with the original V1.08 Dink Data and etc. But then I thought, wait, couldn't you automate the installation process? Have a script or tool download FreeDink, download Dink V1.08, and install a copy of FreeDink with the original Dink data?

Anyway, long story short, I started working on something like that, and ended up with a kind of DFARC replacement application.

For lack of a better name, I've been calling it "Lil Dinky" [Probably gonna change this for the "final" release, but that is quite some ways away]

So what can this Lil Dinky do and where can you get it?
- Well, for now I have some "alpha" versions up on OneDrive, along with the source code to them: [Link Redacted]
- I'm releasing the source under MIT license, so anyone can do whatever they feel like with it
- It's developed in C# using Avalonia UI, with the intention that when it's done I might port it to Linux at some point...

What can it do so far?
- It can install a bunch of versions of Dink with but a few clicks of a button! [*]
+ FreeDink with V1.08 data and localization files for the main game
+ FreeDink with V1.08 data
+ Dink V1.08
+ Dink HD
- It can install DMODs
- It has a functional DMOD browser
- You can add *unlimited* DMOD installation folders / Dink engines and launch any of the dmods with whatever engine you choose [**]
- The DMOD browser looks kind of nice, I think
- You can define custom localization files for the text in the application itself, but I'm not going into detail on how that works right now...

[*] - So basically, the way the installer process works, is it downloads the game archives from over here on the dinknetwork.com, then it extracts certain files to a location of your choosing based on some whitelist/blacklist filtering. The installation is scriptable using the "config\configInstallerList.json" file... I should probably document this at some point.

[**] - Some limitations may apply, for example Dink V1.08 doesn't seem to like certain path formats...

What other features do I want to add but aren't included yet?
- An online DMOD browser (kind of like in DinkHD but nicer...);

What's the catch?
- This is a work in progress, there may be bugs, although hopefully nothing too severe! So far it "works for me (tm)" and Bluedy / Skurn managed to run it just fine too...
- I don't really have a manual for this thing or anything of the sort... (Although it should be pretty intuitive, that's the whole point after all)
- I kind of wanted to test it more, but Skurn/Bluedy/RobJ aren't really giving me any feedback about potential problems, so I suppose it works well enough?
- I'm basically posting this in the hopes that someone might test it and point out more issues / give me ideas on what to improve

Known issues
- Uh, apparently after you install a version of Dink for the first time, if you go to Tools -> Settings, it doesn't show up under "Game Locations" correctly until you hit Cancel and go to Tools -> Settings again... I thought I had fixed this but I guess I didn't yet

Other ramblings:
- So, over on the One Drive folder, I have some screenshots if you wanna see what it looks like!
Screenshots: [Link Redacted]
- The latest version right now is V0.0.4, so if you want to try it out, make sure to download that and not an older version.
- If you want to build it yourself, all you need to do is get Visual Studio Community edition and load up the solution file
- You can hit me up on discord for more info
- For now I'm just hosting the builds / source over on my One Drive, but I plan to upload it to github once it reaches a proper release state.

PS: Another reason I'm basically posting this, is that I feel like I'm behind schedule with finishing it and I'm trying to light a fire under my ass to motivate myself to get it done faster. Basically, feels like I had started off strong but then been getting sidetracked this last month.
May 22nd, 10:22 PM
custom_king.png
redink1
King Male United States xbox steam bloop
A mother ducking wizard 
This is a truly inspired idea. Great job!

When you finish, I can promote it on the main files page.
May 23rd, 01:41 AM
goblins.gif
drone1400
Peasant Male Romania
C# nerd 
Thanks!

It'll probably be a while longer. When I do the whole online dmod browser thing, I'll have to be careful and make sure I don't accidentally flood the website with requests. That would be very bad haha

(PS: Removed the shrug ascii emojis from the original post since I just realized they were not rendering correctly huh...)
May 24th, 04:25 AM
peasantmp.gif
Skurn
Peasant Male Equatorial Guinea xbox steam duck bloop
can't flim flam the glim glam 
can you also stop promoting dinkhd
June 13th, 01:41 PM
goblins.gif
drone1400
Peasant Male Romania
C# nerd 
Updates!

The Online DMOD browser is mostly working.

You can see all the DMODs, each individual file version release, all the reviews and the screenshots.

Files get cached locally so you don't have to download new things every 2nd time you look at the same dmod.

Here are some screenshots:
- Screenshot viewer
- DMOD versions
- Local DMOD Browser

Here is the current release, V0.1.1 and the source.

(Although you can also find them in the original link in the first post, it's the same one drive folder)

So what's left is basically:
- more testing
- more bug fixing
- GUI improvements
- other suggestions?
June 13th, 06:49 PM
spike.gif
Slipdink
Peasant Male United States bloop
2nd generation. No easy way to be free. 
- other suggestions?

I don't suppose you have plans to make this a multi-platorm application?
June 14th, 04:01 AM
goblins.gif
drone1400
Peasant Male Romania
C# nerd 
>I don't suppose you have plans to make this a multi-platorm application?

Actually, I do. Already using a multiplatform GUI framework, so the only issue with porting it on linux is my own inexperience with linux and figuring out how to use the 7zip library I'm using under linux.
It's probably gonna take a while though.
June 17th, 06:37 PM
goblins.gif
drone1400
Peasant Male Romania
C# nerd 
Sneaky peaky of LilDinky under Ubuntu 22.04

Ok, so the application itself runs without much trouble once built under lunix. But of course I can't quite unzip anything since I'm using a package that relies on a 7z.dll that can't work on linux.

Other than that, I've discovered that a package I use for messageboxes also breaks under linux. So I'll have to rewrite my own custom messageboxes, no biggie.

...and of course, the way the game launcher filter is set up right now, it has the user look for an .exe file, have to adapt that too.

So all in all, I'll have to get my bearings and figure out the unzipping thing since I never developed anything for linux before, but other than that it should be easy peasy.
June 18th, 09:40 AM
spike.gif
slipdink
Peasant Male United States bloop
2nd generation. No easy way to be free. 
7zip is available has been available for years as a command that runs in the shell. Maybe you could just exec that command with the parameters that you need to get the results that you need.
June 18th, 12:47 PM
goblins.gif
drone1400
Peasant Male Romania
C# nerd 
Yeah, that was my thought too. I was looking into p7zip actually: https://sourceforge.net/projects/p7zip/
Although, I'm also looking at this, https://github.com/adamhathcock/sharpcompress

I could do something like using the current 7zip lib wrapper on windows. Then on linux use Sharpcompress to install dmods without relying on running p7zip, and for installing freedink with v108 data, that can be handled through bash scripting (although I have to look into that a bit since i'm quite a noob when it comes to such things).

Although ideally... I wouldn't want to use two different LZMA packages for windows and linux, would much rather just use Sharpcompress directly on windows too, but alas it can't handle Dink V108 and Dink HD NSIS installer archives natively, so I have to parse the file a bit before i can decompress it. Currently looking into that.
June 18th, 05:53 PM
spike.gif
Slipdink
Peasant Male United States bloop
2nd generation. No easy way to be free. 
Well, if you need help with any linux/unix shell scripting let me know. The bash shell is quite powerful so you should be able to do anything you need to do.

One important thing to do is to choose a compression approach that will let everyone still use dfarc to install any dmod that Lil Dinky generates. After all, fans that get their first taste of dmods from Linux, pretty much have to use dfarc (at least to start). So, I'd guess that means making certain that Lil Dinky uses bzip2 as the actual compression algorithm.
June 19th, 06:06 AM
goblins.gif
drone1400
Peasant Male Romania
C# nerd 
OH!! Right!

I knew I was forgetting one important thing! I don't have any "pack dmod" option ahaha! I dunno how no one even mentioned that before!

Basically, since it detects a dmod folder, it just needs to .tar and then .bzip2 the dmod folder you select and that's it.

I do have one question though... The original DMOD format is kind of... broken. In the sense that it does not respect proper .tar format. The .tar-ed data needs to be a multiple of 512 bytes, so the file needs to be padded with 0x00s. Additionally the last two 512 byte blocks in the .tar file are supposed to be filled with 0x00, so that's 1024 more 0x00 padding bytes. Dmods do not respect this, so some dearchiving programs give you a warning that the archive is badly formatted or something when you manually extract it.

Now the question is, when generating a dmod file, and creating the .tar, should I respect the standard .tar format and pad the file with 0x00 at the end? Or should I just use the "borken" format that dmods use where all the extra 0x00s at the end get discarded?...

I imagine DFArc 3 can interpret both valid and incompelte .tar formats, but I dunno about older versions?...
June 21st, 05:56 AM
peasantmb.gif
yeoldetoast
Peasant Australia steam
I've come to get my meat 
Please for the love of God just generate regular GNU Tar-compliant tar.bz2 files. DFarc2 and older shouldn't be used by anyone for any reason at this point, and those non-compliant Tars are a nightmare for people who don't want to use a front-end. It will also save you a ton of effort.
June 21st, 08:54 PM
peasantmp.gif
Skurn
Peasant Male Equatorial Guinea xbox steam duck bloop
can't flim flam the glim glam 
i have no issues with dfarc2. i can only surmise there is nothing wrong with it.
June 21st, 10:46 PM
peasantmb.gif
yeoldetoast
Peasant Australia steam
I've come to get my meat 
I think it's only DFarc 1.x where Merlin made up his own Tar encoder anyway. Everything from 2 onwards should be compliant.
June 22nd, 12:46 PM
goblins.gif
drone1400
Peasant Male Romania
C# nerd 
@yeoldetoast
>and those non-compliant Tars are a nightmare for people who don't want to use a front-end
Haha, I've definitely been frustrated dealing with that before...

>It will also save you a ton of effort.
Yeah, I suppose it does, since I don't have to take a valid .tar and "break" it for the sake of buggy legacy compatibility :V
July 4th, 03:26 AM
goblins.gif
drone1400
Peasant Male Romania
C# nerd 
Man, I am absolutely miffed! I am seething and malding and coping as the kids say!

For some odd reason, both SharpCompress and ZipLibSharp don't seem to work when BZIP2-ing large dmods! Or rather they work, but they are insanely slow! What the heck?

For reference, bzip2-ing a Periculo tar (about 627 MB) with 7zip in windows, using block size 1, takes about 10 seconds. The two libraries I mentioned seem to take minutes in C#! Heck, bzip2-ing a Pilgrim's Quest tar, which is far smaller, with ZipLibSharp took over 40 seconds at block size 1!

Guess I need to find some more efficient bzip2 library out there or maybe implement my own and see how that goes?...

Edit: It seems I jumped the gun and the reasoning behind this is quite simple. 7zip uses multithreading for bzip2 compression so it is much faster...
July 10th, 12:07 PM
goblins.gif
drone1400
Peasant Male Romania
C# nerd 
Made some progress parallelizing SharpCompress's BZIP2 algorithm, but it still feels quite slow. Taking about 3 minutes to compress the Periculo tar on the highest compression setting (block size 9). It is better than before, when it took forever (tm), but it is still horrible.

I'll see if I am able to optimize anything else about it and if not, next week I'll probably just continue working on the dinky using my current modifications...

Edit:

Well well well, I found some other bzip2 C# implementation that seems to be faster than SharpCompress multithreadded out of the box getting about 2 minutes in single thread mode for the Periculo tar. Modified it to also be multithreadded, and now I'm getting about 20 seconds to bzip2 the tar.

I should be able to put all of this together and have a Dinky update next weekend with the dmod packing feature (working fast as lightning too) and also partial* linux support.

* by partial I mean that currently it won't have the automated Dink game installer part, since that is a bit more complicated on linux.
July 24th, 02:54 PM
goblins.gif
drone1400
Peasant Male Romania
C# nerd 
Finally got around to finishing a new version and uploading it on github. First post has been edited and links are posted there!
July 24th, 03:11 PM
death.gif
Seems like the default Windows zip program can't unpack the file. 7-zip manages it flawlessly though.
July 24th, 03:18 PM
goblins.gif
drone1400
Peasant Male Romania
C# nerd 
Hmm, I archived the file using 7-zip, but I don't remember what compression i used for it?...

Edit: I think I was using BZIP2 compression instead of ZIP's default Deflate. I re-zipped the windows files and reuploaded them to one drive.
July 24th, 03:45 PM
peasantmp.gif
Skurn
Peasant Male Equatorial Guinea xbox steam duck bloop
can't flim flam the glim glam 
oh no, more archiving stuff
August 7th, 06:43 AM
goblins.gif
drone1400
Peasant Male Romania
C# nerd 
Updated to V0.4.0
Files are on the same OneDrive link in the first post under the V0.4.0 folder. Source is included there and on github.

Changes are here: https://github.com/drone1400/martridge/blob/master/martridge/src/VersionInfo.txt

August 15th, 11:21 AM
goblins.gif
drone1400
Peasant Male Romania
C# nerd 
Hear ye hear ye, I have sucessfully finished setting up automagic releases set up on github so now you can download the application directly from GitHub over at: https://github.com/drone1400/martridge/releases

Edit: There was a small issue but it's fixed now
September 3rd, 12:05 PM
goblins.gif
drone1400
Peasant Male Romania
C# nerd 
V0.5.1.4 is up on github https://github.com/drone1400/martridge/releases/tag/V0.5.1.4

I've added some special handling for launching a dmod with WinDinkEditPlus. Basically, you could launch any dmod with an editor application before too, but WinDinkEditPlus, being absolutely amazing, has some issues...

So the main issues with WDEP in 2022 on Windows 10 are two:
1. It tries to store config files in the C:\Windows directory, thus you need to launch it as admin at least once to configure the Dink installation directory...
2. It can't open a DMOD unless it is a subdirectory of WDEP's known Dink installation directory

I've implemented some automagic workarounds for this in Martridge like this:
1. If a config file is not found, then it asks you if you want to launch WDEP as admin so that it can save its initial config file in the C:\Windows dir, of course you are free to decline, but then you'll have to manually launch it as admin yourself
2. If a DMOD isn't a subdirectory of WDEP's known Dink directory, Martridge will ask you if you want to create a symbolic link to the DMOD directory. By creating a symbolic link to the DMOD inside the Dink directory, as far as WDEP is concerned, the DMOD is in the Dink directory and will be able to load it just fine. Martridge shows you an alret window where it asks you if you want it to launch a CMD.exe process as admin and run the command to create a symbolic link automatically, OR if you don't want it to do anything by itself, it gives you the full command in a textbox, so you can manually run it and create the symbolic link directory yourself.

NOTE: I've only really tested this working properly with the latest version of WinDinkEditPlus 2. I *ASSUME* that is the version everyone is using nowadays, but please correct me if I'm wrong...

EDIT: Planned upcoming changes:
- option for saving DMOD launch options on a per DMOD basis (as requested by Bluedy)
- figuring out a way to improve the DMOD launcher application selection