News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: Monster Rancher 4 Seasonal Shrines - Feasible?  (Read 1370 times)

kingkj52

  • Newbie
  • *
  • Posts: 3
    • View Profile
Monster Rancher 4 Seasonal Shrines - Feasible?
« on: April 30, 2020, 08:53:13 am »
Hey, new to the community. I've been messing with the Seasonal Shrines for MR2 for a while, and thought it'd be great to bring a system like this over to the newest mainline series title, seeing as disc swapping for it can still be problematic (and we'll never get the new.. remaster? of MR1 that's out on the Switch in Japan right now).

For my background, I have a Bachelors in Computer Engineering and have taken a few courses in assembly, and I have used HxD in the past for some hobby projects, so the base concepts are at least not completely foreign to me.

I suppose my question would be, to all of you that are significantly more knowledgeable than me, how feasible is the task?
If its practical or doable, any advice on getting started?

I've grabbed ps2dis, and also saw the one merged with pcsx2, so I grabbed that as well. HxD is raring to go, and I've extracted the iso already. I'm not particularly accustomed to irx or pss files, but I assume there is a method to their madness.

I thought about digging into the seasonal shrines patch for mr2 and seeing how it was done there, and then hope that sheds some light on the general process.

Currently, the hard part is actually finding where in all the files is the section dealing with reading from a disc and generating a monster. As a second (or third?) question at this point, any tips on nailing down the specifics?

Thanks for all the help, and if this task seems to be too much for me, I am debating putting up a small bounty (eg. $$$) to get it done, seeing as its practically impossible to effectively play these nowadays.

Jorpho

  • Hero Member
  • *****
  • Posts: 4626
  • The cat screams with the voice of a man.
    • View Profile
Re: Monster Rancher 4 Seasonal Shrines - Feasible?
« Reply #1 on: April 30, 2020, 12:43:19 pm »
It might help to link to the the patch you're referring to so people have some idea what you are talking about.
https://www.romhacking.net/hacks/3482/
This signature is an illusion and is a trap devised by Satan. Go ahead dauntlessly! Make rapid progres!

kingkj52

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Monster Rancher 4 Seasonal Shrines - Feasible?
« Reply #2 on: April 30, 2020, 10:59:36 pm »
Ah, my bad. Yeah, that's the reference. I've thought about maybe using a tool to dig into memory locations while the game is running, which is an easy task normally, but due to it being emulated, I'm assuming its not so simple here.

Jorpho

  • Hero Member
  • *****
  • Posts: 4626
  • The cat screams with the voice of a man.
    • View Profile
Re: Monster Rancher 4 Seasonal Shrines - Feasible?
« Reply #3 on: May 01, 2020, 05:47:20 pm »
I've thought about maybe using a tool to dig into memory locations while the game is running, which is an easy task normally, but due to it being emulated, I'm assuming its not so simple here.
That would depend on whether anyone's made a PS2 emulator with debugging capabilities.

Have you found this?
https://www.romhacking.net/utilities/617/
This signature is an illusion and is a trap devised by Satan. Go ahead dauntlessly! Make rapid progres!

gamingcat02261991

  • Jr. Member
  • **
  • Posts: 29
    • View Profile
Re: Monster Rancher 4 Seasonal Shrines - Feasible?
« Reply #4 on: May 05, 2020, 09:32:07 pm »
kingkj52, you may not be like STARWIN, the original creator of the MR2 Seasonal Shrine, but I have total confidence in your possible MR4 endeavor. I, myself, have always wondered what an MR1 Seasonal Shrine would've been like, had STARWIN stuck around long enough to make one.

kingkj52

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Monster Rancher 4 Seasonal Shrines - Feasible?
« Reply #5 on: May 09, 2020, 10:44:47 am »
Haha, thanks! Yeah, I'm still looking into it in my free time, getting a feel for everything and theorizing the code I'd need to implement to get it in there. I am (luckily) still working remotely these days so I'm still quite busy, but no worries, this is still being worked on! If you happen to know anyone with more experience than myself I could reach out to when I get stuck, let me know!

STARWIN

  • Sr. Member
  • ****
  • Posts: 452
    • View Profile
Re: Monster Rancher 4 Seasonal Shrines - Feasible?
« Reply #6 on: May 10, 2020, 01:08:01 pm »
MR2 asks the cdrom controller track lengths or some such, and gets 6 bytes worth of data. It uses some of that to generate the monster (race, subrace, stats, rarely a unique monster from a separate table).

I pick 32 bits from the early part of the player name (trying to pick bits that would change often, based on how the letters are encoded there), add current week to the number and put it through a 32bit->32bit hash function for which the result changes a lot if the input varies even 1 bit ("avalanche effect"). Then I try to generate the monster in some fair way, considering that the original numbers used were seconds (00-59), minutes (00-59), hours (00-83ish) or some such. Can't remember the details.

I probably translated this (https://stackoverflow.com/questions/664014/what-integer-hash-function-are-good-that-accepts-an-integer-hash-key/12996028#12996028) hash function into asm.

---

Using a debugger (aka using breakpoints on interesting data and interpreting the asm that operates on it) and making notes of where related data/code are should be most of the work. You'll need to figure out how to modify the image (hopefully there's no compression or such, and you can just search for the code (as data) sequence from within the extracted files (or however these things work with PS2; I haven't yet done any PS2 hacking)) and when writing new asm you'll need to figure out where to put it (easiest if you can overwrite something useless, like the existing code that deals with the shrine monster generation in such a way that you'll use less bytes than it used).

One way to start would be to decide what data to use as the source (player name and some date-like? haven't played MR4) and figure out where in RAM they are during runtime (eg if the debugger allows editing RAM content, try changing the date).

The monster generation is related to the to-be-generated monster, so I would probably try to trace the origin of those values backwards. There's the disc controller stuff too, so it's good if you could recognize when the game talks to it.

gamingcat02261991

  • Jr. Member
  • **
  • Posts: 29
    • View Profile
Re: Monster Rancher 4 Seasonal Shrines - Feasible?
« Reply #7 on: May 10, 2020, 04:15:20 pm »
Hey, STARWIN, do you think you can make a Seasonal Shrine for MR1 one day? Just curious.