øAslickproductions.org/forum/index.php?PHPSESSID=f8use1kl939e8atl5nbvvln3j5&topic=2306.msg26505e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/indexcae3-2.htmlslickproductions.org/forum/index.php?topic=2306.15e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/indexcae3-2.html.zx¦°h^ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÈ0PdeCOKtext/htmlISO-8859-1gzip(¾ÖeCÿÿÿÿÿÿÿÿWed, 11 Mar 2020 09:50:54 GMT0ó°° ®0®P®€§²ð®¤°h^ÿÿÿÿÿÿÿÿ‹4eC FF4 Roguelikeifyer (underground/moon transition working)

Author Topic: FF4 Roguelikeifyer (underground/moon transition working)  (Read 9079 times)

Pinkpuff

  • Flan Princess
  • *
  • Posts: 924
  • Find a Megalixir in Unprecedented Crisis!
    • View Profile
Re: FF4 Roguelikeifyer (basic map randomization working)
« Reply #15 on: November 05, 2016, 07:45:19 AM »
UPDATE

http://www.timecave.net/ff4roguelikeifyer/ff4roguelikeifyer.zip

It now puts contents in the treasures and it now makes two maps, one replacing Baron Town and the other replacing Mist. There should be two ways out of the "Baron" one: one that takes you to the overworld, and one that puts you at the entrance of the Mist map. The Mist map should also have two ways out: back the way you came, and an exit that takes you to (0, 0) in a probably messed up Kaipo.

I replaced the inner stone tiles with ladder tiles so that you can see where the walls "should" go while not getting stuck if you don't change the overworld trigger warping you to Baron Town.

The treasure contents are (for now) just completely random; no weighting, no tables, just roll a 256 sided die and that's what you get.

Since it's now (over)writing triggers, and not paying any attention to what comes afterwards, FF4kster compatibility will almost certainly break after running this version.

Wow, I just started investigating a project like this, and I found this thread while searching for docs. I was thinking of doing a FF4 Ancient Cave mod for the 25th anniversary of the US release. I don't want to step on anyone's toes though and y'all are better equipped to make this than I am. I'd be happy to contribute what I can though, based on my experience making the FF6 Ancient Cave mod. If you open-source it on github.com I'll submit patches and stuff.

Thanks! Any input/help/ideas/advice/tips would be very much appreciated!

My source code is a tangly mess atm but maybe once I reorganize it or if I need any help specific to coding.

What would you prefer - a patch that replaces the existing Salve, or a commented disassembly of all the custom code (which would afford you the freedom to put it wherever you want in ROM)?

I think my preference right now would be a patch if it's all the same. Thanks again!
Let's dance!

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: FF4 Roguelikeifyer (basic map randomization working)
« Reply #16 on: November 05, 2016, 11:22:17 AM »
I don't have much time to play around with this before work, but I'll test it out... Indeed, the map randomization actually turned out pretty well, at least for a proof of concept, treasure was absolutely random, are there also a random amount of treasure in each map, or does each map have a set number of chests currently?

Also Abyysonym it's great to see you here! I vastly enjoyed your FFVI Randomizer and FFT Chaos and I'm sure with your wealth of experience you would be able to assist in this project to a great extent. FFIV's info. is a little more... spread, but I feel it should still be possible to make a robust Randomizer.

Pinkpuff

  • Flan Princess
  • *
  • Posts: 924
  • Find a Megalixir in Unprecedented Crisis!
    • View Profile
Re: FF4 Roguelikeifyer (basic map randomization working)
« Reply #17 on: November 05, 2016, 11:28:21 AM »
It attempts 20 times to drop a chest in a random spot. Before it actually puts it there, though, it first "looks around" at the adjacent tiles and makes sure it isn't about to be put in a place that could potentially block off a path. If it's all clear, it gets put there; if not, it moves on to the next. So in theory there could be up to 20 treasures on a given floor, or as few as 0. More likely, it'll be somewhere in between. The 20 can easily be tweaked as the dungeon generating algorithm evolves.
Let's dance!

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: FF4 Roguelikeifyer (basic map randomization working)
« Reply #18 on: November 05, 2016, 11:34:11 AM »
Indeed, while that is neat that it won't always add a chest aren't we stuck with 255 Chests Overworld/255 Chests Underworld/Moon? Or do you have a plan on dealing with that as well?

Pinkpuff

  • Flan Princess
  • *
  • Posts: 924
  • Find a Megalixir in Unprecedented Crisis!
    • View Profile
Re: FF4 Roguelikeifyer (basic map randomization working)
« Reply #19 on: November 05, 2016, 11:37:25 AM »
Yeah, each time it drops a chest it will remove one from the number of chests left in the world (overworld or underworld). 20 is probably too many in the long run and will likely be scaled back so that you don't have a whole bunch of treasure up front, then a dry spell until you reach the underworld.
Let's dance!

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: FF4 Roguelikeifyer (basic map randomization working)
« Reply #20 on: November 05, 2016, 12:26:46 PM »
Ah, planning ahead already, good foresight, yes 20 will probably be Way too much for a max per room. I'll post more on my what else you have said when I get home from work.

Also Chillyfeez when you do post the patch for Salve in a menu (I would Love to know how you accomplished that, by the way) let me know what room it takes up so none of our hacks for this step on one another.

Swordmaster

  • Octomammoth
  • *
  • Posts: 23
  • Gender: Male
  • Wit and courage have served thee well.
    • View Profile
Re: FF4 Roguelikeifyer (basic map randomization working)
« Reply #21 on: November 05, 2016, 05:25:43 PM »
Pinkpuff, what you did to Edward in UC was genius.  I'm all for Edward learning bard songs by level.  But as for all the item stuff, it seems like it would be more interesting to have Cid be the "chemist".  He's so... plain in vanilla.  Even in UC he was a bit plain.  It doesn't seem easy to fix Cid.  Though I think Cid should be able to use whatever weapon will have "avenger sword" status, due to him being the closest character to a "berserker".  Cid:  the berserker chemist machinist?  lol.  Just some thoughts.

Oh, and one more thing.  How viable would it be to make a "mime"?  Maybe replacing FuSoYa?

abyssonym

  • Wing Raptor
  • *
  • Posts: 5
    • View Profile
    • Abyssonym's Randomizer Emporium
Re: FF4 Roguelikeifyer (basic map randomization working)
« Reply #22 on: November 05, 2016, 05:41:37 PM »
There's two features I'd personally like to see.

1. More complex room generation, to create natural looking floors. You could build a floor using cellular automata + a markov chain created from existing game maps. I used this technique to create a world map generator for FF6; see the attached images. I wasn't planning to do this for FF4, but I was going to use the existing game maps (like in FF6 AC) which I like better than simple maze generation.

2. Branching paths and exploration, and reasons to go exploring. In FF6 AC I hid "rest stops" throughout the dungeon, where the player could shop, sleep at an inn, save, and pick up new espers or party members. Exploration is the aspect that most appeals to me about procedurally generated games... I'm not so much a hack 'n slash guy. It's also the reason I'd like to see more natural-looking floors, because I feel like having easily recognizable landmarks adds a lot to the experience... maybe even more so if they're maps from the game.

If you decide to keep this project as a linear dungeon crawl (it's fine if you want to), then I might go ahead and make my original idea.

Also I'd like to see the characters stay more on the vanilla side of things, or at least leave it as an option. Finishing the game with Dark Knight Cecil dragging your party down is its own kind of challenge.
« Last Edit: November 05, 2016, 06:04:49 PM by abyssonym »

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: FF4 Roguelikeifyer (basic map randomization working)
« Reply #23 on: November 05, 2016, 09:56:21 PM »
Also Chillyfeez when you do post the patch for Salve in a menu (I would Love to know how you accomplished that, by the way) let me know what room it takes up so none of our hacks for this step on one another.

The "how" is explained here, in a conversation I was having with... evil Grimoire LD, I guess  :wink:

Anyway, the affected data in this patch is as follows (all offsets are ROM w/o header)...
Used Empty Space:
11AB7-11ABB ($5 bytes)
11AC3-11AC7 ($5 bytes)
A0D80-A0DBD ($3E bytes)

Altered Assembly:
13606-13608 ($3 bytes)
139BA-139BC ($3 bytes)
1A6AD-1A6AE ($2 bytes)
1CA6C-1CA6E ($3 bytes)
1E2E4-1E323 ($40 bytes)
1E331-1E332 ($2 bytes)
1E33C-1E33D ($2 bytes)

And there you have it.
Just FYI - my intention in making this patch was that the strength of the Salved item would be 4x normal strength, then divided by the number of party members. it seems like, in practice, it actually ends up being slightly less than that. I tried it with a four-member party, and a character using Item seemed to get better results on a single target than the Salve-er gets on each individual target. Not significantly, mind you (~10 HP difference for cure1, <100 HP difference for cure2 and 100-200 HP difference for cure3), but I just thought it was worth mentioning. Of course, it might be that I just kept getting really unlucky in my tests.
 :hmm:

So, here's the patch.

 :edit: Sweet - I'm Golbez now

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: FF4 Roguelikeifyer (basic map randomization working)
« Reply #24 on: November 06, 2016, 12:42:20 AM »
There's two features I'd personally like to see.

1. More complex room generation, to create natural looking floors. You could build a floor using cellular automata + a markov chain created from existing game maps. I used this technique to create a world map generator for FF6; see the attached images. I wasn't planning to do this for FF4, but I was going to use the existing game maps (like in FF6 AC) which I like better than simple maze generation.

2. Branching paths and exploration, and reasons to go exploring. In FF6 AC I hid "rest stops" throughout the dungeon, where the player could shop, sleep at an inn, save, and pick up new espers or party members. Exploration is the aspect that most appeals to me about procedurally generated games... I'm not so much a hack 'n slash guy. It's also the reason I'd like to see more natural-looking floors, because I feel like having easily recognizable landmarks adds a lot to the experience... maybe even more so if they're maps from the game.

If you decide to keep this project as a linear dungeon crawl (it's fine if you want to), then I might go ahead and make my original idea.

Also I'd like to see the characters stay more on the vanilla side of things, or at least leave it as an option. Finishing the game with Dark Knight Cecil dragging your party down is its own kind of challenge.

Your brand of randomization is normally taking Everything that can be randomized and having that option there. For instance Dark Knight Palom might have White/Kick/Regen for his special commands, being able to equip Whips, Hammers, and Harps. This looks to more so be about setting up a normal...ish game as far as setup goes with an Ancient Cave-esque feel, I think the room generation is so simple currently just as a proof of concept, rather than meant to represent the final project. Therefore your goals are already quite different (if I'm getting your MO right, I may be mischaracterizing it) and you should progress with your project (also that FFVI randomized world map idea is awesome, I would love to see that added to Beyond Chaos at some point). However I think what you find and the way you go about randomization may still be of worth to PinkPuff so I strongly suggest the sharing of info. between you two.

Quote from: PinkPuff
Can we hijack a spell routine to do some kind of damage formula based on Level? Level, magic stats, some math = dmg?

Oh yes, that won't be that difficult. I've noted used and unused routines before. I suggest using either Dispel's routine (useless piece of broken garbage... Black Hole does it right), Damage, Status (Unused?), or Rydia Returns. Since Rydia will not be returning so that is not necessary.

Quote
Chakra was %CurHP, but there is a routine for healing based on caster's max hp. I think it's 1/10 by default but was there ever a patch made to make that amount variable by spell power?

I thought I made a spell power variant of that...? Hmm, maybe Chillyfeez did? In any case, it's very simple, may not even need any extra bytes for it.

Quote
"Scarmiglione: Was it Tremor? I will show you how!" LOL

Reducing the shurikens attack power should probably do the trick. We can play it by ear and tweak as we go. The Ninjutsu moves... I'm not sure... I almost feel like they can either be cut completely or at least be a set of unique utility effects, more along the lines of Pin/Smoke/Image than Flame/Flood/Blitz; especially since anyone can just toss out attack items.

Heh, yeah... You bring up a good point, it does make Edge seem redundant, focusing on more of the unique utility seems like a good idea (though Smoke, just like Exit doesn't serve much purpose other than not losing money when running away).
Also Chillyfeez when you do post the patch for Salve in a menu (I would Love to know how you accomplished that, by the way) let me know what room it takes up so none of our hacks for this step on one another.

The "how" is explained here, in a conversation I was having with... evil Grimoire LD, I guess  :wink:

Anyway, the affected data in this patch is as follows (all offsets are ROM w/o header)...
Used Empty Space:
11AB7-11ABB ($5 bytes)
11AC3-11AC7 ($5 bytes)
A0D80-A0DBD ($3E bytes)

Altered Assembly:
13606-13608 ($3 bytes)
139BA-139BC ($3 bytes)
1A6AD-1A6AE ($2 bytes)
1CA6C-1CA6E ($3 bytes)
1E2E4-1E323 ($40 bytes)
1E331-1E332 ($2 bytes)
1E33C-1E33D ($2 bytes)

And there you have it.
Just FYI - my intention in making this patch was that the strength of the Salved item would be 4x normal strength, then divided by the number of party members. it seems like, in practice, it actually ends up being slightly less than that. I tried it with a four-member party, and a character using Item seemed to get better results on a single target than the Salve-er gets on each individual target. Not significantly, mind you (~10 HP difference for cure1, <100 HP difference for cure2 and 100-200 HP difference for cure3), but I just thought it was worth mentioning. Of course, it might be that I just kept getting really unlucky in my tests.
 :hmm:

So, here's the patch.

 :edit: Sweet - I'm Golbez now

Hehe, I forgot all about that, how time flies... I should have been more exact Chillyfeez, since I'm a bit out of practice, what LoRom Banks are those occupying? That's what I probably should have asked in the first place.




chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: FF4 Roguelikeifyer (basic map randomization working)
« Reply #25 on: November 06, 2016, 01:42:37 AM »
Sure, in LoROM that's...

Used free space:
29AB7-29ABB
29AC3-29AC7
148D80-148DBD

Altered assembly:
2B606-2B608
2B9BA-2B9BC
3A6AD-3A6AE
3CA6C-3CA6E
3E2E4-3E323
3E331-3E332
3E33C-3E33D

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: FF4 Roguelikeifyer (basic map randomization working)
« Reply #26 on: November 06, 2016, 10:15:53 AM »
Thanks Chillyfeez, that reaches into a lot of sections, hehe, I guess that's only to be expected.

In any case setting up Recover 1/10 Max and 3/10 Current is as easy as I originally assumed. (Because of this I swear someone had to tackle this before.)

Yes, it is simple, with one caveat (which doesn't change anything really)

$03/DD5A   A2 0A 00   LDX #$000A   A:0000   X:004E   Y:0000   P:envMxdiZc - Load 0A into X. (/10. How much % of HP to heal.
$03/DD6E   A2 03 00   LDX #$0003   A:0000   X:0001   Y:0000   P:envMxdiZc - Load 03 into X (/3. How much % of HP to heal.)

Changing these both to AE 9D 28 will have it looking at Spell Power, BUT! It's looking at it in a two byte manner so the Accuracy stat is being added to that value at as well, however Accuracy does nothing for these abilities as they aren't normal damage or healing so they cannot miss. If you change both of their accuracies to 0 you will get your desired outcome. Well, I'm off to work, but I should be able to get a proper Twincasting arrangement setup... maybe when I get home.

abyssonym

  • Wing Raptor
  • *
  • Posts: 5
    • View Profile
    • Abyssonym's Randomizer Emporium
Re: FF4 Roguelikeifyer (basic map randomization working)
« Reply #27 on: November 06, 2016, 10:16:19 AM »
Your brand of randomization is normally taking Everything that can be randomized and having that option there. For instance Dark Knight Palom might have White/Kick/Regen for his special commands, being able to equip Whips, Hammers, and Harps.
Oh, I'm not trying to get Pinkpuff to make a randomizer. I just see a lot of talk in the thread about custom characters with new skillsets, and I'd like to be able to play the mod with a normal Edward if I wanted to. I do agree that there should be some way for Rydia to obtain her summons, for example.

As far as an FF4 randomizer goes though, there's already one in development by fcoughlin (though it has been on hiatus for a long time).

Quote
I think the room generation is so simple currently just as a proof of concept, rather than meant to represent the final project. Therefore your goals are already quite different
The only real sticking point for me is the linearity. A non-linear dungeon with backtracking is the project I'd like to see made, and there's no reason for me to make it if Pinkpuff already is.

Quote
However I think what you find and the way you go about randomization may still be of worth to PinkPuff so I strongly suggest the sharing of info. between you two.
Of course, although I haven't worked on FF4 for very long, so I can't contribute that much.
« Last Edit: November 06, 2016, 10:26:31 AM by abyssonym »

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,684
    • View Profile
Re: FF4 Roguelikeifyer (basic map randomization working)
« Reply #28 on: November 06, 2016, 10:34:34 AM »
That's a good point and there likely can be an option for "Vanilla" (Would you like to have the cast set as they normally are?) versus "Custom" (Attempts have been made to balance the cast and give each one their own niche to participate more effectively in battte). I can't see that being too difficult to set up. It's akin to one patch over another.

Oh, I see what you mean in regards to the direction of the dungeon progression. Yes, I do not know what PinkPuff's end plans for that are.

As for catching up both Chillyfeez and myself have a large amount of matters figured out between the two of us... mostly dealing with in-battle dealings though we've worked on a fair amount of overworld and event ASM as well.

Here is Chillyfeez's topic...

http://slickproductions.org/forum/index.php?topic=1940.0

Here is mine...

http://slickproductions.org/forum/index.php?topic=1883.0

If you have a bit of time to kill feel free to give them a look over.

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: FF4 Roguelikeifyer (basic map randomization working)
« Reply #29 on: November 06, 2016, 12:27:29 PM »
The altered ASM shouldn't be much of an imposition, it's simply tweaks to background stuff you likely wouldn't have touched and the Slave routine, which you had to know was getting changed.
As for the used free space, those five-byte spaces are taken from isolated little spots of what is normally six bytes of FFs so you won't miss those. Then the larger chunk of space is a relatively small block that exists after the world map tile properties.
I tried to be minimally invasive, but if you need I can move some stuff to a more convenient location.