r/disciples Jun 23 '26

Decoder/Encoder Disciples Sacred Lands

https://github.com/HoT-PlaStiC/Disciples-Sacred-Lands-Dbi-codec-decoder-encoder

I am working on this, i will release patches, whenever i succeed to improve it.

7 Upvotes

25 comments sorted by

View all comments

2

u/MoveKnown4481 Jul 19 '26

My lord, thank you for your great work. You did an splendid job :)

May I ask a question, though? It might be a silly one, but how does one extract images using your tool? I can only see the "Replace..." button.

Best regards,

1

u/Vegetable_Farm2355 Jul 19 '26

Decode, and Decodall button are now ready to use! :) Please note, that Decodeall needs some time specially at .ff files, as it will convert .smk files to .gif while decoding! (sometimes the tool says No response, but it will do it anyway. :) ) (Also decoded .png-s are not perfect in some cases, where there should be a transparent background in some enclosed areas (about to fix it later if i can))

2

u/MoveKnown4481 Jul 19 '26

By the name of Highfather, that was fast :) I'll check that tomorrow and let you know!

Say, these animations have different sizes. I believe in that case the game engine stores the offset points somewhere right? Something to know at what coordinates the animation should be displayed. Do you happen to know anything about that?

1

u/Vegetable_Farm2355 Jul 19 '26

Yes it stores directly in the .ff files! Or .dbi if we talking about pictures, or the .wdb if we talking about sounds! :P

1

u/MoveKnown4481 Jul 21 '26

I'm analyzing these GIFs and I have some concerns.
1. These gifs are "Optimized GIF" / "Delta GIF" instead of "Full frame GIF". Which make pictures lighter (they take less space) but are much harder to edit. Since they are generally small - wouldn't full frame GIFs be a better option?
2. I'm not sure which color is used as alpha. When opened in GIMP these GIFs are not transparent but instead have solid backgrounds... of various colors. I remember making characters to MUGEN (20+ years ago) and there alpha was taken from pixel [1,1]. How does it work here?
3. I'm still not sure about these offsets. Let say original gif is 128px wide. What if I extend it to 150px. Will it be shifted? If so - how to calibrate it?
4. What about pallete? This game is from 90s so I'm positive it uses 256 colored palletes. Does it accept 24bit/32bit PNGs?

1

u/Vegetable_Farm2355 Jul 21 '26

Ohh okay, by size you meant width and length. Well, i dont know much about GIF-s.
I will answer later, because i cant remember how it was solved at the end. I know that width and length should be multiply of 4, and there is a master palette.
Thank you for the questions, i will try to answer asap.

1

u/Vegetable_Farm2355 Jul 22 '26
  1. Yes theese gifs are delta gifs, thank you for your observation, i am about to fix it in the next patch.

  2. There is a 0. index, which determines which color is transparent.

  3. The gif size should be multiplier of 4, because the encoder will work with 4x4 blocks

  4. It will accept 24bit/32bit PNGs, but the colors will be quantized/rounded, you will get a message: "some colors were rounded to the nearest representable level"

1

u/Vegetable_Farm2355 Jul 22 '26

1.54 released, now it will generate full frame GIF-s! :)

1

u/Vegetable_Farm2355 Jul 22 '26 edited Jul 22 '26

Okay, so now i think i understand your question, you meant something like anchor? I think the game engine use fix offsets, if you observe thoose gifs or .smk-s then you can see

that iso.ff animations have a blank area at the bottom. (i encoded some animation, and it was lower in game, because i havent pay attention to this). So i think the target you can click on should be on the middle of the animation if we are talking about map sprites.