1 2
6 7 8 9
Player (198)
Joined: 12/3/2006
Posts: 151
Inspired by Dromiceius' wacky idea I have decided to make another Lufia II TAS. The idea would be for this TAS to live up to the "Tool-assisted" part of it's definition, using tools to actually calculate the fastest way to kill a boss, solving a puzzle, having an item drop and so on instead of 'trying randomly' like in my currently published TAS. This TAS will probably be a (very) long term project, since it will involve a lot of programming and ASM deciphering, but I really want it to be perfect :). Edit: Here's a demo showing the possibilities of successfully using this technique
Player (198)
Joined: 12/3/2006
Posts: 151
Since I've had my TAS on hold for a few months now, I thought I'd share the following tricks with you: http://dehacked.2y.net/microstorage.php/info/5530/lufia2-gratze-shortcut.smv This should save about 810 frames (13.5 sec). Credits to KeiKusanagi from The Lufia World forum http://dehacked.2y.net/microstorage.php/info/5531/lufia2-ancienttower-glitch.smv While of no apparant use yet, this trick has potential to skip the largest plot in the game. Both were recorded with snes9x 1.43-improvement9.
Joined: 12/7/2004
Posts: 69
I was looking at the source code you posted. I don't know if it's true for Java, but I know in C++ multiplication is slightly faster than division so instead of /2 you can do *0.5 get the same results and it's less assembly instructions. Also, on a line like this: int damage = (rng.callRN()/8*100/256+100-10/2)/2; You could do the math in a calculator and just put in a number (of what you can) the 10/2 in the end could just be 5 and 100 is then 95 then after all reducing you get something like this: (rng.callRN()*25)/1024+47.5 put in 5 for the callRN() both came out with the same answers, but the second one does much less math. I don't know if you're still using that program or not, but it could be faster... there might be other optimizations, i only saw what you posted.
Active player (283)
Joined: 3/4/2006
Posts: 341
qbproger wrote:
I was looking at the source code you posted. I don't know if it's true for Java, but I know in C++ multiplication is slightly faster than division so instead of /2 you can do *0.5 get the same results and it's less assembly instructions. Also, on a line like this: int damage = (rng.callRN()/8*100/256+100-10/2)/2; You could do the math in a calculator and just put in a number (of what you can) the 10/2 in the end could just be 5 and 100 is then 95 then after all reducing you get something like this: (rng.callRN()*25)/1024+47.5 put in 5 for the callRN() both came out with the same answers, but the second one does much less math. I don't know if you're still using that program or not, but it could be faster... there might be other optimizations, i only saw what you posted.
The numbers used are integers, so Java rounds every intermediate result to an integer. (and I hope it rounds down, since that's what the game does.) The simplified expression you suggested doesn't give the same result.
Joined: 12/7/2004
Posts: 69
ah, i was putting it in a calculator, slipped my mind about the rounding because i usually work with doubles. still should be able to be reduced to something like: (rng.callRN()/8*100/256+95)/2
Active player (283)
Joined: 3/4/2006
Posts: 341
The only reason it was done that way is because the damage formula is (rng.callRN()/8*attack/256+attack-defense/2)/2, where the random variance (rng.callRN()/8) also depends on the type of attack. The attack value of a boomerang is 100, and the catfish's defense is 10.
Joined: 12/7/2004
Posts: 69
oh, so it was for the specific example...
Former player
Joined: 4/6/2006
Posts: 462
OOOOH Gunty! Those tricks bugs are awesome!!! That key bug in Gratze is amazing. Good on ya KeiKusanagi! Also hope to see a way to get past those guards in the shrine. That would just skip so much. I wonder though, once you do, would Dekar and Guy be there like normal? Perhaps a certain trigger during that long cutscene makes them appear there. And what about the absence of Selan? *DUN DUN DUN*
Player (198)
Joined: 12/3/2006
Posts: 151
Hmm, I did some research with a 'walk through walls' PAR code and when you get past the guard in the shrine, Guy and Dekar will join the party and you're able to continue the game without Selan :). However! If you get past the shrine before beating gades, you trigger the same scene where Guy and Dekar join you eventhough they're still in your party. This mean that if there is a way to get past the guards in the shrine (which is unlikely), beating Gades is not nessecary at all, rendering the 'escape from the Acient Tower' trick useless. Oh well... As for qbproger's questions, Nitrodon already answered them. And yes, Java does round integers down.
Player (198)
Joined: 12/3/2006
Posts: 151
While not the most impressive trick, this one should save 226 frames (using snes9x 1.51): http://dehacked.2y.net/microstorage.php/info/1746397075/lufia2-introskip.smv Though, the best part of starting the game this way is the RNG being in an 'earlier state', meaning that there will be new luck manipulation options early in the game.
Player (104)
Joined: 1/30/2005
Posts: 562
Location: Québec, Canada
Gunty wrote:
While not the most impressive trick, this one should save 226 frames (using snes9x 1.51): http://dehacked.2y.net/microstorage.php/info/1746397075/lufia2-introskip.smv
Does it also work in older versions of Snes9x? (1.43v9, for example)
Player (198)
Joined: 12/3/2006
Posts: 151
It does. Notice how this movie is 2 frames shorter though. It seems like every 192'th frame snes9x 1.51 is a frame behind compared to 1.43v9. Also, I've had desync problems when recording with snes9x 1.51 which I never had with 1.43v9...
Former player
Joined: 10/1/2006
Posts: 1102
Location: boot_camp
Gunty wrote:
Notice how this movie is 2 frames shorter though. It seems like every 192'th frame snes9x 1.51 is a frame behind compared to 1.43v9.
I had that same problem with 1.51, which is why I don't use it for tasing. I think it has something to do with WIP1 timing, which 1.51 doesn't have.
Borg Collective wrote:
Negotiation is irrelevant. Self-determination is irrelevant. You will be assimilated.
Player (198)
Joined: 12/3/2006
Posts: 151
I don't mind too much about the extra frames since it's hardly noticable anyways. Also, I suppose this due to the more accurate emulation of snes9x 1.51 which is always good. The desyncing however isn't that pretty.
Player (198)
Joined: 12/3/2006
Posts: 151
Excuse my double post, but I'd like to know your opinion of a new concept for a TAS I've been thinking about. At first, I was thinking of doing a plain Gift mode run which would aim to clear the Ancient Cave as fast as possible, but soon I realised it would be pretty trivial to do in a TAS and somewhat boring to watch. But, how about a TAS which races down to floor 99 as soon as possible, beats the master AND collects all additional 9 Iris treasures? I'm sure it would be fun to see the game pushed to it's limits like that. Since collecting all Iris treasures typically took me months, collecting all of them in one go could be pretty amusing to watch. Yes/Meh/No?
Former player
Joined: 4/6/2006
Posts: 462
What would be more interesting is that you manipulate every floor in a way where it's interesting. Don't aim for fastest time but make it as interesting as you can. Blue chests every floor, obtain all 9 Iris Treasures in one sitting, lots of room filled with monsters and chests, etc.. Heck, even kill some of the harder monsters in the latter floors with fancy methods like...I dunno...1HKO Gold Dragon and make it drop Gold Eye. Of course, such a TAS would either be concept or won't be accepted at all but I for one (only one, you shouldn't make the TAS just for me) would enjoy watching it. Oh whatever, I'm out latter.
Joined: 10/3/2005
Posts: 1332
Gunty wrote:
But, how about a TAS which races down to floor 99 as soon as possible, beats the master AND collects all additional 9 Iris treasures? I'm sure it would be fun to see the game pushed to it's limits like that. Since collecting all Iris treasures typically took me months, collecting all of them in one go could be pretty amusing to watch. Yes/Meh/No?
I'm fairly curious to see how that would look; beating that damn cave was no trivial thing, so beating it quickly would be nuts. Seems like something you could submit as a concept demo without too many objections. Pre-yes vote. :)
Player (104)
Joined: 1/30/2005
Posts: 562
Location: Québec, Canada
I don't want to ruin anything for you guys, but the ancient cave requires an INSANE amount of luck manipulation. I know Nitrodon looked into the game code to know what the game does to generate floors and everything in them. I don't remember the specifics, but I do remember that it's an insanely huge amount of things to consider. I do agree that it would make a cool TAS to watch, though. Pre-yes vote from me too.
Post subject: 9 Iris Treasures
Joined: 11/17/2005
Posts: 278
Location: Massachusetts, USA
Pre-yes from me too! I was rarely ever able to reach the bottom of the cave on a console. If you could somehow get all 9 Iris Treasures in one run then that would be amazing! It's something you can only do in a TAS I'm sure. As for fastest vs entertainment, I don't think you'll have a choice! You'll have to manipulate: the maps to give the treasures in an easily reachable place, the contents of the treasures, and the monsters. I don't even know if it's possible for the game to spawn multiple Iris Treasures in one instance of the cave. And if it is possible, then it's very improbable. I think you're going to have such a hard time completing the basic goals that you'll be forced to just go with whatever happens. (You should however run from power on to the cave as fast as possible.) I think this run should be a new category under Lufia 2. That's pretty unheard of, but most SNES games don't include "Diablo" as a minigame either. (Man, would I love to see a TAS of Diablo or any of the games that inspired it!)
Player (198)
Joined: 12/3/2006
Posts: 151
I'm glad there's some interest in this concept.
erokky wrote:
What would be more interesting is that you manipulate every floor in a way where it's interesting...
I agree that this would make the TAS less repetitive to watch, but the problem with such a run is that it's goals are somewhat vague. I've seen quite a few TAS'es seen rejected because of this and that's why I'd like to keep it's goals clear. Collecting all 10 Iris Treasures and displaying them all in the pub (or whatever it is) is a clear critereum and should leave it open to competition.
Halamantariel wrote:
I don't want to ruin anything for you guys, but the ancient cave requires an INSANE amount of luck manipulation...
Don't worry, I know. I actually have thought of a relatively easy way to make this TAS. Since the outcome of the Ancient Cave floor generating routine is determined by the current state of the RNG, why not modify the emulator in a way it runs the subroutine for every possible RNG state? That's what I did and I had it run for over 12 hours now, simulating 200000 different floors. Since generating a floor typically takes about 2000 random numbers, 200000 simulations should be plenty for 98 floors. Every simulation logs the following things:
  • RNG state before the subroutine
  • Iris treasures
  • Providence
  • Distance from starting location to stairs
  • Distance from starting location to stairs via the first treasure chest (which always contains Iris treasures or Providence if they're generated)
  • RNG state after the subroutine
This information should lower the difficulty of making this TAS somewhat.
Dromiceius wrote:
Seems like something you could submit as a concept demo without too many objections.
Yep, I figured this would be somewhat like the CPU humiliation in the "4 cpus" Monopoly TAS (one of my favorite movies for the record). It's absurd luck manipulation actually partially inspired me to run Lufia II in the first place.
Catastrophe wrote:
I don't even know if it's possible for the game to spawn multiple Iris Treasures in one instance of the cave.
It's very much possible (with tools of course). The only limitations I know of is there can be only one Iris treasure every floor and if a Iris treasure is spawned, the same floor cannot contain Providence.
Catastrophe also wrote:
You should however run from power on to the cave as fast as possible.
Actually, I was planning on doing a Gift mode run, which would prevent me from having to play through the game all the way to Gruberik to able to enter the cave. To do this, either SRAM or a Game Genie code/hack has to be used. I'm leaning towards the Gamegenie codes since the SRAM method leaves the game open to RNG manipulation before starting the movie. Thanks for voting everyone :)
Joined: 8/3/2004
Posts: 325
Yeah I would definitly love to see this movie. I do suggest however that you discuss it with Bisqwit before making it because he might not like the idea of using a game-genie code to reach the Ancient Cave We might have to, for example, use the old Lufia2 movie file that quietkane was using to make his movie... it goes all the way to the ancient cave anyways so it could be used to be the starting point of the movie (IE, your movie would be a seperate smv file that starts at the end of his... your start with lvl 1 and nothing in the cave anyways)
Player (104)
Joined: 1/30/2005
Posts: 562
Location: Québec, Canada
Gunty wrote:
Halamantariel wrote:
I don't want to ruin anything for you guys, but the ancient cave requires an INSANE amount of luck manipulation...
Don't worry, I know. I actually have thought of a relatively easy way to make this TAS. Since the outcome of the Ancient Cave floor generating routine is determined by the current state of the RNG, why not modify the emulator in a way it runs the subroutine for every possible RNG state? That's what I did and I had it run for over 12 hours now, simulating 200000 different floors. Since generating a floor typically takes about 2000 random numbers, 200000 simulations should be plenty for 98 floors. Every simulation logs the following things:
  • RNG state before the subroutine
  • Iris treasures
  • Providence
  • Distance from starting location to stairs
  • Distance from starting location to stairs via the first treasure chest (which always contains Iris treasures or Providence if they're generated)
  • RNG state after the subroutine
This information should lower the difficulty of making this TAS somewhat.
This would probably be a better thing to do in a separate program rather than in the emulator itself. Creating a program that takes as an input the current RNG state (all of its values), then simulates one RNG use, output the floor generated from that RNG state, revert back to the original RNG state, simulate 2 RNG uses, output the floor ... etc ... I have done this before. Not for the Ancient Cave, but for battle manipulation. Nitrodon and I used that tool that I created to know what would happen in a battle for every possible outcome, and also allowed to predict a whole battle in advance, including what the enemy would do. That tool is far from being complete. I had to modify it for every battle we came across that needed strong manipulation, but it did what it was supposed to do (if you knew its limitations). What I'm saying is, it's fairly easy to create a program that simulates RNG uses, simulates what the game does with that RNG, and create a visual output of the result. All it would need is the RNG state at the beginning. I would gladly create that program myself (if nobody wants to do it), but I'd have to work with Nitrodon on this (as always). Also, I won't be able to do any programming / TASing for the next 5 days because the power supply of my main computer died. I ordered a new one, but I don't expect it to arrive in less than 5 days. For short: I could program this thing that would simulate Ancient Cave floors. It will take some time before I can start working on it, and it will take a long time to complete it (because of the huge amount of stuff to consider in the generation of a floor).
Player (198)
Joined: 12/3/2006
Posts: 151
Agreed, that would probably be a better thing to do. In fact, that's what I initially was planning to do. However, I'm not sure if you misread my post, but actually I already have modified the emulator and let it run for a night. And I'm not really sure why you'd want to make a (complex) program to simulate the exact same thing :) Also, I'll ask for Bisqwit's stance on using Gamegenie codes for unlocking Gift mode. Also also, I'll be unable to TAS for 5 days as well, starting tomorrow.
Player (198)
Joined: 12/3/2006
Posts: 151
Small update: I wrote an algorithm to find the fastest way to go through every floor while collecting one Iris treasure every 10 floors based on the data I got from the modified emulator, but naturally, doing this for 100 straight floors takes way too long (we're talking about ~8^170 possibilities here). So I decided to limit it to 10 straight floors, leaving only ~10^15 possibilities which is acceptable. I started making a movie with the data, but soon I found out I overlooked something. If I recall correctly, the first 8 floors are the only ones to spawn helmets and rings and since I based all my data on the first floor, the simulations started to become inaccurate after floor 8. This means I have to collect new data for floors further than 8. Nevertheless I continued making the movie manually, going all the way to floor 24, collecting 2 Iris treasure and Providence. I'm going to redo it from floor 8, but here it is anyways: http://dehacked.2y.net/microstorage.php/info/1870077650/lufia2-giftmode-test.smv Recorded using snes9x 1.51 with the following pro-action replay/game genie codes:
82E99EA9
82E99F02
Active player (283)
Joined: 3/4/2006
Posts: 341
Just some random questions: What are the goals of this run? How do you plan to get the 10th Iris treasure? Why did you get Providence? You'll get it automatically when you fight the boss anyway.
1 2
6 7 8 9