The Dink Network

Martridge - The DMOD Wizard

May 22nd 2022, 04:26 PM
goblins.gif
drone1400
Peasant He/Him 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

LATEST RELEASE: https://github.com/drone1400/martridge/releases/tag/V0.7.0.1

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

Update 2024-04-14
> V0.7.0.1 released on github

Update 2023-04-03
> V0.6.4.0 released on github
> V0.6.3.0 released on github

Update 2023-04-01
> V0.6.2.0 released on github
> V0.6.1.0 released on github

Previous releases:
> V0.6.0.0 released on github
> V0.5.2.0 released on github

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 2022, 10:22 PM
custom_king.png
redink1
King He/Him United States 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 2022, 01:41 AM
goblins.gif
drone1400
Peasant He/Him 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 2022, 04:25 AM
peasantmp.gif
Skurn
Peasant He/Him Equatorial Guinea duck bloop
can't flim flam the glim glam 
can you also stop promoting dinkhd
June 13th 2022, 01:41 PM
goblins.gif
drone1400
Peasant He/Him 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 2022, 06:49 PM
spike.gif
Slipdink
Peasant He/Him United States bloop rumble
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 2022, 04:01 AM
goblins.gif
drone1400
Peasant He/Him 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 2022, 06:37 PM
goblins.gif
drone1400
Peasant He/Him 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 2022, 09:40 AM
spike.gif
slipdink
Peasant He/Him United States bloop rumble
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 2022, 12:47 PM
goblins.gif
drone1400
Peasant He/Him 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 2022, 05:53 PM
spike.gif
Slipdink
Peasant He/Him United States bloop rumble
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 2022, 06:06 AM
goblins.gif
drone1400
Peasant He/Him 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 2022, 05:56 AM
peasantmb.gif
yeoldetoast
Peasant They/Them Australia
LOOK UPON MY DEFORMED FACE! 
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 2022, 08:54 PM
peasantmp.gif
Skurn
Peasant He/Him Equatorial Guinea 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 2022, 10:46 PM
peasantmb.gif
yeoldetoast
Peasant They/Them Australia
LOOK UPON MY DEFORMED FACE! 
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 2022, 12:46 PM
goblins.gif
drone1400
Peasant He/Him 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 2022, 03:26 AM
goblins.gif
drone1400
Peasant He/Him 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 2022, 12:07 PM
goblins.gif
drone1400
Peasant He/Him 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 2022, 02:54 PM
goblins.gif
drone1400
Peasant He/Him 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 2022, 03:11 PM
death.gif
RangerLord
Peasant He/Him Hungary bloop
The nation above all 
Seems like the default Windows zip program can't unpack the file. 7-zip manages it flawlessly though.
July 24th 2022, 03:18 PM
goblins.gif
drone1400
Peasant He/Him 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 2022, 03:45 PM
peasantmp.gif
Skurn
Peasant He/Him Equatorial Guinea duck bloop
can't flim flam the glim glam 
oh no, more archiving stuff
August 7th 2022, 06:43 AM
goblins.gif
drone1400
Peasant He/Him 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 2022, 11:21 AM
goblins.gif
drone1400
Peasant He/Him 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 2022, 12:05 PM
goblins.gif
drone1400
Peasant He/Him 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
April 1st 2023, 11:01 AM
wizardb.gif
Bluedy
Peasant He/Him Romania bloop rumble
I like Frutti Fresh 
Any updates?
April 1st 2023, 11:52 AM
goblins.gif
drone1400
Peasant He/Him Romania
C# nerd 
Not really, feel free to make suggestions if you have any

Edit: Oh, actually, it seems there were some new bugfixes since I posted here.

Whelp, thanks to Bluedy I discovered an issue with the x86 release, where some 7zip library doesn't get included in the single file exe... Solved it by copying the required dll along with the exe in 0.6.1

Edit:

Ok, I've fixed another bug related to selecting dmod launch exe... Basically, if you had an exe defined in the config that didn't actually exist, you would either be unable to launch dmods or it would use another exe from the list than what you selected xD

I also added YeOldeDink to the auto-installers for windows, but you'll have to delete the old config\configInstallerList.json file to get it to show up.
April 1st 2023, 09:16 PM
peasantmp.gif
Skurn
Peasant He/Him Equatorial Guinea duck bloop
can't flim flam the glim glam 
i've got a suggestion. finish it.
April 3rd 2023, 09:55 AM
goblins.gif
drone1400
Peasant He/Him Romania
C# nerd 
Up to V0.6.4.0 now... Fixed some recently introduced bug on the V0.6.2 update, and added YeOldeDink V0.6 rev 2 to the auto-installer lists..
February 21st, 11:36 AM
peasantmb.gif
yeoldetoast
Peasant They/Them Australia
LOOK UPON MY DEFORMED FACE! 
Is the log supposed to show up by default in release builds?
February 22nd, 12:57 PM
goblins.gif
drone1400
Peasant He/Him Romania
C# nerd 
Erhm... Maybe? I don't quite remember my reasoning for leaving it on to be quite honest.

You can turn it off via the first checkbox in settings: "show app log window on startup"

That being said... I really should update it one of these days... I mean it works, but I need to update download urls for auto-installing YeOldeDink and WDED...

Also, at some point I remember wanting it to get it to work on the Steam Deck, but there were some issues with the GUI framework I'm using (Avalonia). If I remember correctly, for some reason pop-up type controls like combo-boxes/tooltips/etc don't render when the Steam Deck is in "Game" mode. They work in Desktop mode.. but then I remember YeOldeDink and FreeDink having issues with the Steam Deck's input if the Deck was in desktop mode. So I pretty much had to make an alternate GUI for when running it on the Deck.

Edit: Oh yeah, I should probably release it officially here on TDN too!... But I also have some unreleased WIP version of Win Dink Edit, the one with saving DMODs as json for making co-authoring DMODs and version controlling with git easier... Basically, I need to stop being lazy and getting distracted by other games (cough Palworld, cough I'm sure Skurn is to blame for getting me so addicted to that)
April 14th, 02:05 PM
goblins.gif
drone1400
Peasant He/Him Romania
C# nerd 
V0.7.0.1 is out... Biggest change is having separate Play/Edit buttons for DMODs and a dedicated menu for switching themes...
https://github.com/drone1400/martridge/releases/tag/V0.7.0.1

Swear I'll properly release it official here soon, after I make some proper documentation for it. Fr ong, no cap, as the zoomers would say.
April 16th, 12:18 PM
peasantmb.gif
yeoldetoast
Peasant They/Them Australia
LOOK UPON MY DEFORMED FACE! 
Very nice, will check out soon. I've been thinking it might be a good idea for me to look into the feasibility of bundling future Windows releases of Yeoldedink with Martridge as a proper replacement for DFarc3 if you'd be cool with that.
April 17th, 05:36 PM
goblins.gif
drone1400
Peasant He/Him Romania
C# nerd 
> I've been thinking it might be a good idea for me to look into the feasibility of bundling future Windows releases of Yeoldedink with Martridge as a proper replacement for DFarc3 if you'd be cool with that.

Sure, no probs, but there's at least one more bug I should fix over the weekend before you bundle anything

Btw, the Linux build *SHOULD* run fine too. It just doesn't have the whole "auto dink installer" stuff that the windows release has - mostly because i'm using some 7zip wrapper from nuget to extract files from NSIS installers xD

Hmm, actually, I'm not sure how it plays along with your appimage releases? I don't think I tested any of that at all...