Decompiling Lunar 2 for PS1

This board is for general discussion of Lunar. Especially things such as Lunar merchandise, general discussions about the story that span more than one game, etc.
Post Reply
User avatar
Erroneous
Legendary Hero
Posts: 1207
jedwabna poszewka na poduszkę 70x80
Joined: Mon Jan 13, 2003 3:08 am
Location: Washington, USA
Contact:

Decompiling Lunar 2 for PS1

Post by Erroneous »

Been watching this new twitter thread of someone who is decompiling Lunar 2 Eternal Blue for the PS1.

https://twitter.com/ZackmonX/status/1502904361709707273

There's a GitHub repository in development now.

https://github.com/Zackmon/lunar2-psx-decomp
---
LunarNET Discord: https://discord.gg/yzXgsSa

User avatar
ShugoHanasaki
Black Dragon Wizard
Posts: 444
Joined: Fri Jul 07, 2017 4:53 am
Location: Lavender Falls
Contact:

Re: Decompiling Lunar 2 for PS1

Post by ShugoHanasaki »

Pardon my ignorance... What does de-compiling a game mean?
Lotus Moon Productions
- Podcasts on Independent Music Artists & Wrestling -

https://soundcloud.com/lotusmoonproductions

Mr_conan
Lann Fisherman
Posts: 20
Joined: Sat Mar 02, 2019 4:51 pm

Re: Decompiling Lunar 2 for PS1

Post by Mr_conan »

It means that they’re attempting to take the game binary and generate equivalent code in a high level language (C in this case).

User avatar
ShugoHanasaki
Black Dragon Wizard
Posts: 444
Joined: Fri Jul 07, 2017 4:53 am
Location: Lavender Falls
Contact:

Re: Decompiling Lunar 2 for PS1

Post by ShugoHanasaki »

Ah! Gotcha. Neat!
Lotus Moon Productions
- Podcasts on Independent Music Artists & Wrestling -

https://soundcloud.com/lotusmoonproductions

User avatar
MagicEmperor
Student of Vane
Posts: 86
Joined: Thu Nov 03, 2005 2:23 am
Location: Beyond this World
Contact:

Re: Decompiling Lunar 2 for PS1

Post by MagicEmperor »

So de-compiling it does what make the graphics better? game play ? please explain if you can.

User avatar
kazuya
Lyton Singer
Posts: 43
Joined: Sun Jul 21, 2019 4:52 pm

Re: Decompiling Lunar 2 for PS1

Post by kazuya »

makes it awesome and open source
Darkness beyond twilight
Crimson beyond blood that flows
Buried in the stream of time is where your power grows
I pledge myself to conquer all the foes who stand
before the mighty gift bestowed in my unworthy hand
Let the fools who stand before me be destroyed
by the power you and I possess...
DRAGON SLAVE!

User avatar
Sonic#
Pao Tribe Chieftain
Posts: 4678
Joined: Thu Dec 26, 2002 3:27 am
Location: Here, there, everywhere
Contact:

Re: Decompiling Lunar 2 for PS1

Post by Sonic# »

A layman's explanation - when someone is making a program, they usually use a higher-level coding language, tools made for programmers to use to build that program. They do that because the actual instructions machines use (commands that directly tell the CPU what to do) are so tedious to do manually; these tools automate more complex tasks in a more accessible way.

When programming in that coding language is finished, the program is then compiled back into the instructions machines actually use. In other words, a compiler takes the complex code and rewrites it as machine instructions that tell the CPU what to do. Games are released in these forms.

Decompiling a game is a difficult process. Compilers are only made to work one way, and there could be many ways to write valid higher-level code that executes the same machine instructions. Frequently a decompiler will generate goofy code that doesn't correspond to the original programming but would bring about the same result.

So decompiling efforts are reconstructions that try to figure out how the original game worked prior to compiling. That can provide lots of insights into how the game and its mechanics work and makes the game easily modifiable ("open source").
Sonic#

"Than seyde Merlion, "Whethir lyke ye bettir the swerde othir the scawberde?" "I lyke bettir the swerde," seyde Arthure. "Ye ar the more unwyse, for the scawberde ys worth ten of the swerde; for whyles ye have the scawberde uppon you, ye shall lose no blood, be ye never so sore wounded. Therefore kepe well the scawberde allweyes with you." --- Le Morte Darthur, Sir Thomas Malory

"Just as you touch the energy of every life form you meet, so, too, will will their energy strengthen you. Fail to live up to your potential, and you will never win. " --- The Old Man at the End of Time

User avatar
Kizyr
Keeper of Knowledge (probationary)
Posts: 8315
Joined: Wed Dec 25, 2002 7:36 am
Location: Marius Zone
Contact:

Re: Decompiling Lunar 2 for PS1

Post by Kizyr »

Another thing decompiling can do is make it a lot clearer things that were originally removed, hidden, or otherwise obscured in the game. Certain stat behavior, character/enemy behavior, items or spells, etc..

Which means we should finally be able to find the Dark Scimitar for real this time.
~Kizyr (they|them)
Image

User avatar
DevNall
Blue Dragon Ninja
Posts: 648
Joined: Wed Dec 31, 2003 7:33 am
Location: Unknown

Re: Decompiling Lunar 2 for PS1

Post by DevNall »

Kizyr wrote: Thu Jan 12, 2023 12:26 am Another thing decompiling can do is make it a lot clearer things that were originally removed, hidden, or otherwise obscured in the game. Certain stat behavior, character/enemy behavior, items or spells, etc..

Which means we should finally be able to find the Dark Scimitar for real this time.
Disassembling the MCD/SCD release would be a whole 'nother ballgame.

Mr_conan
Lann Fisherman
Posts: 20
Joined: Sat Mar 02, 2019 4:51 pm

Re: Decompiling Lunar 2 for PS1

Post by Mr_conan »

Kizyr wrote: Thu Jan 12, 2023 12:26 am Which means we should finally be able to find the Dark Scimitar for real this time.
I can tell you its Item #90 (0x5A)

I've located the file containing chest information on Saturn (of course it wont be found there though since thats a jp release), haven't tried to figure out the equivalent file on PSX yet. Its not present in any of the PSX dialog scripts.

User avatar
Kizyr
Keeper of Knowledge (probationary)
Posts: 8315
Joined: Wed Dec 25, 2002 7:36 am
Location: Marius Zone
Contact:

Re: Decompiling Lunar 2 for PS1

Post by Kizyr »

Mr_conan wrote: Mon Feb 06, 2023 4:50 pm
Kizyr wrote: Thu Jan 12, 2023 12:26 am Which means we should finally be able to find the Dark Scimitar for real this time.
I can tell you its Item #90 (0x5A)

I've located the file containing chest information on Saturn (of course it wont be found there though since thats a jp release), haven't tried to figure out the equivalent file on PSX yet. Its not present in any of the PSX dialog scripts.
I... I actually didn't expect it to be anywhere in the game data for the Saturn/PS1 versions. Color me surprised!

Any stat information on it? In Sega CD it was just an MP drain for critical hits and sometimes cast a spell that froze time... forcing you to reset the game.
~Kizyr (they|them)
Image

Mr_conan
Lann Fisherman
Posts: 20
Joined: Sat Mar 02, 2019 4:51 pm

Re: Decompiling Lunar 2 for PS1

Post by Mr_conan »

Ive only decoded the in-game item list on psx so far in order to import it into the saturn, since the order is identical. The saturn just has more empty slots. At some point i should try using the debugger to give it from a chest and see if it actually works. SSS had a bunch of test items that would crash the game, this could be a similar case, or it might just work

Mr_conan
Lann Fisherman
Posts: 20
Joined: Sat Mar 02, 2019 4:51 pm

Re: Decompiling Lunar 2 for PS1

Post by Mr_conan »

Played around with the debugger a bit and i have it in my inventory now. It doesnt seem to be equipable by Hiro. Not sure which character might be able to use it or if its disabled?

Image
Image
Last edited by Mr_conan on Thu Feb 16, 2023 3:24 pm, edited 2 times in total.

Mr_conan
Lann Fisherman
Posts: 20
Joined: Sat Mar 02, 2019 4:51 pm

Re: Decompiling Lunar 2 for PS1

Post by Mr_conan »

I went in and manually entered in the gameshark RAM modifications from the other thread and they work to equip and use the item.
Then i played around in RAM to see what was going on... It looks like the default stat parameters have the scimitar set up to be no different than an unarmed character. So yeah, big let-down.
The gameshark codes modify the stats value to be better. Changing several of them from 0x002C to 0x0FFF gives stats of 999.

Gameshark Codes:
Image

Gameshark with Equip Code Only:
Image

RAM Modified for max stat values:
Image

User avatar
Alunissage
Goddess
Posts: 7353
Joined: Thu Dec 26, 2002 10:31 am

Re: Decompiling Lunar 2 for PS1

Post by Alunissage »

So, the EBC demo had some joke stuff in it that wasn't accessible while playing the demo normally -- the pajamas were called Bernie's Pajamas after Bernie Stolar, for one -- that one of the WD messageboard members found with a GameShark and similar. I would guess that the Dark Scimitar was also put in as a joke, and maybe WD considered trying to make it an actual findable item in the full game before deciding to just have Bromide X (picture of Borgan holding the Dark Scimitar) instead.

It would probably be fun to poke around the demo data for other stuff like that. The pajamas are the only thing I remember besides there being a message left by a WD programmer that led to his departure from the company. Gah, this was a long time ago.

Mr_conan
Lann Fisherman
Posts: 20
Joined: Sat Mar 02, 2019 4:51 pm

Re: Decompiling Lunar 2 for PS1

Post by Mr_conan »

Well, the item text definitely has a lot of differences between the demo and the final version. Anyone who's curious can take a look at the attachment. I'll have to sift through the dialog text next. (Updated to fix an output bug).

Sadly, no Bernie’s Pajamas or Dark Scimitar. Maybe the PJ reference is in the dialog text, or maybe the Gameshark code was designed to modify the item name as a joke.
Attachments
L2EB_US+Demo_Common_Text_v2.zip
(18.35 KiB) Downloaded 199 times

Mr_conan
Lann Fisherman
Posts: 20
Joined: Sat Mar 02, 2019 4:51 pm

Re: Decompiling Lunar 2 for PS1

Post by Mr_conan »

And heres the demo script dump, enjoy. Appears to be a much earlier full version of the script with more cursing.
Attachments
demo_us_psx_scripts.7z
(544.31 KiB) Downloaded 209 times

Post Reply

Who is online

Users browsing this forum: No registered users and 14 guests