isle icon indicating copy to clipboard operation
isle copied to clipboard

Add progress bar to README.md

Open AverseABFun opened this issue 1 year ago • 23 comments

Just change the number at the end of the URL to the percentage

Also I'm working on figuring out a way to get Lego island running with wine as I have no windows computer(although I have a license and might just use a VM)

AverseABFun avatar Jun 11 '23 01:06 AverseABFun

Ahh thanks for showing how to do this. Only thing is I don't yet have a total number of functions so I can't calculate a percentage, but that shouldn't take long to get. I also wonder if there's a way to automate this, like maybe have a script on my VPS that periodically counts the number of functions in the repo and calculates the percentage.

Also I'm working on figuring out a way to get Lego island running with wine as I have no windows computer(although I have a license and might just use a VM)

LEGO Island can be run in Wine. Just swap in the real D3DRM (this one has the highest compatibility), and then use Rebuilder to implement Pick()/GetPickRecords(), and it should all be playable.

itsmattkc avatar Jun 11 '23 18:06 itsmattkc

I also wonder if there's a way to automate this, like maybe have a script on my VPS that periodically counts the number of functions in the repo and calculates the percentage.

I was thinking about something similar: a percentage that would also factor in the accuracy of function implementations (measured by comparing the original with the decompilation assembly). That's probably quite a bit more work to implement but would be really cool to see imo.

foxtacles avatar Jun 11 '23 18:06 foxtacles

Yeah I'd love to have something like that. It would almost certainly take some time to set up, but there's probably stuff out there already that does the job that we can use. This for example seems to be automatically calculated: https://botw.link/progress

itsmattkc avatar Jun 11 '23 18:06 itsmattkc

Here's the script that's used for the progress; https://github.com/open-ead/nx-decomp-tools/blob/master/progress.py.

Per this commit:

Just like other decompilation projects, progress is tracked by looking at the percentage of decompiled bytes (the number of decompiled bytes divided by the total code size).

msxrx avatar Jun 11 '23 20:06 msxrx

Quite interesting to see there are entire platforms like https://decomp.me/ with the aim to facilitate collaboration on decompilation! That being said, the entire ecosystem seems to be mostly focused around console games, so the tools might be of limited utility in our case...

foxtacles avatar Jun 11 '23 20:06 foxtacles

Quite interesting to see there are entire platforms like https://decomp.me/ with the aim to facilitate collaboration on decompilation!

Oh yeah I've played around with that a little before, but yeah doesn't seem to be anything for x86 unfortunately, not even the OG Xbox.

Just like other decompilation projects, progress is tracked by looking at the percentage of decompiled bytes

Interesting, I guess that makes sense. How do they calculate how much is matching vs non-matching, is it still just by comparing bytes?

EDIT: I guess I could just look at the script and found out haha

itsmattkc avatar Jun 11 '23 20:06 itsmattkc

What compiler does this game use? (for the console you're decompiling it on, that is) Is it msvc targeting windows os? If someone is interested, we could try integrating it into the site, but I'd need more info before I can really say more.

Are you able to invoke it fully on the command line?

ethteck avatar Jun 12 '23 02:06 ethteck

Ahh thanks for showing how to do this. Only thing is I don't yet have a total number of functions so I can't calculate a percentage, but that shouldn't take long to get. I also wonder if there's a way to automate this, like maybe have a script on my VPS that periodically counts the number of functions in the repo and calculates the percentage.

Also I'm working on figuring out a way to get Lego island running with wine as I have no windows computer(although I have a license and might just use a VM)

LEGO Island can be run in Wine. Just swap in the real D3DRM (this one has the highest compatibility), and then use Rebuilder to implement Pick()/GetPickRecords(), and it should all be playable.

Thanks! I'll have to try this in the morning.

AverseABFun avatar Jun 12 '23 02:06 AverseABFun

What compiler does this game use? (for the console you're decompiling it on, that is) Is it msvc targeting windows os? If someone is interested, we could try integrating it into the site, but I'd need more info before I can really say more.

Are you able to invoke it fully on the command line?

There are command line instructions in the README. I use a portable version I made, and I can confirm it runs on Wine if it needs to run on a Linux server.

itsmattkc avatar Jun 12 '23 02:06 itsmattkc

Thanks for the prompt reply. I got an email that just said

Read the README

Sorry for not checking there first, but I'm on mobile and just saw a message on the decomp.me discord, asking me (as a maintainer) to weigh in on this thread. so I'd appreciate a little more tact if you want my help

That being said, given the contents of your edit, I think we can probably figure out how to integrate your compiler into the site if you're interested. I'll mention this in our discord

ethteck avatar Jun 12 '23 02:06 ethteck

Yes, I apologize. I was distracted and responded too quickly without thinking, I realized how it came across after sending (hence the edit). I very much appreciate you taking the time to look into this for us.

itsmattkc avatar Jun 12 '23 02:06 itsmattkc

Thanks :) I appreciate the apology. I'm gonna be pretty busy the next few days, but it sounds like a fun foray into adding msvc to the site!

ethteck avatar Jun 12 '23 03:06 ethteck

decomp.me (and console game decompilation in general) is targeted towards matching decompilation - a game's binary is disassembled into assembly (which assembles back to a byte-perfect match of the original) and then functions are replaced by their (e.g.) C equivalents in a Ship of Theseus manner.

If you are not aiming for matching decompilation then decomp.me (and associated tools like asm-differ) might not be hugely valuable.

What is your current workflow for "matching" functions (testing functional equivalence I guess). Can you replace functions 1-by-1? I know you're using Ghidra from your YT video, but beyond that...

mkst avatar Jun 12 '23 06:06 mkst

Ideally I am aiming for matching decompilation as much as possible. The reason I say it won't be "byte accurate" is because I feel it's very unlikely we'll be able to resolve the SmartHeap dependency (at least that we'll be able to track down the precise version statically linked into the game). I guess we could decompile it too, but it feels like a bit of a waste of time when it doesn't actually affect gameplay. Since it's ABI compatible with the standard malloc/free, all of the actual LEGO Island instructions can still be matched perfectly, but without SmartHeap, the final compiled executables will never be identical (won't have matching hashes, etc.)

But other than that, I'm all for matching, and generally consider a function "done" when its compiled output matches the original (essentially asm diffing but manually).

itsmattkc avatar Jun 12 '23 07:06 itsmattkc

~~I am not experienced with C++ or ASM in general, but is it not possible to copy the asm of the library into the build of the decompiled code?~~

~~Like, it being a build step or smth. Or is it that we can't do that bc the linker is not aware of it?~~

~~Just realized this would only work for win32 builds, if it even works that is.~~

ArjixWasTaken avatar Jun 12 '23 12:06 ArjixWasTaken

I am not experienced with C++ or ASM in general, but is it not possible to copy the asm of the library into the build of the decompiled code?

Like, it being a build step or smth. Or is it that we can't do that bc the linker is not aware of it?

Just realized this would only work for win32 builds, if it even works that is.

Actually, if the binaries produced are identical other than the fact of the missing library, a delta patch could fix this, no?

(Still only for win32 sadly)

ArjixWasTaken avatar Jun 12 '23 12:06 ArjixWasTaken

Ahh thanks for showing how to do this. Only thing is I don't yet have a total number of functions so I can't calculate a percentage, but that shouldn't take long to get. I also wonder if there's a way to automate this, like maybe have a script on my VPS that periodically counts the number of functions in the repo and calculates the percentage.

Also I'm working on figuring out a way to get Lego island running with wine as I have no windows computer(although I have a license and might just use a VM)

LEGO Island can be run in Wine. Just swap in the real D3DRM (this one has the highest compatibility), and then use Rebuilder to implement Pick()/GetPickRecords(), and it should all be playable.

H E L P Screenshot 2023-06-12 8 36 35 AM

AverseABFun avatar Jun 12 '23 13:06 AverseABFun

Here's the script that's used for the progress; https://github.com/open-ead/nx-decomp-tools/blob/master/progress.py.

Per this commit:

Just like other decompilation projects, progress is tracked by looking at the percentage of decompiled bytes (the number of decompiled bytes divided by the total code size).

This code is not fully available, They dont have config which is readed in a weird way I say but if we gett full size of Lego Island and try comparing it, I can create full website like this. I am trying to recreate and get the code to work.

edicik avatar Jun 12 '23 18:06 edicik

I did basic progress bar which is based on github's REST api and fetches latest DLL build, gets its size and compares to total size of dll. Started working on this but now I am half asleep so im gonna fix bugs later. Good night fellas.

Site: https://lego.remix.ovh/progress Repo: https://github.com/ItsRemix/lego-island-decomp-www

edicik avatar Jun 12 '23 20:06 edicik

Ahh thanks for showing how to do this. Only thing is I don't yet have a total number of functions so I can't calculate a percentage, but that shouldn't take long to get. I also wonder if there's a way to automate this, like maybe have a script on my VPS that periodically counts the number of functions in the repo and calculates the percentage.

PS: You can set a github action to run at an interval

Example workflow that runs every 15 minutes

Open source repositories have no restriction on how much the workflow runs. (Other than the hard limit of 6 hours per run)

PS2: Yes, you can even run discord bots using github actions, with the caveat that the bot would have to restart every 6 hours. PS3: Don't run a discord bot using github actions, as github doesn't like that, and might ban the repo.

ArjixWasTaken avatar Jun 13 '23 13:06 ArjixWasTaken

If you get any idea how to do that I could add it to the unofficial site

edicik avatar Jun 13 '23 15:06 edicik

The job only needs to run when a commit is pushed/merged to the main branch, you don't need to be continually running something, unless I'm missing something?

mkst avatar Jun 13 '23 15:06 mkst

The job only needs to run when a commit is pushed/merged to the main branch, you don't need to be continually running something, unless I'm missing something?

You aren't missing smth, but it is always nice to know of GitHub actions supporting cron jobs

ArjixWasTaken avatar Jun 13 '23 16:06 ArjixWasTaken