The Dink Network

Drone's WinDinkEditPlus Fork aka WDED

June 5th 2023, 07:14 AM
goblins.gif
drone1400
Peasant He/Him Romania
C# nerd 
A while back, RW released the source code for WinDinkEditPlus over on gitlab: https://gitlab.com/rudolfwg/wdep2

I made a fork of it, and it is also on gitlab: https://gitlab.com/drone1400/wdep2

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 - https://cdn.discordapp.com/attachments/959479388938829824/1141427793423519764/WDED_V2.5.7.8.zip

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 2023, 09:23 AM
farmer.gif
Count me interested.
June 8th 2023, 11:32 AM
goblins.gif
drone1400
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: https://github.com/JochenKalmbach/StackWalker

That should be helpful with debugging these nasty random crashes...
June 8th 2023, 01:11 PM
peasantmb.gif
yeoldetoast
Peasant They/Them Australia
LOOK UPON MY DEFORMED FACE! 
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 2023, 02:59 PM
goblins.gif
drone1400
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 2023, 03:43 PM
goblins.gif
drone1400
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 2023, 06:57 AM
goblins.gif
drone1400
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: https://cdn.discordapp.com/attachments/959479388938829824/1123201902788751470/WDED_V2.5.7.5.zip

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 2023, 10:19 AM
duckdie.gif
Josko
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 2023, 10:27 AM
pq_cthunik.gif
GOKUSSJ6
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 2023, 02:56 PM
goblins.gif
drone1400
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 2023, 03:42 PM
goblins.gif
drone1400
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 2023, 08:08 PM
death.gif
RangerLord
Peasant He/Him Hungary bloop
The nation above all 
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 2023, 01:13 PM
goblins.gif
drone1400
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 2023, 01:57 PM
goblins.gif
drone1400
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... https://gitlab.com/drone1400/wdep2/-/commit/90e450348baf847b623eb044c8e9c1961491bb0c

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 2023, 12:08 PM
peasantmb.gif
yeoldetoast
Peasant They/Them Australia
LOOK UPON MY DEFORMED FACE! 
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 2023, 04:20 AM
goblins.gif
drone1400
Peasant He/Him Romania
C# nerd 
Oh, cheers! I had no idea about that... I haven't used those features in a decade haha.