Pages

Sunday, September 18, 2011

The Final Fantasy Legend: Monster Program

After several nights of putting in a couple hours work I finally have a working Java program to determine monster transitions. There's no UI at the moment and everything ends up hardcoded but I start with two sets of monsters: my party and the monsters I can run into in random encounters before the 3rd boss fight. I then do a couple nested loops where I try to eat everything with all of my monsters and then try to eat everything with everything that I turned into in the first step. Repeat until I run out of things to turn to.

You may recall I'd found a couple ways to turn into a level 2 monster (but that wasn't enough to beat the 3rd boss) and I was hoping to find a way to get a little higher so I could beat him up. It turns out that shouldn't be a problem since it seems like I can actually get all the way to level 13 just on the random junk I can fight at the start of the game. (Max level is 14!) This sounds like the equivalent of punching myself in the face for 50 hours before moving beyond the first zone in Final Fantasy II... Who knows if I'll actually try to get that high or if I'll settle for being good enough to beat the 3rd boss...


I'm a little annoyed it took me this long to get the program done. I ended up pretty much having to write all my classes twice because I'm terrible. I wrote all my race classes before testing anything so when it turned out Java doesn't handle overloaded functions like I thought it would I had to start over from scratch. (Java chooses which overloaded function to use at compile time instead of at run time so my plan of having each monster family with a transform function for each family of meat didn't work. I ended up having to run a huge if-else section with instanceof checks.) But if I'd done any proof of concept testing (or wrote tests first) I'd have caught the issue right off the hop and saved several hours. Oh well!

No comments:

Post a Comment