upr-fvx / universal-pokemon-randomizer-fvx

Public repository of source code for the Universal Pokemon Randomizer FVX
GNU General Public License v3.0
14 stars 1 forks source link

[Feature Request] Trainer Class Randomization #13

Open FrostedGeulleisia opened 1 month ago

FrostedGeulleisia commented 1 month ago

Sorry if this feels like a bit much, but it's something i've been looking forward to for many years.

Is your idea a new setting, a change to an existing setting, or something else? Please describe clearly:

Randomizing trainer classes is a mostly cosmetic, albeit entertaining concept that's already implemented in some other randomizers. Complexity of implementing it depends on the game, but in generations 4-7 it's merely a one\two-byte change in 'trtype' data structures. A trainer class consists of:

Generation 3 is interesting, as in trainer data, what would normally be just the trainer class is split into separate values for the class (controls name, music, payout and intros), sprite and encounter theme. These can be randomized independently or with vanilla combinations, it's up to you.

In generation 6, certain major battles will notably crash the game if trainer classes are randomized as-is. For any multi (two trainers on each side) battles where the opponents/allies use 3D models, they MUST be randomized only to other classes that have such models. The game will crash otherwise. Examples of such battles include the Flare Admin multi battle at the Poké Ball factory in X/Y (~6 badges in i believe), the Meteor Falls encounter in ORAS, and the Southern Island fights also in ORAS. pk3DS might have a full list? I don't remember.

Also, ORAS has all XY classes intact, however a few have issues:

All other XY classes should function as intended.

I don't expect support for Generations 1 and 2, due to how trainer data is stored there, it's impossible to implement without major changes to the output ROM, unless you simply swap sprite pointers/names/payouts around, like how it was done in Sanqui's old Red randomizer (the one with a 721-mon pool).

Now, for this section, there are two terms i must explain: "normal" and "special" classes.

It's up to interpretation, but I count special classes as ones which are tied to a major storyline character.

This means Gym Leaders, Rivals, the Elite Four/Champion, evil team Admins and Leaders, Professors etc. count as special, but Grunts and Morimoto don't. A normal class, is one that's not special (duh).

For the randomization modes, the following would be appreciated:

At one point, a friend of mine made a little program to randomize trainer classes in gen 4 and 5 games.. I believe it and the pk3DS repository would be a good starting point.

What problem would this feature solve? Please describe:

This is to ensure parity with other tools and randomizers that have this feature (eg. pk3DS)

Additional context:

The lack of this feature is what's making me not switch to using UPR (or a fork) for everything, and have to still rely on pk3DS and a custom-written tool to randomize them, which makes preparing randomized ROMs more annoying. The alternatives have proven that this is possible to do, and doesn't take much to get going.

Any questions are welcome, I would try implementing this myself, albeit I don't know any Java, nor that much of other languages.

voliol commented 1 month ago

Interesting idea! And also something that sounds quite plausible. I'm not sure if the randomizer reads the trainer class already for all relevant games, but if it doesn't it should be in the vicinity of other data which is already mucked around with. And as you say, the Gen 1 and 2 games should be the trickiest to implement, though less so because the data can't be changed/repointed to have different amounts of each class, and more because individual trainer scripts refer to "trainer #X of class #Y" rather than just "trainer #X".

Of course, as with any randomizer feature, developer time is a limited resource. Can't guarantee it anytime soon, but if you or someone else decides to give it a try, I'm happy to give pointers :).

On that note, one design issue I see is named characters with multiple classes. I.e. Giovanni in FRLG, or (presumably, haven't confirmed) Wally in ORAS. When randomizing, do we ensure all trainers representing a story character get handed the same new class? Or are we fine with Agatha replacing Giovanni when he's a "Boss" in Rocket Hideout and Silph Co., but a Bug Catcher replacing him when a "Gym Leader" in Viridian Gym?

FrostedGeulleisia commented 1 month ago

@voliol it already reads the trainer classes for logging purposes at least Also, for what you've mentioned, the Giovanni example: The two, Team Rocket Giovanni and Gym Leader Giovanni are separate trainer classes, (specifically in gen 3 he uses the generic "Team Rocket" and "Leader" classes, which are shared with all other grunts (for the former) and gym leaders (for the latter)). In ORAS, Wally simply uses two trainer classes. I'll get lists of trainer classes for each game when I get back home (in 2-3 days). So, to answer your question: the latter. I'm fine with them being inconsistent per encounter.