UnderworldExporter
UnderworldExporter copied to clipboard
Is this project still being worked on? Is there anything that can be done to help/contribute?
Is this project still being worked on? Is there anything that can be done to help/contribute?
To add to this, what is being used to disassemble the original game in order to figure out how the mechanics work? For example, how did you (@hankmorgan) figure out how the damage enchantments add to the total damage?
Not abandoned no. Real world commitments be have prevented code developments but at lot of my project focus when I have found time has been on reverse engineering of the original code. Hopeing to revisiting the project overall to evaluate what needs to be done.
Re damage Yes. I know how enchantments affect damage along with most damage and to hit changes. Basically each tier of enchantment has base score (starting from 0). On hit this left shifted by 2 and 1 is then added. Eg minor = (0<<2)+1 = 1 Major = (3 << 2) + 1 = 13 These have been implemented in the released source code but not in any compiled build. https://github.com/hankmorgan/UnderworldExporter/blob/master/UnityScripts/scripts/Objects/WeaponMelee.cs
I'm so glad you haven't abandoned this. I'm really looking forward to further updates.
I actually had a look at several parts of your code before, and some stuff seems to be not trivial to achieve with in-game testing, like the damage calculations I mentioned. My question was actually on how you're reverse engineering the game. What tools, process, etc. I've looked a bit into this,and was directed to an old release of Ida, dosbox with debug mode, and cheatengine+dosbox. The consensus seemed to be that it's very hard to disassemble these old games.
I'm using the old release of IDA and the Dosbox debugger with some occasional Ghidra use. I have a good grip on the code at this point but it's slow work. The big breakthrough was finding the functions that write text to the screen. Once I had that I was able to hunt down a lot of stuff. Also mapping out the memory and finding where the player data is stored is useful as I can track usages of that data. Not all plain sailing as the code uses overlays which means sometimes the debugger will just get "lost" and I won't be able to step into some functions.
I'm going to release the IDA files tomorrow as-is.
So great to hear from you! I'm impressed! I had no idea how methodic this project was! I previously just assumed it was an ad-hoc and tacit attempt at reconstructing the game. You're really putting a lot of care in this!
Is there anything people can do to help you out on this project?
Wish you the best!
Oh it is ad-hoc at it's core. :)
I do think a change of approach is needed. My time is limited now for the next year due to education commitments. Rather than working towards a big binary release. I'm going to change towards publishing the unity scene files in a new repo to allow others more opportunity to work on those files and to chip away at it in small chunks myself.
https://github.com/hankmorgan/Underworld-Exporter-Scene
I'm so glad to see this project still alive! I actually spent some time this past weekend in IDA, Ghidra, and the DOSBox debugger looking at the UW1 exe, so imagine my surprise finding out you had uploaded your work in that exact area only a week ago! It's my first foray into reverse engineering and assembly so it's pretty daunting, but I was able to find and identify a couple of methods and breakpoint in them successfully. Do you have an end goal with the project? I'm very eager to revisit VR support in your Unity port if that's alright, and to help in some way or another :)
Good luck with the reverse engineering. I've been reverse engineering on and off for over a year now and still I'm finding new stuff. I did run the UW1 code through the same process but I've focused on UW2 as behaviours between the two games are pretty similar and there is more content in UW2 to decode still.
Some tips to help you out. 1 - Try and find the function that prints text to the screen. It appears everywhere in the code. You should find it stepping through code but if you can't find it you should look at the usage of the hard coded strings. This can point to a lot of things and tell you at a glance what a function is doing. 2 - Take a bit of time to understand the Dos X86 interupts (google has plenty of info) Looking at these will guide you to file read/writes and so on. 3 - The player character data is loaded as a bit block of data (same as the format of the save game). Once you find it you can again reference it's usage to find skill checks/stats and other useful info. This data is located is in the large data segment. in IDA. The other thing about the player character is that while the game is running it is treated as an game object like any other. You will see a lot of references to a game object that you won't see in game. This is actually the player object (the adventurer class)
Also you will see this pattern a lot in code. It took me a looong time to pick up on this. Looking at the UW2 disassembly will help
les bx, CurrObj_dseg_2256 ; point at the currently processed object. mov ax, es:[bx] ;Read the first byte of the object data and ax, 1FFh ; Extract the item_id
mov dx, es:[bx+2] ; read the 3 byte and dx, 0E000h ; Read the xpos of the object
Item Ids are used as lookups into data as well Continuing from object. Ax=Item_ID mov dx, 0Bh ; 0xB bytes in the common object data recorods imul dx ; Multiple the item ID mov bx, ax ;This gives you an array index mov al, CommonObjDat_6_dseg_6B7A[bx] ; Read the quality class from the common object data
The Unity Scene files are uploaded in one of the repositories. Feel free to clone it and see how you get on.