Guest User

120 TAS TTC Syncing Info

a guest
Apr 18th, 2025
646
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.24 KB | Gaming | 0 0
  1. Most TTC stars now utilize a squish cancel hyperspeed strat to get up the clock quickly. This involved BLJing on exposed ceiling, bonking on exposed ceiling from the pendulum then getting a squish cancel the next frame to end up with positive hyperspeed in idle.
  2.  
  3. The main issue is that the conditions to achieve this strat can only happen on random setting, and if/when they appear is dependent on RNG. To be able to perform this strat multiple times in a row in the 120 TAS we need to be able to RNG manip the squish cancel setup from the pendulum, as well as any subsequent RNG to reach wherever we want to hswk to.
  4.  
  5.  
  6. -- START PENDULUM --
  7. The initial swing when we enter on random is fixed. The two subsequent swings are random. The pendulum can either swing fast or slow - to get the squish cancel we need the first random swing to be fast (1/3) and the second to be slow (2/3). Additionally, the pendulum may pause between swings. It is 50/50 if there is delay, and if there is, the delay is randomly chosen from 5-35f. Unfortunately, we cannot reach the squish cancel spot fast enough with no delay both times, so we need to take at least one random delay, but since the range of delay times is so wide, the probability of a short delay is quite small.
  8.  
  9. This puts the probability of getting an optimal setup between 1 in 10 to 1 in 100 depending on how short of a delay we allow. Remember that this is only for the hyperspeed setup, other things after this will depend on RNG, and once we are in hyperspeed there is very little we can do to manipulate RNG further. As such, we need to get as much manipulation in as possible before the BLJ.
  10.  
  11.  
  12. -- MANIPULATING RNG --
  13. We can manipulate RNG via dusting. When walking with under 16hspd, we can choose whether we create dust particles depending on the joystick magnitude while we walk. Creating dust advances RNG 4 times, so we can step the RNG index in multiples of 4. We have plenty of opportunity to manipulate RNG before we first reach TTC, so we will have a wide range of RNG options for the first random star, however after that we will have limited ability to manipulate RNG between each star.
  14.  
  15. We can change how we exit the previous star to get a different RNG on re-entry. Ideally since TTC has a lot of objects calling RNG different amounts, changing what frame we exit could let us land on a different RNG index mod 4, letting us access more RNG possibilities we wouldn't get from dusting; however this obviously will lose time. We can do dust manip during the few frames of slow walking during re-entry as well, giving us some more RNG options.
  16.  
  17.  
  18. -- SQUISH CANCEL SETUP SCATTERSHOT VARIANTS --
  19. The most interesting way to manip RNG is to do it during the BLJ setup. This means dusting on different frames while keeping fast movement to the BLJ spot. This can be more powerful than doing dusting outside TTC, as in TTC there are objects constantly calling RNG. This means that if we dust one frame later than some other method, as RNG was different on that one frame, if an object called RNG there then it may reach a different state and thus call RNG differently later, leading to a butterfly effect which causes RNG to diverge later. This means that when we dust can often cause different RNG/object states even if we're advancing RNG the same amount overall.
  20.  
  21. The movement we do to the BLJ spot depends on how much delay the first random swing has. To generate different movement options with different RNG manipulation options, I created a scattershot search that assumed some specific delay on the first swing and then searches for different movement to the BLJ spot. We create a mask of what frames we dust on, as well as what frames we can optionally dust on via low/high mag slow walking and then split searched state points based on some small number of bits from the hash of these masks (more bits = wider search space). I used this to generate 1600 RNG variants for the start assuming no delay on the first swing (however most lot of these are 10+ frames slower than optimal).
  22.  
  23. Once we have these variants, we can test them all on the RNG indices we have access to when entering TTC and see which sync up. For most RNG indices we can get several solutions with at most 6 frames lost, however there are gaps of sequential RNG indices with no solutions that could cause problems. This is mainly where the first swing ends up being bad, as the first random swing happens very early on, so we don't have a lot of control over RNG that early.
  24.  
  25. To speed up the scattershot search, the camera is turned off. As joystick input angles depend on the camera angle, this means that the joystick inputs desync without using a script to hack the camera and set the pendulum swing to be what we assumed on the search, however I have an automatic resyncing script to resync the joystick based on the actual camera movement, which picks the nearest relative joystick angle and then bruteforces inaccuracies from limitations in joystick angles (particularly deadzones).
  26.  
  27.  
  28. -- HSWK SCATTERSHOT ROUTES --
  29. Once we have the setups, we need to hswk up the clock. As we climb the clock, we will end up hitting many random objects, most importantly we usually wk/jump off the rotating cogs directly above the starting area. As the angle of these cogs is random, and we often interact with many other randomly moving objects such as moving bars, clock hands, elevator platforms etc, this means that the clock climb becomes different for pretty much every RNG seed. As such, we can't expect to be able to resync a pre-planned route when syncing the 120 TAS, we will need to redo the clock climbs to each star from scratch on whatever RNG we end up with.
  30.  
  31. To do this, we need an optimized scattershot search for finding hswks routes up the clock that can accurately simulate all the random objects in TTC. We cannot bake the random movement of the objects in TTC as we can affect RNG during the climb. The starting area has 2 bob-ombs that randomly blink only when we are within 4000 units of them, so when we exit that radii can change RNG. In addition, some routes can hit yellow coins as we climb, and the sparkles from the coin collection also advance RNG. As such, the scattershot simulation will need to contain the logic for all objects that call RNG and include the dynamic tris for randomly moving objects, without hurting performance too much.
  32.  
  33. As these searches need to be done during the syncing phase, it is important we make the HSWK scattershot search as optimized as possible, as we will be limited by time when creating the full 120 TAS, and we will want the search to produce the best routes possible in the short time we will have.
  34.  
  35.  
  36. -- DYNAMIC TRIS --
  37. Moving object tris are created by checking if we are within the object’s tangibility radius, and if so, it builds the object tris based on the object's position and rotation and inserts them into the dynamic surface partition. We don't want to waste time building these tris each frame, so we pre-build all the object tris based on what positions and rotations they are able to reach, and them simply insert the pre-built tris into the dynamic tri partition each frame.
  38.  
  39. For rotating objects such as pendulums and cogs, we store the tris for all possible rotations of these objects (4096 cases). For the pendulums, we can limit this to the small range they swing through. For moving objects such as the elevators that simply cycle through different positions, we can just build the tris at the heights they move through. The rotating blocks are trickier as they do a small bounce before each rotation, so we need to build tris for both the vertical offsets of the bounce and the rotations of the blocks.
  40.  
  41. The moving bars have more complicated horizontal movement; however the movement works on a fixed cycle. The position of the bars is dependent on the bar offset, which throughout all cycles has 99 possibilities. We can simply hash the float representing the bar offset and then build tris according to each offset, inserting them into the dynamic surface partition based on the offset hash.
  42.  
  43.  
  44. -- STATIC TRIS --
  45. Tri collision in SM64 is done via a horizontal 16x16 grid of cells. The game checks which cell we are in, and then does surface checks on a linked list of all surfaces in that cell. The first issue is that some of these surfaces in the list aren't in the cell, as the game will add the surface to the cell if the rectangle bounding the triangle overlaps the cell. We can manually remove tris that aren't in the cell, accounting for floor/ceil units and wall extensions that might put the true hitbox inside the cell.
  46.  
  47. The larger issue is that TTC is a vertical stage, so these cells end up containing lots of surface triangles we don't need to consider. We can correct this by building optimized surface lists depending on different height ranges inside each cell, then simply swapping the head pointer of the linked list to the corresponding vertical partition for the cells we are in/near at the start of the frame.
  48.  
  49. We first include all surfaces that are inside the vertical range of our y partition. Since we will move up/down during the frame, we extend the y bounds we include to account for the maximum positive/negative y-vel we could have, as well as the vertical hitbox extensions for walls (-30u to -150u), floors (-78u) and ceilings (-160u).
  50.  
  51. We now need to add floors/ceilings below the partition. Since we are only doing hswks, which floor/ceil we reference doesn't matter so long as they exist for each unit. To do this we need to first check which ceilings leak into the bottom of the vertical partition. If a ceiling below the partition is capped by a floor below the partition, we can ignore it. We can then add the smallest subset of those ceilings which cover all the exposed ceiling units to our partition. After that, we check all units for floors below the partition, ignoring those that are underneath one of the added ceilings, and then add the smallest subset of those that cover the whole cell to the partition.
  52.  
  53. Since this involves doing surface checks for every horizontal unit, I pre-computed these optimized vertical surface partitions with a CUDA script. This optimization ended up increasing the scattershot sim speed by 2-2.5x.
  54.  
  55. Alternatively, libsm64 can be modified to optimize surface checks, which from what I understand is the approach Krithalith uses. This allows for more flexibility in optimization, but makes it harder to distribute the code.
  56.  
  57.  
  58. -- SEARCH SPACE OPTIMIZATION --
  59. Since the stage is very large, we need to reduce the number of states that scattershot considers during the search. I limited the search to only focus on hyperspeed and limit the actions to WK actions and jump/double jump actions. The y position is bounded by time, so it will stop searching routes that climb the clock too slowly.
  60.  
  61. So we don't have to time all the wall kicks, the simulation is hacked such that A being held per frame is equivalent to A being pressed every frame. This means we can force the sim to press A on the air hit wall action, and it will always wall kick. We can resync this later by removing any A press the frame before. If we end up pressing A 2 frames in a row, we add a penalty of 3f for pause buffering, and then have the resyncing script add a pause buffer in this case.
  62.  
  63. Usually, we don't want to slow down too much during the HSWKs. Slowing down can be useful at the start when we have so much hspd we clip through walls, but once we are below 400hspd, I limit the search to only use angles relatively forward of the current facing direction. The amount of time we can spend falling is also limited. This could potentially lead to us missing some solutions but makes the search more efficient.
  64.  
  65.  
  66. -- END --
  67. With these tools and setups, we should be able to create TTC TASes using the hyperspeed strat with reasonable RNG manipulation. I expect we will probably lose 5-10f per star to what the theoretical best RNG could give, but I think this time loss is acceptable.
  68.  
  69. Re-entry into TTC lets us enter on random, however when entering the first time from WMotR we enter on fast. As such, one star will be unable to use this strat as it can only be done on random. This will most likely be get a hand, as it is 5.07 without the hyperspeed strat and 4.90 with it, only losing 5 frames, which optimistically is about how much we lose per setup of the squish cancel strat anyway.
Advertisement
Add Comment
Please, Sign In to add comment