Joined: 1/1/2022
Posts: 1716
I realize this topic is quite old, but is there any info on when the 2nd episode of the fan-subbed ToP anime will be released?
Joined: 9/24/2004
Posts: 75
How's optimizing the run on the Japanese ROM version for submission going, AP?
Bisqwit wrote:
Wow, I had completely forgot that the sanctuary where Dhaos was locked in has the Retaliation music theme. I thought it's only in Ifrit's place. It's very cool. I wonder how are the voice samples going to work when I record the actual submission as AVI... snes9x generally has had some problems with the voices (most notoriously the intro song, which sometimes chops and plays small pieces as noise). The intro song will not be heard, but the introduction scene has sampled speech.
Having used SNESSOR95 to rip samples (you can do it on both roms and .SPC tracks,) I've understood how Tales of Phantasia (and also Star Ocean) use the "Flexible Voice Driver." The real reason you get scratches is the speech is split into very tiny (fractions of second) samples which are rotated on the fly to fit in the 64k SPC memory, so if you're multitasking or something and things lag by even the smallest bit they sound wrong. Incidently, that's also why many .SPC tracks of those games don't play well--only the initial samples are stored in memory, so you hear junk instead of singing in the intro music, and many instruments in other tracks are missing. To answer your question, Bisqwit, it should play mostly ok if there aren't too many other things open and you don't fast-forward too much. Doesn't he skip the intro scene (where Edward D.Morrison speaks) too? Or are you talking about the Dhaos battle at the start of the game?
"If all you did this year was sit in your cubicle and masturbate...say you're a self-starter who proactively reengineered your personal inventory with Total Quality, conforming to all EEO/OSHA/ISO9000 requirements."-Scott Adams
Joined: 11/22/2004
Posts: 1468
Location: Rotterdam, The Netherlands
I'm encoding this to AVI and will post the link when it's done.
Former player
Joined: 7/14/2004
Posts: 104
DukeNukem007 wrote:
How's optimizing the run on the Japanese ROM version for submission going, AP?
It's not. I started and got half an hour into the game, and had desynchs when replaying it.. grr. A few days after that I picked up ToS, and haven't played much else since. Too busy to do any gaming, but maybe having another shot at recording with the newer snes9x (less desynchs?) is a possibility in the future.
Joined: 1/1/2022
Posts: 1716
Sorry to bump once again, but back to my last post: "... is there any info on when the 2nd episode of the fan-subbed ToP anime will be released?" Or have the translations stopped being created?
Former player
Joined: 7/14/2004
Posts: 104
It came out recently, I think. Actually, I only watched the episode earlier today, so you've got good timing. http://www.tales-cless.org/ (torrent link is there)
Joined: 1/1/2022
Posts: 1716
Thanks a bunch. Downloading now.
Joined: 1/14/2005
Posts: 216
DukeNukem007 wrote:
Doesn't he skip the intro scene (where Edward D.Morrison speaks) too? Or are you talking about the Dhaos battle at the start of the game?
I think he has to be talking about the fight with Dhaos. Downloading the ToP anime now, thanks to all for the link.
"I think happiness is just being able to loaf without stress." http://speeddemosarchive.com/
Post subject: Tales of Phantasia
Player (100)
Joined: 3/20/2008
Posts: 466
Location: Montreal, Quebec, Canada
For those of you unfamiliar with the game, Tales of Phantasia is an amazing and often overlooked RPG for the super nintendo. Unfortunately it was only released in Japan and at the very end of the SNES lifespan, so very few people in North America even know about it. Here's a video preview to give you a taste of what the gameplay is like: Link to video I think the game would be good for TASing for a variety of reasons. In particular, the combat system is unique in that this is a real-time 2D action RPG, probably the only game of its kind on the SNES. Other considerations: Text is skipped quickly and seamlessly, but at a pace where text can still be read, meaning the plot can be followed by the viewer. The main character moves very quickly with the jet boots, which are purchased early on. Normally a lot of grinding is required to beat bosses, and there aren't super cheap exploits like FF6's joker doom or vanish/doom to trivialize combat. As a result, each character only manages moderate damage while dying in a handful of hits. A lot of strategy & luck is required to attack the enemy in a way that they can't counter-attack, often involving a corner trap. Battles can be escaped relatively quickly compared to RPGs like FF3 & Chrono Trigger. As it turns out, I was worried this game would be impossible to TAS without at least some level grinding. However, this doesn't seem to be the case for 2 reasons. One: a character's stats are boosted much more by their weapons & armor than by their raw stats. It's not uncommon for a character to have a weapon at the beginning of the game that has 12-15 atk, while endgame weapons eclipse 1000 atk. And two: Bosses give considerably more exp than random encounters, to the point where your units will maintain a decent level throughout the game. In fact, I worked out the results with an exp spreadsheet all the way up to Volt. I was surprised to see my units were at the following levels: Cless: lv 32 Mint: lv 29 Klarth: lv 29 Arche: lv 32 Chester: lv 5 I'm pretty sure Dhaos v3 could be defeated at these levels, although that's certainly worth testing. Some things worth looking into: How random encounters work. In particular, can they be avoided altogether somehow, say by a menu trick? That would save more time than anything. Item & gold planning: This will probably be very time consuming. Some items are absolutely vital for a low-level run, such as the mist rune (allows you to escape battles 50% faster) and the mystical rune (halves the time needed to cast a spell). Boss strats: Early on, I'm betting the main strat will be to trap bosses in a corner and spam blade storm. Later on, Klarth and Arche tend to do more damage as Cless, so his main role is to distract enemies & prevent them from casting or otherwise attacking your backliners. Chester: Is he worth using? He receives a few bows that have more atk than Cless' weapons that also fire multiple times a volley. He obviously doesn't out-damage the casters, but he also doesn't require an animation for his attacks. Killing off characters: Perhaps it would be worthwhile to kill Mist in order to focus more exp into the other characters. It might even be viable to have Cless solo a few bosses when casting is particularly ineffective. Well, I think that does it for preliminary thoughts.
Player (100)
Joined: 3/20/2008
Posts: 466
Location: Montreal, Quebec, Canada
Random Encounter Info The address that controls random encounters is 0x7E143C. It seems to pick a random value between 0 and 128 and decreases by 1 each step. What's cool is that you can manipulate this counter based on the frame you attempt to escape battle. Or, in some cases, you manipulate on the frame you enter the battle. With proper luck manipulation, you could probably max out the counter every time you flee a skirmish. Saving and resetting also manipulates the counter, so this could potentially be used to avoid random battles altogether, at least on the overworld map. Entering and exiting the town has the same effect. However, entering a new screen in the same area does not affect the counter. Holding B with the jet boots makes you move twice as fast, but also decrements the counter four times as fast. Oddly enough, this means sometimes it is advantageous speed-wise to walk instead of running! When using a holy bottle, the counter sets to -1, increments to -128, then decrements from 128 to 0. In other words, the holy bottle ensures exactly 255 steps before a random encounter. This effect maintains until the holy bottle wears out. A holy bottle lasts 2x255 or 510 steps. You could use holy bottles consecutively to prolong encounters. For instance, you could use a holy bottle, run 254 steps, then use another holy bottle and the counter will still set to -1. This means you could delay a random encounter up to 127 + 254x15 or 3937 steps. Entering and exiting a village also resets the counter to -1 when using a holy bottle. However, this doesn’t affect how many steps the holy bottle lasts. A Dark bottle seems to limit the counter to values between 0 and 25. When switching screens, the number of frames you must wait for a new RN is variable. I’ve had to wait as little as 1 frame and as much as 18 frames to get a new RN. I've had no luck cracking the random encounter RNG itself. Manipulating the counter will be a real pain without knowing the exact frame where the counter value changes when transitioning screens or fleeing a battle.
Joined: 7/2/2007
Posts: 3960
Random encounters are incredibly common in this game, and skipping them will save vast amounts of time. It's good to know how holy bottles work, because you're gonna need a lot of them. Figure a given random encounter takes at least 5s to resolve (from fade-in to escaping to fade-out), and a holy bottle lets you skip, at bare minimum, 2 encounters -- thus, any time it takes less than 10s to get a holy bottle, you're gaining time. Arranging the money to buy them all is gonna be tricky, though fortunately they aren't especially expensive, if I recall correctly. In the time it takes a spell to go off, Chester can fire at least 3 times without having to pause the fight. The party's realtime DPS is way higher by having Chester along than by using a caster. That said, you'll still want to pick up at least Thunder Blade for Arche for the Pegasus segment. Assuming you can arrange a steady supply of holy bottles, the mist rune shouldn't be needed. Mystical runes also probably won't be needed since I expect Cless's realtime DPS is much better than the casters' in most cases. But I believe there's a rune just lying around somewhere; certainly you shouldn't drop the 65000 on buying one. If nothing else, you'll probably want Arche casting for the Pegasus segment, to wipe out the trash fights before the boss. If combat experience is split between party members, then I definitely think you'd be best off killing off all three casters for the majority of the game. The amount of damage they can contribute without having to pause the fight is simply not worth it in most cases. Sure, they can end random encounters fairly quickly, but you'll be skipping the vast majority of random encounters.
Pyrel - an open-source rewrite of the Angband roguelike game in Python.
Player (100)
Joined: 3/20/2008
Posts: 466
Location: Montreal, Quebec, Canada
Random encounters are incredibly common in this game, and skipping them will save vast amounts of time. It's good to know how holy bottles work, because you're gonna need a lot of them. Figure a given random encounter takes at least 5s to resolve (from fade-in to escaping to fade-out), and a holy bottle lets you skip, at bare minimum, 2 encounters -- thus, any time it takes less than 10s to get a holy bottle, you're gaining time. Arranging the money to buy them all is gonna be tricky, though fortunately they aren't especially expensive, if I recall correctly.
According to this, holy bottles only cost 42g. Considering that bosses after Demitel give at least 5000g, that's hardly a strain in the budget.
DPS stuff
Hmm, I'm not sure about this. Take, for instance, Dhaos #1. Arche manages close to 6000 damage with indignation whereas Cless barely breaks triple digits with his physical attacks. Or take this battle against Jahmir where Cless' hits do ~40 damage, whereas Klarth's relatively quick Sylph summon does ~250. I'll be sure to compare the boss fight times of Demitel, Jahmir, Undine, etc using a full party vs using Cless only.
Player (100)
Joined: 3/20/2008
Posts: 466
Location: Montreal, Quebec, Canada
I decided to tackle a test run of the game. It is on the DeJap translation of the game and I’m using snes9x v1.51 because I can’t stand lsnes and bizhawk. I provided an encode of the boss fights since those are by far the most entertaining aspects of the WIP. Link to video WIP1 smv I managed to complete the present in under 30 minutes. I underestimated how cutscene heavy this game is and now I estimate a full run would take at least 5 hours or so. Somewhat random notes 7E2142: relative x position (fluctuates between 0 and 255) 7E2145: relative y position (fluctuates between 0 and 255) I’ve noticed in southern forest that sometimes I can manipulate the counter to very high negative values like -121. Unfortunately this would only grant me a few extra steps compared to rolling a 128. Hopefully it’s possible to manipulate really low negative values like -15. That way I could manage almost 255 steps per counter without even using a holy bottle! I also noticed the RNG changes during Martel’s cutscene based on the frame you choose to advance dialogue. Manipulating this is a pain though since the RNG changes multiple times per cutscene. You also have to wait many frames (~10) to get a new RN value. Cless can perform a regular, non-moving slash every 40-41 frames, depending on lag. I just tested and it’s considerably faster to walk than run in a dungeon. It looks strange but those extra random encounters really are that time consuming. Unfortunately, in the dungeons I’ve been in, you can’t manipulate the random encounter RNG by waiting out frames. This is a real drag :( Earlygame considerations: -Is it worth getting the knight sabre? No. Golem can be beaten pretty quickly without it. -Is it worth grinding Cless to lv 5 in order to learn duel kick against golem? No. Random battles give too few exp. -How many orange gummies and flare bottles should be bought? I got 3 of each. -Missed acquiring the heavy stone. Will this be a big deal? -Also missed the hourglass (can turn into a crono glass). Make sure to visit the sarcophagus the first time around. -Acquiring both chain mails is an option for extra gold. General notes: -In terms of combat, I was surprised how often I could get critical hits / dizzies. With enough determination it might be possible to get every 1st to 3rd hit as a critical. Again, knowing how the game’s RNG works would help tremendously. -Extreme amounts of luck manipulation are required to prevent enemies from blocking your attacks. Seriously, golem seems to block at least 60% of attacks he faces, and it’s very rare to be able to land all of duel kick + have Chester hit. -Killing Chester against the twin golems would’ve gotten Cless another level-up, but I figured it would take too long to kill off Chester. -Manipulating combat in general is a total headache. There’s so much that can change in an entire fight just be delaying a single attack 2 frames. Very challenging to optimize this chaos, and Boss notes: Boar fight- I re-target midway through the fight in order to be able to hit the boar and baby boar simultaneously. Sewer king- I spam psion bolt since it does 50% more damage than regular hits and attacks at range. I target the slime in order to launch psion bolts at the sewer king, otherwise I’d be unable to use it due to being at close range. Eventually, the boss gets caught in a position where he stuns Cless without damaging him, which leads to a flurry of 5 abnormally fast hits. There might be a way to pull this trick off more than once. Golem- I re-position Mist to the frontlines in order to quickly dispatch her. That way, Cless and Chester get more exp. I also give Chester a flare bottle since he is doing considerably more damage per hit than Cless.
Joined: 7/2/2007
Posts: 3960
It seems clear that fight manipulation is going to be where most of the difficulty of this TAS is. Your overall strategy seemed fine to me, but the enemies don't always behave themselves. Par for the course for a test run, of course; the main thing for now is to nail down the route and what items need to be purchased. There's a few times in these fights where you do running attacks while at relatively close range. This makes Cless run back to his original position after the attack. I suspect it'd be faster to walk up to the enemy soon and start doing standing attacks. (It's a shame you don't have an option for full-manual control of Cless!) Regarding those 5 fast hits, that seems to happen whenever Cless overlaps with another enemy. I can't remember if it only happens with flying enemies or not. I've definitely had it happen with normal play though, and it can be very helpful.
Pyrel - an open-source rewrite of the Angband roguelike game in Python.
Player (100)
Joined: 3/20/2008
Posts: 466
Location: Montreal, Quebec, Canada
Completed up to Jahmir with a time just over an hour. The boss combat’s much more smooth this time around as I’m figuring out the nuances of TASing the battle sequences. As before, here’s the smv and a video of the bosses: Link to video WIP2 smv Credit to JPuga for his wonderful faq on the game, it’s really helpful for tracking items as you progress through the game. I’m modeling my notes after his section names for organizational purposes. ------------------------------------------ 3.5- A new world, or an old time? ------------------------------------------ Hourglass in the southern forest (get this later). Learned mecha blade to be safe. I’ve found this technique tremendously useful in casual playthroughs, but I’m not sure if I’ll even master any skills in this run! It might be a while before I get 100 uses from tiger blade and psion bolt. For now I shall forego the shops in Deladum for the one in Harmel since they sell better stuff. The only item of interest here is the flare bottle. I have to make a slight detour to a port northeast of Deladum in order to acquire an elixir (which I can sell for 10,000g) and a mystical rune (I can either use or sell for 32,900g). Not sure how to manipulate the crab and the seagull. --------------------------- 3.6- Euclid in the Past ---------------------------- I get the charm bottle behind Klarth’s house, which can be transformed into a lotus perfume. This gives a 50% discount in any store when used. This will save a tremendous amount of money later on. For instance, if I want to buy the laser blade in Freezekill (100,000g), I would save 50,000g. I also get a mixed gummy and rune bottle since I can transform it into a miracle gummy (60% hp & tp recovery) if necessary. ------------------------------------ 3.7- The Valley of the Sylphs ------------------------------------ Before going here I make a detour to Harmel where I sell an elixir and buy 15 flare bottles, 1 iron boots, 13 holy bottles (note: should’ve used 2 in the golem dungeon), a rope, pick-axe and a warrior sword. The crescent has a slightly stronger slash value, but virtually no stab damage, which makes it do considerably less damage on the last hit of duel kick. Later I use a rune bottle on the iron boots to transform it into Persian boots, which gives Cless 30% more defence. Sylph battle: frame 145270 Sylph battle 2: frame 151214 In both cases I forgot to use a flare bottle, which would’ve allowed me to 1 shot the sylphs. I could also one-shot them with a crescent critical, so that’s probably the better weapon purchase. Got a talisman (sells for 500-1000g) and another charm bottle afterwards. I walked through the dungeon using only 7 holy bottles, which means I could theoretically run through the dungeon using 14 holy bottles. I probably won’t have this luxury in future dungeons since they tend to be longer. Sometimes I deliberately enter and re-exit a town just to manipulate the random encounter RNG (let’s call it reRNG from now on). --------------------------------------------------------- 3.8- Yggdrassil and the Destruction of Harmel --------------------------------------------------------- Forgot to pick up the hourglass in the southern forest. D’oh! In case you’re wondering why I sit in front of Harmel’s north entrance for so long, that’s how long it takes me to manipulate the RNG such that I can reach Venezzia without a random encounter. Oak root planning: With a flare bottle + Corsica, I can kill each oak root in about 10 duel kicks. With a flare bottle + warrior sword, I can kill each oak root in about 20 duel kicks or 30 slashes. From a quick timing TAS I found the Corsica fight took 3306 frames while the warrior sword fight took 3940 frames. That amounts to roughly 10 seconds, much less time than it would take to buy the Corsica in Venezzia thanks to that annoying gondola ride to the armory. Oak root battle: frame 190730 My strategy for Oak root is basically as follows: Start with a long slash, cancel the back dash immediately, walk up to Oak root, slash, walk the distance Oak root was propelled behind, repeat until you’re in the corner. Then spam duel kick in such a way that both Oak roots are getting hit until the first one dies. From there I’m 90% sure repeated slashing is faster than duel kick. Note that the variable pauses between attacks are based on manipulating hits landing. Oak root blocks at least 75-80% of my attacks. Demitel battle: frame 200550 The golems go down really quickly, all they take is one duel kick and a regular slash. The lilites are incredibly annoying in that they sporadically warp all over the screen. If you see me doing strange things like turning for a split second, it’s to manipulate their movement, usually to prevent a spell from being cast. I was lucky when I got to duel kick Demitel and a lilite simultaneously since the lilite would stun Cless in midair and allow him to attack faster. Once all the minor foes were dispatched, I had to slowly work Demitel back into the corner. I’d basically advance Cless as little as possible so that he could attack without dashing and either using a slash or duel kick, depending on what Demitel felt like blocking. Improvements: It didn’t occur to me to use the long-distance stab attack on the Lilites. In fact, it looks like I should’ve prioritized long-distance stabs over duel kicks overall since they do about the same damage but have a faster animation. With better luck, I might be able to corner Demitel for a much faster fight. I slightly doubt that’s even possible with just our low-level Cless unless you can manipulate the lilites to stay on the right side of the map, which is nightmarishly difficult to say the least. P.S. I’m glad to see Cless gained 3 levels, which includes learning lightning bolt and blade storm. I won’t be able to use lightning bolt since it pauses the game when used, but blade storm is the ultimate tech for corner traps. -------------------------------------- 3.10- On the Way to Alvanista -------------------------------------- Meia fight: frame 227290 I start the battle with an intentionally missed attack that brings Cless on the other side of Meia. Then I chase her down into the corner with a single attack and set up a blade storm trap. You’ll see as the fight goes on, Meia blocks more and more blade storm attacks. I’m starting to think this was intentionally programmed as a way of making bosses more difficult (lower hp -> higher block %age). Eventually, I have to give up using blade storm in favor of a few slashes and a cleverly timed duel kick that tricks Meia into attacking the opposite way. ---------------------------------------- 3.11- The Kingdom of Alvanista ---------------------------------------- I purchase a Halberd for Cless and deactivate Arche’s ice spell. I still leave fireball active because its animation doesn’t freeze the battle. Jahmir battle: frame 238865 I have to target Jahmir immediately in order to prevent him from casting. This leaves both Alices to kill off Mist. Unfortunately, they don’t manage to kill Klarth or Arche, which would’ve significantly increased Cless’ exp gain. Cless attacks Jahmir until she puts up his defensive barrier, which allows me to conveniently trap both Alices in a blade storm trap. After that I use 2 duel kicks in order to get the boss in that awkward position above Cless where he gets stunned after each attack but without taking damage. In this setup, he can attack every 23 frames, whereas he can normally slash every 40 frames. I manage to maintain this trap for the entirety of the fight, leading to a surprisingly fast battle (39 secs!). Note that every hit Cless takes is deliberate. ------------------------------------------- 3.13- Ifrit, the Fire Elemental Spirit ------------------------------------------- Ifrit -> Gnome -> Undine seems the most logical route to me. Ice scimitar makes short work of Ifrit, Undine is on the way from Gnome, and you could summon Ifrit against Undine if need be. (To be continued)
Former player
Joined: 2/19/2007
Posts: 424
Location: UK
It's nice to see somebody working on this - I'll be looking forward to the TAS! I investigated some of the mechanics of the game when I played it half a year ago or so. One of the things I did was to dump the monster information table. Sadly, it seems I didn't dump the associated monster names, but that should be possible to infer based on the stats of the monster. Pherhaps it will come in handy. I didn't figure out what all the columns mean, but I think the two bytes between the Holy and Air resistance are individual spell immunities (one bit per spell). A monster can have 5 possible reactions to an element, indicated by the number in the column for that element:
  0: Normal   damage                                 
  1: Double   damage                   
  2: Half     damage                    
  3: Zero     damage                      
>=4: Negative damage                                                                       
The hit formula seems to be:
  • If attacker and defender face the same way, the attack is a hit (and there is a chance of some extra stuff happening, it seems).
  • Otherwise, the chance of hitting is (hit - evade - agl/4)/256.
The hit chance is capped to [0:1], like any probability should be. The melee damage formula seems to be
x = (attack - def*4)*mul*33/32
Here, mul is the element multiplier as described above, with the first element of the weapon that is something else than normal being used, if any. I don't see the point of the multiplication by 33/32, but that seems to be what the game does. I haven't tested this formula, though. It is unsual that it doesn't seem to include any element of randomness, for example. So I may be missing something. Damage is capped to [-9999:9999], and def cannot reduce damage below 0. I haven't checked how def is applied for negative damage, but it would make sense that it isn't applied in this case. The damage formula shows that one strong attack is much better than many weak ones. This is also my experience in the game. This means that attacks like shinkuuhazan (the one with the long delay, but 3 times normal damage, and long reach) can do much more damage than other attacks when you are weak. This meshes with my experience. I have sometimes done 0 damage with my normal attacks, but more than 1000 with shinkuuhazan. On the other hand, when you are strong enough to easily penetrate the enemy's defense, it is better to have 2 hits at double damage than 1 slow hit at triple damage. There is some partially commented assembly here, but I'm not sure how useful it will be - it was written at various stages in my investigation, and may contain incorrect or contradictory hypotheses. Edit: While doing this, I found some RNG code too, though I don't know if this the only RNG or not. The RNG code is at C3E793. I didn't fully disassemble it, only trace it, so I don't have all its code paths
rng = table[((state++)&0xff)<<1]
if(state >= 0x38) do something
where state is the byte at address 0x85 and the table is at address 0x10740x103c (in ram, so it is probably getting overwritten in the "do something" branch. I don't have the rom and emulator at hand at the moment (I'm using my work computer now), but perhaps somebody else can disassemble the funciton now that its location is known. Edit2: I have now disassembled the whole RNG. Here is a C equivalent of what it does (word here means 2 bytes. Remember that indexing an array of N byte data types increases the address by N times the offset. So this is equivalent to the disassembly below):
byte * state = 0x85;
word * table = 0x103c;
word rng() {
  if(++*state >= 0x38) {
    word x;
    for(x=0;x!=0x19;x++)
      table[x] -= table[x+0x1f];
    for(;x!=0x38;x++)
      table[x] -= table[x-0x18];
    *state = 1;
  }
  return table[state];
}
The disassembly itself is here:
rng:
$C3/E793 08          PHP                     P:...Mx....
$C3/E794 8B          PHB                     P:...Mx....
$C3/E795 DA          PHX                     P:...Mx....
8 bit mode;
if(++$85 >= 38) {
  shuffle();
  $85 = 1;
}
$C3/E796 E2 20       SEP #$20                P:...Mx....
$C3/E798 A5 85       LDA $85                 P:...Mx....
$C3/E79A 1A          INC A                   P:...Mx....
$C3/E79B 85 85       STA $85                 P:...Mx....
$C3/E79D C9 38       CMP #$38                P:...Mx....
$C3/E79F 90 07       BCC $07    [$E7A8]      P:...Mx....
$C3/E7A1 20 B7 E7    JSR $E7B7  [$C3:E7B7]   P:...Mx....
$C3/E7A4 A9 01       LDA #$01                P:...Mx....
$C3/E7A6 85 85       STA $85                 P:...Mx....
16 bit mode;
return $103c[($85&0xff)<<1];
$C3/E7A8 C2 20       REP #$20                P:...Mx....
$C3/E7AA 29 FF 00    AND #$00FF              P:...mx....
$C3/E7AD 0A          ASL A                   P:...mx....
$C3/E7AE AA          TAX                     P:...mx....
$C3/E7AF BF 3C 10 00 LDA $00103C,x           P:...mx....
$C3/E7B3 FA          PLX                     P:...mx....
$C3/E7B4 AB          PLB                     P:...mx....
$C3/E7B5 28          PLP                     P:...mx....
$C3/E7B6 6B          RTL                     P:...mx....

shuffle:
16 bit mode;
for(x=0;x!=32;x+=2)
  $103c[x] -= $103c[x+3e];
$C3/E7B7 C2 20       REP #$20                P:...mx....
$C3/E7B9 A2 00 00    LDX #$0000              P:...mx....
$C3/E7BC BF 3C 10 00 LDA $00103C,x           P:...mx....
$C3/E7C0 38          SEC                     P:...mx....
$C3/E7C1 FF 7A 10 00 SBC $00107A,x           P:...mx....
$C3/E7C5 9F 3C 10 00 STA $00103C,x           P:...mx....
$C3/E7C9 E8          INX                     P:...mx....
$C3/E7CA E8          INX                     P:...mx....
$C3/E7CB E0 32 00    CPX #$0032              P:...mx....
$C3/E7CE D0 EC       BNE $EC    [$E7BC]      P:...mx....
for(x=32;x!=70;x+=2)
  $103c[x] -= $103c[x-30];
$C3/E7D0 BF 3C 10 00 LDA $00103C,x           P:...mx....
$C3/E7D4 38          SEC                     P:...mx....
$C3/E7D5 FF 0C 10 00 SBC $00100C,x           P:...mx....
$C3/E7D9 9F 3C 10 00 STA $00103C,x           P:...mx....
$C3/E7DD E8          INX                     P:...mx....
$C3/E7DE E8          INX                     P:...mx....
$C3/E7DF E0 70 00    CPX #$0070              P:...mx....
$C3/E7E2 D0 EC       BNE $EC    [$E7D0]      P:...mx....
8 bit mode;
return;
$C3/E7E4 E2 20       SEP #$20                P:...mx....
$C3/E7E6 60          RTS                     P:...Mx....
Here is a lua script which uses this formula to predict the next few values of the RNG:
emu = snes9x

-- Generate the next N random numbers
function step_rng(state, table)
	state = state+1
	if state >= 0x38 then
		for x = 0, 0x18 do
			table[x] = AND(table[x]-table[x+0x1f],0xffff)
		end
		for x = 0x19, 0x37 do
			table[x] = AND(table[x]-table[x-0x18],0xffff)
		end
		state = 1
	end
	return table[state], state
end

function top_rng(n)
	-- Copy initial rng state
	state = memory.readbyte(0x85)
	tsize = 0x38
	table = {}
	for i = 0, tsize-1 do
		table[i] = memory.readword(0x103c+i*2)
	end
        -- generate the requested number of numbers
	res = {}
	for i = 1, n do
		res[i], state = step_rng(state, table)
	end
	return res
end

gui.register(function()
	nums = top_rng(27)
	for i = 1, #nums do
		gui.text(10,8*i,string.format("%04x",nums[i]))
	end
end)

while true do
	emu.frameadvance()
end
Edit: Small fitx to C code.
Player (100)
Joined: 3/20/2008
Posts: 466
Location: Montreal, Quebec, Canada
Cool, thanks for the info amaurea. That def*4 factor in the damage formula explains why armors, helmets, etc have such low values compared to weapons. Do you happen to know what role any of these stats play? Con Luc Acy Run And again, the most helpful thing right now would be cracking the RNG- both for random encounters and for in-battle stuff such as dizzying the opponent. In my experience crits are surprisingly common in this game, even from brute force guesswork. If I had a way of tracking what frames critical hits would occur, I could probably cut down on the length of boss fights dramatically. What could also be helpful are some lua scripts that address some of the tedious aspects of making this TAS. For instance, a script that pauses the game on the last frame of lag would make inventory management so much easier. Another great one would be something that takes the guesswork out of optimizing movement in towns & dungeons. Edit: Also the damage formulas for various techs.
Player (100)
Joined: 3/20/2008
Posts: 466
Location: Montreal, Quebec, Canada
Completed up to Maxwell Link to video WIP3 smv I’ve managed to prevent any random encounters since being able to buy holy bottles. As a result, I’ve been able to zip through dungeons much faster than expected. Moreover, it seems the average boss battle takes under a minute, regardless of how ill trained and equipped my units are. ------------------------------------------ 3.13- Ifrit, the Fire Elemental Spirit (cont’d) ------------------------------------------- I re-stock on holy bottles, flare bottles and orange gummies in Olive Village. I also buy a white mist so the party can escape battles 30% faster. I did a quick test and the white mist works on anyone, not just Cless, but the effect doesn’t stack, meaning you can’t give everyone a white mist to escape battles 120% faster. On my way to the sorcerer’s ring, I engage in a lot of item management. I use a holy bottle, equip a mystical rune on Arche, use a rune bottle on a ?weapon (becomes ice scimitar), equip said ice scimitar, give Mist the white mist, deactivate arche’s fireball spell and replace it with ice needle. Ifrit battle: frame 258510 This is the third time I’ve found myself sandwiching an enemy between Cless and Klarth as a faster alternative to corner trapping. Even though Klarth doesn’t do any damage with his tome hits, it seems to disrupt the enemies all the same. Also notice the sheer amount of dizzies & critical hits I land. I have two theories about this: One, since Cless is using the ice scimitar, perhaps the water element advantage is giving a crit boost in addition to the obvious double damage. And two, it seems critical damage is far more common when the enemy is in a dizzy state. All the more reason to desire dizzying an enemy! Can’t believe I managed to beat this guy in only 25 seconds! Also of note is the fact that I ran through the entire dungeon without triggering a single random encounter and only used 7 holy bottles. ---------------------------------------- 3.14- Gnome, the Spirit of Earth ---------------------------------------- I made a slight gaff when re-stocking on holy bottles in Alvanista. Didn’t realize you could enter Alvanista from the southwest stairs beside the item, weapon & armory sign. I also make a trip to the adventurer’s guild to get the permission slip to Morlia before taking the boat to gnome. At the beginning of Gnome’s dungeon, I take care of all my item management right away. I use a holy bottle, then a rune bottle on a ?weapon found in Ifrit’s cave, which becomes a thunderclap for Cless. This weapon does more than double the damage the halberd and gungnir do against Gnome. I swap Cless’ duel kick for tiger teeth since duel kick doesn’t actually damage Gnome at all, and is a flat-out a superior skill. Finally, I command Arche to not cast spells in the tactics menu simply because it’s irritating to see her spam ice needle when it won’t hit Gnome 95% of the time. I exit and re-enter the boss room in order to manipulate a better start to the Gnome fight. Gnome battle: frame 276605 I sacrifice Klarth and Arche because doing so allows Cless to level up 5 times and I want him to learn fury slash (lv 31) as soon as possible. Manipulating their deaths is a pain, as it requires a lot of creative timing and positioning to get them hit as much as possible. I even have to adjust Arche’s formation in-battle in order to make things work. Once Cless is alone against Gnome, I have to crit & dizzy him as much as possible, otherwise he’ll become invulnerable before I can manage to defeat him. On one occasion I have to use tiger teeth to achieve a dizzy when a regular hit dizzy took too many frames to manipulate. Improvements: It’s becoming apparent to me that the more boss battles I let Klarth & Arche survive, the harder they become to kill in subsequent boss battles. It leads to this vicious cycle of their convenient survival eating up Cless’ levels. Thus, in the real run, both characters should be killed off as soon as possible, no matter how inconvenient it is at the time. It seems like the basilisk enemies in the desert would be a good place to sacrifice them beforehand. Anyway, all to say that if Cless were alone from the start and I had a Chrono glass, this fight could’ve probably ended in ¼ of the time it took. Though to be honest, the Chrono glass isn’t even that important and should probably be saved for the Neo Dhaos fight. ----------------------------------- 3.12- Undine's Water Cave ----------------------------------- I decide to swap Cless’ Persian boots with an iron rune (10% attack power increase). I should’ve done this to begin with. Undine battle: frame 295235 Best fight of the run so far. The corner traps are really coming along now that I’ve learned a couple spacing tricks. For instance, at the beginning of the fight, the Calamari hits Cless but also happens to cancel his backdash, allowing me to corner Undine immediately. ------------------------------- 3.15- The Moria Gallery ------------------------------- Hmm, it might actually be faster to go Gnome -> Undine -> Ifrit since the boat ride back from Ifrit’s dungeon leads almost directly to Morlia Gallery. Then again, I wouldn’t have the thunderclap for Gnome or Undine, which would make those fights take twice as long. It occurred to me by the third floor that I was burning through holy bottles way too fast, so I choose to walk throughout most of the dungeon. Maxwell battle: frame 335835 Nothing too special to say here. You know the drill: Corner the boss ASAP, keep him in a continual state of dizziness and rail at him in the most efficient way possible. Might be a while until my next update since there’s a lot of plot between now and Ishrantu, the next boss.
creaothceann
He/Him
Editor
Joined: 4/7/2005
Posts: 1874
Location: Germany
Vykan12 wrote:
I made a slight gaff when re-stocking on holy bottles in Alvanista. Didn’t realize you could enter Alvanista from the southwest stairs beside the item, weapon & armory sign. [...] in the real run [...] I should’ve done this to begin with
Does that mean you redo these parts?
Joined: 7/2/2007
Posts: 3960
He's just making a test run for now; the real run will have better item planning and, with luck, a full understanding of the RNG. Though I have to say these boss fights are pretty boss. Looks great, Vykan!
Pyrel - an open-source rewrite of the Angband roguelike game in Python.
Player (100)
Joined: 3/20/2008
Posts: 466
Location: Montreal, Quebec, Canada
Up to the aerial battle this time. Link to video WIP4 smv --------------------------------- 3.16- Looking for Edward --------------------------------- I run out of holy bottles on the way out of Morlia’s gallery. That means I should’ve sprinted less on the first few floors. On my return to Alvanista Castle I buy thunder blade for Arche. Once in Freland, I have Cless equip the ice scimitar since it is effective against the basilisks. I need to fight 5 basilisks in order to gather basilisk eggs for Edward. Basilisk fights: frames 361385, 363835, 365835, 367426, 368978 As you can see, gale shield speeds up the basilisk fights tremendously. I bet if I had allowed Cless to solo every boss battle so far, he would’ve known gale shield after winning the Maxwell fight instead of the 3rd basilisk fight. It seems I missed a mental ring in the third oasis, which could’ve been sold for good money. Ah well, funds aren’t even remotely an issue right now. I re-stock on flare bottles in Olive Village, although it might be better to do this in Treant’s forest. --------------------------------- 3.17 Maze! Treant's Forest --------------------------------- I run out of holy bottles on my way out of Treant’s Forest, but manage to manipulate fights that are quickly escapable using the sorcerer’s ring. --------------------------------- 3.18- The City of Midgard --------------------------------- Nothing worth mentioning. ---------------------------------------- 3.19- The Tower of Twelve Stars ---------------------------------------- Same. Well I do hate this dungeon with a passion. ----------------------------------------------------------------- 3.20- War! The Valhalla Plains and the Aerial Battle ----------------------------------------------------------------- The hitboxes around the enemies are unforgiving so sometimes you have to wait for them to pass even though it appears you should be able to maneuver around them. I intentionally get into a random battle (frame 474034) just before the boss in order to kill off my characters. Fortunately, the Chimera ambush was pretty effective for that. I also have Cless equip the mecha-halberd. Ishrantu fight: frame 475483 Gale shield, how I love you. Aerial battle start: 491589 Since Arche’s spells are a good 6-8x stronger than Cless’ physical attacks as well as multi-targeting, it actually makes sense from a speed perspective to cast spells, especially thunder blade since its animation is so swift. The exception to this is against Charons, who absorb all magic spells. I’m very glad to see Cless has learned fury slash since I suspect it will be very effective against Dhaos.
Twisted_Eye
He/Him
Active player (409)
Joined: 10/17/2005
Posts: 634
Location: Seattle, WA
Those fight videos are very very fun to watch. Keep up what you're doing, whatever it is, it's working!
Post subject: Damage, criticals and random numbers
Former player
Joined: 2/19/2007
Posts: 424
Location: UK
Ok, I've finally tracked down the criticals. For each strike, you get a critical if the low byte of the RNG is less than your crit chance C, which is the sum of the crit stats from all your equipment and is calculated when the battle starts. Each item piece of is described by 35-byte records in a table at 0xc89ba1 (i.e. offset 0x89ba1 in the rom), and the 13th byte in this table is the crit stat. If you know the id of an object, its info starts at 0xc89ba1+(id-1)*35. I have dumped the object table here, though it does not come with object names. Hopefully the other stats of the objects will help you determine which they are. The IDs of Cless' equipment is stored in 7 words (i.e. 2 byte numbers) starting at 0x7e6b0c, in the same order as shown on the equipment screen. The number on the left margin of the object table corresponds to these IDs. When you strike a monster, this happens: 1. if you face the same way as the monster, you will hit. Otherwise, you will hit if rng()&0xff >= evade+agility/4-hit 2. if rng()&0xff < C, it will be a crit 3. Compute damage. Starting from atk which depends on your weapon and attack type (for a normal strike this would just be your attack stat), compute dam = cap(cap(atk-4*def)*mul), where mul is the elemental modifier, as described previously. 4. If rng()>=55000, bonus = dam/8. Otherwise, if rng() >= 45000, bonus = dam/16. Otherwise, bonus = dam/32. Then, dam += bonus. 5. If this is a crit, dam += dam/2 6. dam = cap(dam) So this should show pretty clearly what random numbers are used. It will be between 2 and 4 for this calculation. Note that the low byte of the rng ranges from 0 to 255, so if C = 100, that does not mean that you will get a 100% crit chance, only 39%. And most weapons have much less than that. The one I tested with, Flamberge, had C=15, giving a 5.86% crit chance. Edit: Fixed the hit vs. crit order. Edit2: This script displays the upcoming random numbers as well as your crit chance.
Player (100)
Joined: 3/20/2008
Posts: 466
Location: Montreal, Quebec, Canada
Major update as I’ve gotten all the way to Wolfang. With any luck I’ll be finished the run by tomorrow or the day after. I split the Dhaos fights from the other battles because why not. Link to video Link to video WIP5 smv --------------------------- 3.21- Dhaos' Fortress -------------------------- I have to go all the way back to Olive Village to stock up on holy bottles since Midgard doesn’t sell them. I absolutely love this movement sequence at frame 517645. Evillord fights: frames 524904, 529938, 532385, 546774 After the first fight, I transform the ?weapon I received into the Moon Falux, a holy elemental weapon that’s effective against hellord and his goons. Dhaos as well, incidentally. The second fight isn’t necessary, but I really wanted that hourglass, and the accompanying treasures were quite good regardless. On the last fight I use an elixir since Cless’ hp is critical and taking damage is sometimes advantageous for cancelling attack recoveries. I also whiff an attack intentionally in order to manipulate a faster Arche kill. I run out of holy bottles yet again… Dhaos fight: frame 548973 The Dhaos fights are like half the reason I wanted to TAS this game. I’ve got to say I’m rather pleased with how this turned out. I make Dhaos look like an absolute fool by trapping him in 4 gale shields in a row. ----------------------------------------------------- 3.22- Unicorn! Help us Save the Yggdrasill ----------------------------------------------------- For some reason I have to talk to a woman in Midgard in order for the White Forest cutscene to activate. I should’ve bought an extra pair of jet boots at the very beginning of the game so Mist could dash through this area. Evillord x3 fight: 582232 I use fury slash here for variety’s sake, not sure if it’s actually faster than spamming tiger blade. And once again killing off my characters is more of a challenge than the boss fight itself. Oh, I finally get that hourglass I missed in the mystical forest. How convenient! ---------------------------------------------- 3.23- Thor, the sunken Hi-Tech City ---------------------------------------------- 2SH fight: frame 609091 There’s a lot that happens in an extremely short time frame, so I think it deserves explanation. I start the fight using a chrono glass since the enemies are extremely aggressive and disrupt your attacks before you can even attempt them. Then I have Arche cast indignation because it 1HKOes the 4400Rs. After that Cless re-targets a far-away enemy so he can use lionheart at close range and instantly corner both 2SHes. Then Cless uses a flare bottle, Arche casts a 2nd indignation, and Cless spams blade storm until victory is achieved. Improvements: Somehow I suspect this fight would go a lot faster if Cless knew magma rift (lv 41). Dhaos 2 fight: frame 622091 The priority in this fight is to make Dhaos leap back until he corners himself, then engage in the usual gale shield shenanigans. This time though it’s much harder to land multiple gale shields in a row so I have to use a lot of physical attacks to manipulate his patterns. Trust me, it’s not easy to get Dhaos to stand there doing nothing, it happens maybe 5% of the time. It’s ok that Arche survived as levelling Cless isn’t a priority anymore. The remaining techs he learns from levelling are firebrand (lv45) and focus more (lv50), neither of which are terribly important. ------------------------------------- 3.24- Future Times are Better! ------------------------------------- Ah, my favorite part of the game. Damage figures get really inflated, lots of sidequests, better overworld map music, better spells, techs, and so on. I can’t believe I made it here under 3 hours! For reference, the only real-time run I know of had a time of 6 hours at this point (link). I’ve had a quick look at future bosses and it seems Klarth’s Maxwell summon will be important. Arche will be useful as well since tidal wave is effective against the boss of Odin’s Tower and has a very fast animation. I have no use for Mist since acid rain and haste don’t seem to do anything, so I swap her for Chester. I buy a Damascus and composite bow and stock up on holy bottles before leaving Miguel. Technically, Venezzia sells better weapons, but they take too long to acquire because of the gondola ride. It makes virtually no difference in the Volt fight either since the fastest way to kill him is using gale shield, whose damage is independent of weapon stats. On my way to Venzzia I do a little item management. I swap Chester and Mint, use a holy bottle, equip Cless and Chester’s new weapons and also give Chester a white mist since Mist had it previously. ------------------------------------------- 3.25- Lightning Spirit! Volt's Cave ------------------------------------------- Volt fight: frame 665736 If I weren’t able to 1 round the arurouns with tiger blade, I would’ve swapped that skill with magma rift. Otherwise it’s not worth the time spent switching the skills. Amusingly, Chester gains 9 levels in this fight. On my way back to Euclid I learned you can manipulate NPC positioning using the sorceror’s ring. This will be useful for micro-optimizations in a real run. Now that I have the ability to fly, the game is cracked wide open. I did extensive testing against the next 3 bosses, which yielded the following information: Fangwolf data Flamberge sword: 299-326 Laser blade: 0 Destroyer: 319-329 (crits do 478-522) Flaming sword: 138 Lucky blade: 495-510 Arc wind: 0 Duelist’s sword: 0 Polearm: 546-563 Tidal axe: Heals Flambelk data Tidal wave (spell): 1500 Wave spread (bow): 284 Crescent bow: 0 Vorpal sword: 215-222 Laser blade: 0 Destroyer: 153-167 Ice coffin: 58-64 Lucky blade: 328-338 Arc wind: 0 Duelist’s sword: 0 Polearm: 380-392 Tidal axe: 184-190 Origin data Crescent bow: 780-851 Elven bow: ~1000 Flamberge: 196-202 Vorpal sword: 196-202 Laser blade: Heals Destroyer: 115-126 Lucky blade: 290-299 Arc wind: 352-384 (enemy drop in Fenrir’s cavern, not worth it) Duelist’s sword: 145-158 Polearm: 342-352 Tidal axe: 166-171 Conclusions: The polearm is the best choice in all 3 of these bossfights and elemental weapons overwhelmingly suck against them. Other observations: -Focus more doubles Cless’ damage output, whereas a flare bottle only increases it by 50%. Unfortunately the bonuses don’t stack. -Fury slash and magma rift are by far my best short range techs. Firebrand is completely useless while soul wave doesn’t damage Wolfang or Origin. -Cless is badly out-damaging my other units. A souped up fury slash crit can do as much as 7800ish damage, whereas Chester and my casters do 1000-2000 damage at best. -I don’t think raising Chester is worthwhile because he’ll only be useful against Dhaos 3 and Neo-Dhaos with the berserker bow, and there’s absolutely no way I’m going to Lower Morlia for that. Similarly, Klarth’s best summon is Origin while Arche’s best spell is meteor storm. Meteor storm’s animation is incredibly long and only does 2500 damage, so we can rule that out. Now going by this video, Origin does ~2200 damage with a reasonably fast animation, but the player’s Klarth is lv 64, so my Klarth is going to do significantly less damage. Tl;dr: The entire future will be a Cless solo basically. I’m going to do Fenrir’s cave before Odin’s tower because Flambelk is a harder boss and soul wave + vorpal sword might be useful in the 4 forced encounters in Odin’s tower (5 if you count acquiring a salamander’s ring).
Joined: 7/2/2007
Posts: 3960
Can't you get two-shot bows in the ice and fire dungeons? Or is the problem that Neo-Dhaos absorbs ice/fire elements? Regarding Klarth's Maxwell summon, while it's ordinarily very good I suspect it'll suffer from the same problem you mention regarding his Origin summon: if he's underlevelled then it may not do enough damage to compete. if both Klarth and Chester aren't worth using, then they should be killed off ASAP if only to avoid having to page through "Chester leveled up!" messages at the end of fights. For the test run obviously not such a big deal, but they could be killed off against Volt by adjusting the party's formation. In the second Dhaos fight, is it at all worthwhile enabling Fireball or Ice Needle on Arche? Why is she alive, anyway?
Pyrel - an open-source rewrite of the Angband roguelike game in Python.