Time to figure out the formula behind assigning bonus items at the end of the stage. Info:
Item ID order may have something to do with it. But does that even exist, and if so, what is it?
From debug menu:
1. Shuriken
2. Smoke Bomb
3. Calltrops
4. Bomb
5. Mine
6. Healing Potion
7. Hook (yes)
8. Gun (Echigoya’s weapon)
9. Bow (enemy weapon)
10. Fire spit by enemy
11. Poison Rice
12. Shadow Decoy
13. Colored Rice
14. Super Shuriken
15. Dog Bone
I’m tired, both of these lists probably don’t help.
Number of steps can vary from 7 to 13 or whatever with everything else being the same.
Not sure if we have more info on it.
They're numvers I get at black screen end stage
About at score result, here:
stage 2: 1023226948 (both my run not same end timer but have same numver RNG), 3461622061 (Hâthor)
Stage 3: 723997587, 953175654
1023226948 → 2762887397 (9); 1 Shuriken, 1 Mine, 3 Lightfoot Scroll
3461622061 → 192419425 (12); 1 Healing Potion, 1 Mine, 3 Lightfoot Scroll
723997587 → 1081994110 (19); 1 Grenade, 1 Poison Rice, 3 Lightfoot Scroll
953175654 → 4179151291 (13); 1 Calltrops, 1 Smoke Bomb, 3 Lightfoot Scroll
Doesn’t look very promising. I think our best bet is making a bruteforcing Lua to find a good RN and then try to manipulate it as fast as possible.
Since we can’t figure out the formula behind assigning items I thought it would’ve been a good idea to dump every single RN that gives 3 LFS. Turns out it would take about 3 years to compute lmao.
Anyway in the current condition the Lua should be pretty useful to just find the quickest RN from a given situation, tomorrow I guess I’ll test that and work out the final specifics then I may try finishing stage 1 properly. We still need to test the Grenade vs. Katanal strategy though…
As said, the code above is in the PSX bios (more precisely scph1001), so it could be used by many other PSX games.
Translated for easier understanding:
def rng(seed):
seed = (((1103515245 * seed) mod 2^32) + 12345) mod 2^32
val = rounddown(seed / 1024) mod 2^15
return (val, seed)
This just opened my mind. This matches the Tenchu RNG, and plus it gives an extra value which could be used for things such as determining extra items at the end of the stage. I’m gonna investigate.
Edit: investigation fruitless. ;_; There’s probably still 1 missing piece from all of this, which is the number of steps it does when determining items. We still don’t understand the formula behind it; if we knew and incorporated the “val” somewhere maybe we could predict which items you get. Edit: I think I’ve proved that “val” isn’t what determines the number of steps, though, as 1496 gave both 9 and 7 steps.
Edit2: 1496 gave 2 Grenades, 1 Grenade and 0 Grenades… so it doesn’t seem like 1 val = 1 item either.
Edit3: the vals always repeat, so it doesn’t seem like they can affect any randomness… :/
5643686
28353, 11675, 31509, 10071, 21938, 5710, 25786, 32466, 5231, 29284,
39198118
28353, 11675, 31509, 10071, 21938, 5710, 25786, 32466, 5231, 29284,
72752550
28353, 11675, 31509, 10071, 21938, 5710, 25786, 32466, 5231, 29284,
Edit3: the vals always repeat, so it doesn’t seem like they can affect any randomness… :/
The values repeat every 2^25 (that is, 33554432) calls to rng(), and seeds (like the ones you give) that differ by multiples of 2^25 are equivalent (give the same sequence of values). Neither of these facts mean that this isn't where the "randomness" (pseudo-randomness) in the game comes from.
(I don't know anything about Tenchu, or anything relevant about PSX; I'm just looking at the Python code.)
I would suspect that the items you get would be determined by a combination of "val" from the rng(), your rank, and which level you're on; is that still possible, or have your tests ruled that out?
I would suspect that the items you get would be determined by a combination of "val" from the rng(), your rank, and which level you're on; is that still possible, or have your tests ruled that out?
Rather than “val”, the seed seems to have a lot more to do with it. Items are rank-dependant, doesn’t matter which level, and I’m of course testing everything while getting the same rank.
With seed having more to do with it I mean that seeds 5643686, 39198118, and 72752550 give different items, yet have the same “val” cycle.
Their amount of steps advanced when determining bonus items differ:
5643686 → 1838344415 (9)
39198118 → 3679897913 (7)
72752550 → 844708734 (8)
Edit: hmm this seed has the same # of steps and gives very similar items as the one above:
790038400 → 1073123057 (9)
Comparison of my item total:
884534571
884532681
What I had before:
884332570
2 frames saved going to Start. 3 frames choosing Rikimaru. 4 frames ahead starting the level. Now to see how lag reacts and whether the movie syncs or not…
Black screen after stage 1 screen: old: 2689/748 new: 2687/748 ends up only saving 2 frames for some reason, lol. I noticed those menu loads seem to work in 30fps sometimes… for example pressing X 1 frame faster would save 2 frames in the end. This time it was in reverse, saving 4 only gave 2… idk. Edit: 2686/748 by purposefully losing a frame at the Start press, whelp.
Saved 3 frames in the menus, everything synced. :) http://tasvideos.org/userfiles/info/18269789872301701
Meaning we should be getting Echigoya death at the very least on 8501. But since Up+Select should save 2 frames, 8499 would be correct.
Edit: Saved a fuck ton on Katanal. 6239 death cutscene. That’s 12 frames. Better last 2 hits. /// 6227. 24f. I feel like it should be possible to squeeze in 2 more frames but I can’t do it. Probably even more improvable by redoing the whole thing rather than just the last 2 hits, but now it’s pretty good so I don’t think I’ll bother trying.
The old (good) after Katanal and Echigoya fight doesn’t seem to sync. I’ll look into it more another time.
8475 Echigoya death predicted at this point.
http://tasvideos.org/userfiles/info/23129487615744280
The old (good) after Katanal and Echigoya fight doesn’t seem to sync. I’ll look into it more another time.
Oh shit… Made a weird, annoying discovery. The path of the hook item (and now that I think about it probably the Shuriken too) is determined by RNG. Everything syncs perfectly up until the hook is shot, and the only difference is RNG.
http://i.imgur.com/aENIE4f.jpg
This means that despite the RNG being reset at the start of each level, this game isn’t hex-friendly at all… Fuck.
Current RNG is making me land 2 frames later after the hook shot. The difference in position is extremely minimal, but still affects it.
Edit: Tried a different RNG on Katanal and the second to last hit or so desynced, haha. Damn this game.
Since I went ahead and did the calcs I’ll just dump them here as well:
106 106 106 139 139 118 112 119 122 142 139 119 (repeat) = 1467
16 ..265 123 114 111 117 131 176 197 189 192 187 (jump) = 1818
Running vs. dashing speed, the biggest boost in dashing comes at the end so doing dashes as big as possible seems best. Continuation of that dash with a jump:
83 250 96 79 59 65 61 79 78 73 91 104 128 192 277 340 333 301 183 and then some more numbers, so here again the big boost comes after a while.
Edit2: No worries, found out the old hook shot was absolutely terrible. Makes you wonder why so many TASes used this terrible shot… It’s the human strategy and horribly slow for TAS.
Found out that pressing Attack/Jump during a hook/shuriken throwing it cancels the throw.
Edit3: Omg running against walls gives you a speed boost it seems. Not sure whether it’s actually helpful when considering trajectory though. Edit: Correction, only against wall corners, and it seems to be helpful.
Wow, TASing this game is hard. Speeds and collisions make no sense. I’m a bad TASer.
8437 Echigoya death now. New hook shot saved ≈ 30f, Select + Up 2f, better running optimization(?) ≈ 6f, for a total of 38 frames saved compared to the old prediction (8475 → 8437). No frames lost at Echigoya. 46″ in-game time, now 11″ faster than Hathor’s TAS, lol.
Took me 1463 rerecords and a bunch of hours. Still not done. Latter part of running to Echigoya should still be improvable 2–6 frames. Will try next time. Wish I was better at TASing.
http://tasvideos.org/userfiles/info/23227925003734882
Edit: Oh yeah I tried a bunch of ways to manipulate the camera after Katanal for the hook shot, but the normal way ended up being best. Actually having camera RAM addresses would be helpful. Also tried hooking my way out of the roof, but it’s slightly slower even if you consider a perfect landing (which I wasn’t able to get anyway).
LOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL I CAN’T BELIEVE THIS GAME.
http://i.imgur.com/pF3jitd.jpg
I’M INSIDE THE WALL
http://i.imgur.com/grPjO2j.jpg
SO FAR IN THAT THE DOORS OPEN TO THE OTHER SIDE LOLLLLLLLLLLLLLLLLLLLLLLLLLLLL.
And still only saved 4 frames with all that optimization. :(
Edit: Way too tired right now, I feel like 2 more frames are saveable but I think I’m done with the first stage now. Would take too much effort to save those 2 frames and I probably wouldn’t be able to anyway.
Synced everything, Echigoya death 8433 (4 frames save): http://tasvideos.org/userfiles/info/23336620125877012 Used ≈ 600 rerecords, but I spent hours testing speed stuff outside of TASing.
Edit: Now that I think about it it might be possible to improve the entering of the roof with similar wall-glitching movement. I don’t think the exiting can be improved.
Edit: Wall glitching not possible there. Tried a bunch of different ways to do the dashjump into the hole, but they all tied, lol.
I can’t see anything more to improve in the first stage, so now I’m trying to test the Katanal Grenade strategy. Stage 1 loading makes no sense.
Top is current (no Grenade). First value is frame I press Start; then frame the first level loads (black screen); difference to first one; how soon I press Start; lag frames
2203 2686 (736 -> 748 lag)
2205 2707 21 first frame 736 -> 747
2206 2708 22 second frame 736 -> 747
2207 2692 6 third frame 736 -> 748
2208 2691 5 fourth frame 736 -> 748 — best one
2209 2711 25 fifth frame 736 -> 747
2210 2695 9 sixth frame 736 -> 748
2211 2713 27 sevent frame 736 -> 747
2212 2695 9 eighth frame 736 -> 748
2213 2696 10 ninth frame 736 -> 748
2214 2716 30 tenth frame 736 -> 747
2215 2700 14 eleventh frame 736 -> 748
Stopped there because I’m sure it’s not getting faster.
As you can see depending on the timing with which you press Start to start the level, load times will differ for some reason. All I can see is that more lag gives better results. Also that delaying the input by 3 frames is faster, lol how stupid. Of note: do not rely on visuals when picking items, the game lags behind a lot and doesn’t draw everything at top speed. Just string together the fastest possible input, and regardless of what’s shown on screen, you’re likely to have actually picked every item. Edit: Now that I think about it, the different load times are almost certainly due to the 3 different possible layouts…
For whatever reason I’m getting 0 lag at Katanal with the Grenade… From 1035 to 748, but there is 0 difference in frames… what the hell lol.
Attack damages.
A 7 A 11 A 20
UDA 20
RA 8 LA 16
LA 10 RA 25
JA 16
UUA 13
R1A 25
I’m sure 1 Grenade for Katanal is faster, but I can’t figure out a strategy. Trading like I mentioned a year ago seems terrible, getting slashed loses a lot of time; unless there’s a faster way to trade I forgot about. Problem also is that Katanal goes flying after being hit by the Grenade, so I have to wait for him to hit the ground or I can’t combo properly. Maybe using the Grenade at the end is faster. Also if we could get godlike manipulation, maybe using Shuriken here would be faster too.
5818 6227 Katanal frames for reference (no Grenade).
Thank you.
Edit: Tried grenading Katanal after the loops, it’s suuuuper slow (like 100 frames slower). So I guess grenading at the start is the only option.
Oh my god. =_=
I either changed my way of TASing it or forgot about it, but you can buffer attack inputs before you gain control to execute them on the first frame of control instead of having to execute the whole input combo from control start. Long story short, my last Katanal attack was 4 frames slower than it could’ve been, so now Katanal is dead at 6223 (was 6227). Funny thing is that for the rest of the attacks I was buffering the inputs already, I just forgot about the technique or something when I improved the last 2 hits a few days ago.
Jesus Christ I hope this syncs…
Holy shit, the run to Echigoya syncs even though it’s off by 3 X and Z units. Somehow Y (vertical) isn’t different… Problem is that the Shuriken at Echigoya desync now.
Edit: To not forget: should explore the buffering more, see if UDRA works or something.
Edit2: Synced Echigoya by delaying the dashjump 1 frame, it put the RNG 1 step behind in the sequence without losing any frames and luckily that RNG worked. 8429 Echigoya death now (4f improved).
I think Echigoya can be improved 2 frames with better RNG.
1109667057 (32)
1833298500 (3)
2763045363 (3)
Misses 1st and 3rd?
1109667057 (32)
578732246 (1)
2071860322 (4)
2763045363 (1)
2094622384 (1)
Misses second, this is the one I used to sync Echigoya (2f slower 2nd hit).
2545098357 (36)
1846136330 (1)
3165648507 (1)
3525811352 (1)
1109667057 (1)
3393027927 (2)
Hits two, misses last (too high). This was done with running a lot and having a short dash.
Then I went further back to the Up+Select dashjump and changed the timing to change the RNG. New fantastic technique: dashes and dashjumps are great for RNG manipulation, because the timing literally doesn’t matter shit in terms of speed. Even though the speed oscillation is gigantic, no matter when you do them you’ll end up in the same position on the same frame, with the only thing different being the RNG. So I abused that and saved 4 frames at Echigoya (death at 8425). I don’t even know why, the RNG didn’t even look good and I thought I would only save 2 frames (since I use the Shuriken 2 frames earlier). Gonna have to investigate why I saved 4 frames and if better RNG can save 2 more.
old:
7623 Echigoya cutscene
8278 DR
8283 DR+T
8329 UR
8331 UR+T
8377 T
8384 Shuriken icon disappears
8421, 8427 sound of hit, damage
new:
7623 Echigoya cutscene
8278 DR
8283 DR+T
8329 T
8375 T
8382 Shuriken icon disappears
8417, 8423 sound of hit, damage
I guess the RNG gave me a better last hit by 2 frames even though it doesn’t look like it…
Edit: Yeah now that I look at it, the Shuriken is going a lot more straightforward now, before it went with a curve. I wonder if better RNG could save time elsewhere, like for example the hook shot after Katanal.
Still 46″ IGT. http://tasvideos.org/userfiles/info/23424827930886380
Edit: Since I went and compared, might as well post here:
X Z Y model angle
2917 -1272 -7577 126
2915 -1271 -7577 126
Old (4f slower) and new (after the RNG manipulation). So it does change by like 3 values total, but it’s not enough to affect sync even on the long run. Edit: Actually that might be the improvement that changed it and not the RNG manipulation.
http://www.thecerebralbore.com/2012/06/tenchu-stealth-assassins-ps1.html
Perhaps to its detriment, the game combines Resident Evil-style tank controls in a fully 3D environment with no manual camera control, to create the perfect storm of shitty control schemes. Indeed, Tenchu is one of those early 3D games where you spend more time fighting the controls than the enemy.
Bizarrely, the game does make use of the vibration function on the Dual Shock controller, but not the analog! This makes little sense, as the PS1 had an analogue controller before the Dual Shock iteration added force feedback into the mix. Surely a stealth game, where you can slightly incline the sticks to sneak makes perfect sense! And would ideally have been a step up from the control scheme they shipped with.
EDIT:
i was actually looking for a list of games with analog support,but that's all i found
if someone could find it,would be good for other psx tasers.
TAS i'm interested:
Megaman series, specially the RPGs! Where is the mmbn1 all chips TAS we deserve? Where is the Command Mission TAS?
i'm slowly moving away from TASing fighting games for speed, maybe it's time to start finding some entertainment value in TASing.