The Dink Network

Drone's WinDinkEditPlus Fork aka WDED

June 5th, 07:14 AM
Peasant He/Him Romania
C# nerd 
A while back, RW released the source code for WinDinkEditPlus over on gitlab:

I made a fork of it, and it is also on gitlab:

So far, I haven't uploaded a build of it to TDN as I think it requires more testing and such, but if you're curious and want to try it without building it yourself, here's the latest build I have over on Bluedy's discord:
V2.5.7.8 -

Since Bluedy is messing around with it these days and found another bug I just fixed up in this version, I figured I'd make a separate thread to document what I'm doing. Much easier to keep track of things this way than on discord

After more testing and making sure it doesn't somehow set your computer on fire or there are any more nasty bugs or something, I'll probably upload it as a proper file here on TDN too.

Here is a list of changes from RW's V2.5 that's on TDN.

--- V2.5.7.8
- fixed a really nasty crash due to the a sprite .FF file extraction function buffer being too small 
    this would have caused any long path name to potentially hard crash WDE without the stack walker even doing anything...

--- V2.5.7.7
- will now attempt to save DMOD data when WDE crashes, after making a backup of existing DMOD files in a ".wded\dmod.bakX" subfolder

--- V2.5.7.6
- added generic cut/copy/paste commands (CTRL+X/C/V) in multiple editor contexts
- a bunch of internal changes...
- updated help text
- minimap detail toggleable now

--- V2.5.7.5
- fixed crash when editing hardness for tile selected from a non-existing screen number

--- V2.5.7.4
- added B and Delete hotkeys to clear hardness editor, Tab to exit hardness editor without saving 

--- V2.5.7.3
- quick fix to tile selector pasting wrong tiles with 2x3 grid layout

--- V2.5.7.2
- changed toolbar to have all the functions from Tools menu (currently using placeholder button art)
- removed Tools command indicators from status bar
- added new tile info to status bar
- reverted tile selector selection rectangle sizes to what they were before

--- V2.5.7.1
- finished expanding tile selector tile sheets to 600x550 (there were some overlooked issues in V2.5.7.0)
- number of tile sheets rendered in tile selector is no longer hardcoded, can maybe make it user configurable in the future... 
- added hard-tile editing capabilities while in tile selector mode (to allow for customizing hard.dat more easily!)
- altered hard.dat saving/loading to support extended tile sheets
- hopefully didn't break anything in the process     

--- V2.5.7.0
- started upgrading hardness selector/editor process
- made hardness editor have 1:1 aspect ratio, centered
- added hide texture to hardness editor by pressing space bar
- made tile sheet tile selector have 1:1 aspect ratio, centered
- expanded tile sheet tile selector to full 600x550 px size

--- V2.5.6.3
- fixed hardness rendering error for sprites that are mouse-overed
- improved sprite info text overlay so it shouldn't be rendered offscreen now
- added yellow sprite bounding box when the sprite is too big and/or goes offscreen

--- V2.5.6.2
- Made help text and sprite info text overlays less annoying to look at      (by adding semi-transparent background rectangles)

--- V2.5.6.1
- Fixed UndoStack issue that would cause endless loop to pop the stack until WDE crashed

--- V2.5.6
- Added StackWalker for debugging crashes

--- V2.5.5
- Fixed bug related to screen script not being able to be changed since V2.5

--- Up to V2.5.4
I don't think I documented changes so far, but mostly it's something like this:
(Not necessarily in this order)
- Reorganized source code in folder
- Configured project so that I can build for Windows XP         
- Switched to newer SDL2 version, version 2.26.5
- Using SDL2 Image, version 2.6.3 to add PNG support to sprites
- SDL2 and SDL2 Image are dynamically linked now
- Implemented some basic logging system
- Rewrote some parts of the code related to accessing files:
	+ paths should be normalized and validated properly...
	+ i think V2.5 had some bug where creating a new DMOD could end up copying files to the root directory of a drive, this shouldn't be possible anymore...
	+ creating a DMOD in a child path of the DMOD Skeleton directory shouldn't be possible either now
- Added command line arguments:
	"-game" same as in DinkHD and FreeDink, can be used to specify what DMOD to open on launch
	"--refdir" same as in FreeDink, can be used to specify a specific core DINK installation to use
- Changed sprite properties GUI to be able to set deprecated / unused properties... (Some of them are useful for fancy DINKC scripting)
- Fixed sprite rendering bug when rescaling sprites (the size was incorrect by a pixel or so)
- Fixed sprite hardness rendering bug when rescaling sprites (hardness doesn't get resized in game, but was getting resized in the editor!)
- Probably some other things i'm forgetting...
June 5th, 09:23 AM
Count me interested.
June 8th, 11:32 AM
Peasant He/Him Romania
C# nerd 
Currently Bluedy's still experiencing some random crashing.. Gonna see about implementing the same callstack logging thing Seth used in DinkHD, that being this one:

That should be helpful with debugging these nasty random crashes...
June 8th, 01:11 PM
Peasant They/Them Australia
I've come to get my meat 
If you're not too attached to the existing logging system, you may want to have a look at spdlog as it has some Windows-specific debugging features as well as backtrace support.
June 8th, 02:59 PM
Peasant He/Him Romania
C# nerd 
I'll have a look.

The current "logging" system is just some utility functions I wrote up to write CStrings in a text file It's pretty rudimentary.

That being said, I already added StackWalker and it seems to work. Having Bluedy test it a bit these days before pushing it on gitlab...
June 8th, 03:43 PM
Peasant He/Him Romania
C# nerd 
Alright, uploaded V2.5.6.0 with StackWalker added!

Archive is bigger since it also needs to have the PDB debug file for the StackWalker to work nicely (as far as I can tell anyway).

Edit: Update also pushed on gitlab, on latest devtest branch.
June 27th, 06:57 AM
Peasant He/Him Romania
C# nerd 
Updated download link in first post to V2.5.7.5 - This version has some big changes to the hardness editor, making editing hardness easier.
Here's the link again for convenience:

There are quite a few big changes:
- the tile-sheet selector now supports the full extended tile-sheet size of 600x550 with 128 tiles!
- the tile-sheet selector now maintains the original aspect ratio and shows tile-sheets in a 2x3 grid instead of 2x2 now, since that works better for widescreens which are now the norm.
- the status bar now shows info about the current tile the mouse is hovering over, like tile id and alt hardness value.
- you can now see/edit hardness from the tile-sheet selector to edit the default hardness for a specific tile from a tile-sheet.

RobJ has been using it to make a new custom hard.dat file. So far he's found some bugs and I fixed them, this version should be pretty stable.

If we don't find any more bugs, I'll probably officially upload the build on TDN along with a snapshot of the current source code for convenience. (Although that's also available on gitlab of course)

NOTE: One thing I'm not entirely happy about / sure about, the tile-sheet selector, while it maintains the correct aspect ratio, it does scale with the current window size... This can cause some rendering issues when viewing hardness on a small window, where 1-pixel thick hardness won't be rendered in the tile selector.
It has crossed my mind to make the tile-sheet selector just be a continuous space with all the sheets that you can scroll through much like the map screens, and have the tiles be rendered at a 1:1 correct pixel zoom ratio.

August 13th, 10:19 AM
Peasant They/Them
This version of WinDinkEditPlus is horrible, it crashes for me all the time, when I hit esc it acually closed the program without asking if I wanted to and lost alot of progress!!

Can't for the life of me figure out when Im in the sprite library to go one step back and see all the sprites, currently it's on the trees. On the regular WinDinkEditPlus, I can just hit escape and go back to the sprite menu.

Also now it crashes everytime I try to go to the sprite menu to select a sprite.

HARD pass for me.
August 13th, 10:27 AM
Peasant He/Him Poland
Everyone should get a pizza for free in each week. 
Best to file a bug report and least provide a log before it crashed if it made one right into its Gitlab page in Issues. Provide as much details as possible.
August 13th, 02:56 PM
Peasant He/Him Romania
C# nerd 
Huh, that's quite intriguing. I don't think either RobJ or Bluedy ever had it crash in the sprite library. Hmm, wonder what's going on there.
August 15th, 03:42 PM
Peasant He/Him Romania
C# nerd 
Whelp, I have no idea why it would be crashing when returning from the Sprite Selector of all things...

As a temporary uh, improvement, I added a new version, V2.5.7.7 - When WDE crashes, it will attempt to make a backup of the old DMOD files then save over the existing files.

The backup is made in the DMOD directory in a subdirectory in the path ".wded\dmod.bakX" where X is an optional number that increases from 1 to forever(tm). In other words, when it crashes, it will keep making backups without deleting/overriding old backups. And to repeat, it should save the current DMOD data after making the backup...

I only tested this briefly but it seems to "work for me" (TM)...

Further testing/investigation is needed, as is clear from Josko's reply.

PS: Josko, if you could send me the crash log via private message or on gitlab or something it would be quite helpful.
August 15th, 08:08 PM
I attempted to make a test D-Mod with this. Never wrote scripts or made it past the first screen. Maybe I'll pick it up again. Though it's more likely that I'll play some more D-Mods and finally write at least one review. It's been a few months since I played any D-Mods.
August 16th, 01:13 PM
Peasant He/Him Romania
C# nerd 
With Josko's help, I think I managed to find the source of the issue...

It seems he has DinkHD and WDE/WDED inside a folder in AppData\Local, and for some reason, something weird happens and makes WDED crash when that's the case!

The really weird part is that it crashes so hard that the StackWalker doesn't work and nothing gets written to the log either...

I'll be investigating what exactly is the issue these days, but until then, anyone using this, DON'T have WDED or Dink in a subfolder of %AppData%
August 16th, 01:57 PM
Peasant He/Him Romania
C# nerd 
I *think* I found and fixed the issue...

A buffer used for a file path in Sequence.cpp was only 100 bytes long and was causing a nasty crash...

It seems it caused the editor to crash in such a way that the stack walker would not even go in effect...

Also, I tested it out and this bug affects RW's WDE V2.5 too that's up on TDN, so if anyone is using that, beware of long installation path names!

The weird thing is, I don't know how Josko managed to get too far in editing in the first place, as this would have caused a crash as soon as the editor tried to access a dir.ff file in a path longer than 100 characters xD

Edit: I removed the links from previous versions in the first post as they were all affected and thus are unsuitable for use.
August 17th, 12:08 PM
Peasant They/Them Australia
I've come to get my meat 
I gave it a test since I am also an appdata enjoyer, and a minor yet irritating issue I noticed is that if you leave it running in the background, your screensaver/monitor dimming will never activate. It needs this or this put somewhere in order to activate.
August 19th, 04:20 AM
Peasant He/Him Romania
C# nerd 
Oh, cheers! I had no idea about that... I haven't used those features in a decade haha.