wheybags / freeablo

[ARCHIVED] Modern reimplementation of the Diablo 1 game engine
GNU General Public License v3.0
2.16k stars 194 forks source link

CEL decoding #213

Open wheybags opened 8 years ago

wheybags commented 8 years ago

Current status

439/1402 files succeeded, 31.3124%
21393/110110 frames succeeded, 19.4288%

Original post

see #212, we now have tests that compare our output from cel decoding to that of https://github.com/mewrnd/blizzconv, which we are taking as a gold standard (which is probably true most of the time, but there may be some bugs there too)

our current numbers are pretty shit:

57/1402 files succeeded, 4.06562%
1143/110110 frames succeeded, 1.03805%

One thing to bear in mind is that most of our incorrect decodes are almost correct, which is why things look mostly fine in-game. To run the tests yourself, run the test_cel executable. In this issue I'd like to keep track of improvements to these numbers, and close it when both of those percentages read 100.

Anyone who's feeling motivated can feel free to have a go at this (you don't have to get the numbers to 100, just bigger than they are now :p)

wheybags commented 8 years ago

The way the numbers are calculated is that we decode the image and then md5 hash the resulting data, and compare it against precomputed hashes from blizzconv. This way, you don't need blizzconv to run the tests.

konopka90 commented 8 years ago

I've just started implementation. My leg is broken so I expect fast results :v:

mewmew commented 8 years ago

I've just started implementation. My leg is broken so I expect fast results :v:

Oh, how did you manage to break your leg? I hope you'll have a quick recovery, and wish you happy coding. I'd love to see some Diablo artwork on your plaster cast later : )

konopka90 commented 8 years ago

Oh, I wrote about broken leg but I just twisted my ankle so hard, can't explain this mistake :D Anyway, I stay home three weeks. I'm not going to play basketball again -.- Regarding CEL decoding and translating from Go to C++ @mewmew blizzconv project it is almost completed, I can't solve some minor problems but PR will be soon ;)

konopka90 commented 8 years ago

Thank you for your concern , didn't expect it ;p

wheybags commented 8 years ago

upped to

439/1402 files succeeded, 31.3124%
21393/110110 frames succeeded, 19.4288%

by #232

konopka90 commented 8 years ago

Regarding #232 and bug no. 1): I went back to commit 4372702bda72c469b26efb2e7c5951340a40c4e0 and made manual check between output from blizzconv and my implementation - I found two stupid bugs that I fixed and frames of type 2,3,4,5 now have the same hash. Cel test says that for file levels\towndata\town.cel it is 100% pass! but look at the freeablo screenshot: bugs There are so many bugs over the whole map. Unfortunately, blizzconv is not good reference at all :<

Working code you can find here https://github.com/konopka90/freeablo/tree/cel_experiment

mewmew commented 8 years ago

Unfortunately, blizzconv is not good reference at all :<

At least for Tristram, blizzconv may be used to produce a correct rendering (to the best of my knowledge) of the map. Following step 10 in the readme of https://github.com/mewrnd/blizzconv (i.e. using dun_dump), the following image was created. Note, I have not taken a closer look at how Freeablo renders the tiles on the map, so I don't know how they compare.

Tristram

A rewrite of blizzconv is slowly being developed at https://github.com/sanctuary/formats (name inspired by @doggan's diablo-file-formats repo), which takes a different and more robust approach to decoding level CEL frames. Basically, MIN files contain all the information required for generating a mapping of the CEL decoding routines used for each frame of the level CEL files.

The aim of the formats project is to provide reference decoders which should be verifiably correct to the extent possible. Any derived information (such as image dimensions) will therefore include references to the relevant information in the original diablo.exe binary.

I hope this may be helpful in troubleshooting what causes the rendering error.

Cheers /u

wheybags commented 5 years ago

IIRC those are actually empty/invalid + not used by the base game anyway.

On Fri, Mar 15, 2019, at 3:08 AM, Grant Ramsay wrote:

These 3 Cel files currently cause a crash when decoding:

"monsters/fireman/firema.cl2" "monsters/unrav/unravw.cel" "monsters/darkmage/dmagew.cl2" Click any of them in the celview executable to see issue

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/wheybags/freeablo/issues/213#issuecomment-473132239, or mute the thread https://github.com/notifications/unsubscribe-auth/ABCummUjOmNP7UNdY1cAFxbS-NWs9Pg5ks5vWwCBgaJpZM4H5d6l.