toca
He/Him
Player (51)
Location: 🇪🇺 Europe
Joined: 6/27/2017
Posts: 31
Location: 🇪🇺 Europe
Dimon12321 wrote:
toca wrote:
filled with technicalities (lol)
Looks like I got lost in there lol xD
Haha fair enough, I'll be the first to admit my post is quite dense :D As usual, if you have any questions please just ask! (or if you only want to watch the WIPs to track the progress, that's also perfectly fine of course)
Dimon12321 wrote:
toca wrote:
  1. Get the extra Ingram in level 6 to underflow at the end of level 6 Cons: detour for Ingram, underflowing at the end of level 6 loses time, timeloss from one additional weapon switch, have to waste 50 ammo (25 shots) somewhere to make the underflow at the end of level 10 work
Don't enemies drop a Ingram, so you would pick up one along the way?
In principle you're right, and I do pick up two Ingrams in the first 5 levels. But the point I was trying to make is that I'm forced to start level 6 with no weapons (story reasons) meaning all Ingrams I picked up before are gone (for that level only). Therefore the only way to underflow in level 6 is to pick up an Ingram in level 6 itself. But none of the enemies that I encounter naturally in level 6 have an Ingram, which is why I'd have to take a ~2.5s detour to get one there.
Post subject: AdvancedBot
RetroEdit
Any
Editor, Reviewer, Player (172)
Joined: 8/8/2019
Posts: 172
Hi, I was wondering if you'd consider posting the code for AdvancedBot somewhere (maybe to a code forge like GitHub). I'm sort of interested in this concept.
Post subject: advancedbot github
toca
He/Him
Player (51)
Location: 🇪🇺 Europe
Joined: 6/27/2017
Posts: 31
Location: 🇪🇺 Europe
RetroEdit wrote:
Hi, I was wondering if you'd consider posting the code for AdvancedBot somewhere (maybe to a code forge like GitHub). I'm sort of interested in this concept.
I originally planned on doing this eventuallyTM, unless someone asked about it; so here you go: https://github.com/toca-1/advancedbot-bizhawk but beware that for now this is GBA-only because that's what I wrote it for (and I have no experience with other platforms in Bizhawk). Also, in the original script, the address to watch was hardcoded (because it was dynamic so I needed pointer logic), but for now I added a field where an address can be entered. If anyone wants to make any changes to it or port it to other platforms please feel free to!
toca
He/Him
Player (51)
Location: 🇪🇺 Europe
Joined: 6/27/2017
Posts: 31
Location: 🇪🇺 Europe
Link to video and bk2 file Spent today improving level 2, and managed to save 41 frames over my version-1 TAS! The door clip was decent; I had to shoot one more box than in v1 because I couldn't make the manip work without it (2 crates in room M2, and 2 crates in M3). The overall timeloss from this RAM manipulation is comparable to version 1, but in my opinion this door clip here looks a bit cleaner because of the optimal path in room M3. Other things to note are:
  • Saved 11 frames in the first room, 4 of which are lag frames, probably because I shot the fire tank as early as possible so the front enemy died asap
  • Rooms 2, 3, and 4 combined are 10 frames faster than my v1 TAS
  • In the final room I saved 20 frames somehow? It doesn't look like it's lag, but I couldn't tell you where this much timesave could come from (at least not without doing a frame-by-frame comparison)
The only other thing that comes to mind is that I'm paying more attention to Max's HP this time around. Especially for rooms with many enemies, being low on HP severely limits possible routes and, worst case, force me to use bullet time to not get hit by a shot (which of course loses time even if I have to activate it for just a few frames). The first time around I thought that the mechanic where Max automatically heals to 80 (out of 255) HP would be good enough—and for the most part that's true—but sometimes 80 HP just aren't enough. As such, I'll also work more with painkillers which is the reason I created the previously mentioned sheet where I documented all painkillers that are viable to get. Edit: I guess I could mention that my re-record count increased from 46611 to 55358 thanks to AdvancedBot, although level 2 is only ~2000 frames long. Using linear extrapolation this would mean that we'll end up with 200k-300k re-records which would be a rerecords-per-movie-length ratio of ~3-4
RetroEdit
Any
Editor, Reviewer, Player (172)
Joined: 8/8/2019
Posts: 172
toca wrote:
RetroEdit wrote:
Hi, I was wondering if you'd consider posting the code for AdvancedBot somewhere (maybe to a code forge like GitHub). I'm sort of interested in this concept.
I originally planned on doing this eventuallyTM, unless someone asked about it; so here you go: https://github.com/toca-1/advancedbot-bizhawk but beware that for now this is GBA-only because that's what I wrote it for (and I have no experience with other platforms in Bizhawk). Also, in the original script, the address to watch was hardcoded (because it was dynamic so I needed pointer logic), but for now I added a field where an address can be entered. If anyone wants to make any changes to it or port it to other platforms please feel free to!
And with a license as well. Wonderful! I'll check it out and let you know if I end up using or have any improvements.
Post subject: wip: level 3
toca
He/Him
Player (51)
Location: 🇪🇺 Europe
Joined: 6/27/2017
Posts: 31
Location: 🇪🇺 Europe
Link to video and bk2 file Yesterday I finished level 3, and it ended up being 159 (!) frames faster than level 3 in v1 of my TAS. Let me go over some of the timesave in more detail:
  • Already the first room is 39 frames faster, for two main reasons:
    1. 19 frames from not switching to the sawed off when I get it here (as explained in my weapon route post). This is overall worth it as it outweighs the 11 lost frames from still having the Pump Action equipped (fully occurs in room M8, 0:26 video time) & because delaying the weapon switch to the end of the level makes it "free" (see end of this list)
    2. walking towards where the sawed off will drop while in combat (this is one of the few times where holding shoot with a shotgun is faster because it allows to constantly aim for the enemy, and because I don't have to maximize distance here)
  • The thing I mentioned about HP in my previous post immediately led to a better route for room M13 (47s video time): use the painkiller on the elevator so I can take more bullets before exiting the room. This saves 8 frames and 1 ammo, which outweighs the 2 frames I'll lose in level 4 to getting a backup painkiller. Also delaying the painkiller to the next rooms wouldn't have helped because the shotgun guys do 90 damage here which I'd need multiple painkiller to stomach
  • This one is embarrassing... I saved 13 frames in room M18 (58s video time) simply because in v1 I... skipped the textboxes 13 frames too late lol
  • And now the big one: 49 frames of timesave from the weapon route change of picking up & using the Ingram at the end of the level (in addition to 23 frames from not underflowing at the end of the level as I did in v1). While picking up the Ingram initially loses a few frames (extra kill in M20), it immediately makes up for it in the second-to-last room using by saving 52 frames on the fighting. What is important for this timesave is that both weapon switches that come with this route change are free: the first one at the start of room M21 happens when I have to wait for the boss to become vulnerable, and the switch back to the Sawed Off happens at the end of the level when I have to wait for the final enemies to spawn.
Finally, AdvancedBot continues to be very useful as it saves a few frames in each room from optimizing the door exits. In fact, this resulted in already breaking the 100k re-records (currently: 100757), mainly because I found a way to more than double the search speed: ... simply minimize TAStudio during the search, which does make optimizing larger windows (up to ~100 frames) viable Link to video
Post subject: WIP level 4
toca
He/Him
Player (51)
Location: 🇪🇺 Europe
Joined: 6/27/2017
Posts: 31
Location: 🇪🇺 Europe
Link to video and bk2 file Level 4 done, 145 frames faster than level 4 in v1 of my TAS. First things first, I have to correct a mistake—or rather a misjudgement—I made a few days ago, when I wrote:
toca wrote:
[...] we'll end up with 200k-300k re-records which would be a rerecords-per-movie-length ratio of ~3-4
After level 4, we are already at 206k re-records (resulting in a rerecords-per-movie-length ratio of ~10). The reason for this is that the optimization problems in the first two levels were relatively mild & that in level 4 they really spiked, leading to said unexpected increase. That, and I found some ways to get the search speed up from 200-300 FPS to 700-800 FPS, meaning the range of feasible problems to brute-force slightly increased. I'm not sure whether this ratio of 10 will persist until the end, but what I'm sure of is that I shouldn't make predictions about re-records anymore and instead just see how things evolve :P Back to the TAS itself. Here are some of the highlights of this segment:
  • Rooms M5 & M6 (16s video time): a combined 23 frames—as well as 2 ammo—saved by finding "pacifist" routes; same for later rooms, like M14 where that saved 24 frames. At first I thought that losing HP this early on would lose time eventually because I could take less bullets in later levels, but there's basically no way to get to the second half without going beyond the auto-heal threshold of 80 HP, and the later enemies do so much damage (90 or some even 110HP if I recall correctly) with their shotguns anyway that preserving HP here wouldn't change anything.
  • Room M10 (32s video time): the first enemy willingly jumping down the pit is already funny, but boosting off of him to save 17 frames in this room is even better. I tried a lot of different timings and versions here (you can also just walking into him and use him as a platform, but that makes you first wait and then stagger so unfortunately that's slower) and this boost/this particular timing of the jump was the best I could find
  • Room M11 (37s video time): In v1 I had to shoot once to not get hit, and I (or rather, AdvancedBot) was able to find many configurations where I could dodge that lethal sawed off shot. Like that you'd expect saving just ~7 frames (timeloss of shooting once at full speed), but this room ended up being 24 (!) frames faster than v1 thanks to the optimized room exit/jump out of the window, and on such a relatively simple room no less
  • Room D4 (55s video time): As described in the weapon route explanation I need to pick up an additional Ingram here to have the Dual Ingram for level 5. Picking up the weapon here loses 23 frames, and is therefore well worth it given that I'll save 3-4 seconds at the end of level 5. And if you're wondering, the weird left-right movement I do at the start of the room is to manipulate the enemy on the right (who drops the Ingram) into jumping towards the exit so the weapon detour is as short as possible
Overall, v2 saved 403 frames total over v1 so far, which is also crazy because all the big timesave is yet to come: levels 7, 8, and mainly 11 because of the weapon route mistakes in v1
Post subject: WIP level 5
toca
He/Him
Player (51)
Location: 🇪🇺 Europe
Joined: 6/27/2017
Posts: 31
Location: 🇪🇺 Europe
Link to video and bk2 file Level 5 done, 315k re-records, and the big timesave cashed in on (212 frames from having the Dual Ingram for the final room, cf. below). Overall this level is 333 frames faster than in v1 of the TAS, bringing the total timesave so far up to 736 frames (=12.3s). And as you may have noticed if you watched the video: I wrote a script which displays the level/room at the bottom in yellow so any notes of mine are easier to follow. Now to the bigger timesaves:
  • Room M4 (9s video time): The timesave of 24 frames is not as interesting as the reason for that very timesave: in v1 I only started killing enemies once I walked around the corner, but I failed to see that you can shoot them as soon as the room starts (over the counter), as well. In fact, killing all three enemies in this room ended up 1 frame faster than killing just the first two (as done in v1) because of the many additional lag frames. Which is also nice because that way I also don't lose any HP in this room which is crucial for:
  • Room M4 (2nd pass) (44s video time): In v1 I had to dodge a shot because of my low HP whereas here I could just tank it (also I timed my turn differently). This, together with letting AdvancedBot optimize the ending led to cutting a third from this room in terms of time: from previously 188 to now just 134 frames
  • Rooms M6-M9 (52s video time): Alright this is the big one: as planned in my weapon route summary I switch from the Sawed Off to the Dual Ingram after the kill in room M6 (this weapon switch loses 14f), resulting in saving 11 frames in M7, 6 frames in M8, and, most importantly, 212 frames in M9 (the final room) For that final fight, bullet time saves a lot of time because it reduces a ton of lag (from having 4 enemies on screen) and thus the weapon cooldown expires a lot quicker than it would with all the lag around. Because the enemies are all rather strong, even optimally I need 13 Dual Ingram shots; if I hold A all the way, then I need 15 shots because two of them miss. One of those misses I can salvage by adding a 2-frame delay, but the first miss I cannot avoid (because I'd have to add a delay that's longer than the weapon cooldown, so it's just faster to let that miss happen). All of this—together with minimizing movement and optimizing when to stop the bullet time—leads to the aforementioned timesave of 212 frames in that one fight alone
Dimon12321
He/Him
Editor, Reviewer, Experienced player (616)
🇷🇴 Romania
Joined: 4/5/2014
Posts: 1325
Location: 🇷🇴 Romania
Elimination of Jack Lupino. PG-13 version xD
TASing is like making a film: only the best takes are shown in the final movie.
Post subject: WIP level 6 -- halfway point
toca
He/Him
Player (51)
Location: 🇪🇺 Europe
Joined: 6/27/2017
Posts: 31
Location: 🇪🇺 Europe
Dimon12321 wrote:
Elimination of Jack Lupino. PG-13 version xD
LOL good one :D
Link to video and bk2 file Despite being so short, this Level 6 laid the groundwork for the entire second half of the run: for the ammo route I have to pick up an extra Ingram in Room B2 (else I cannot underflow the Ingram ammo at the end of the level), which loses 148 frames compared to v1 of the TAS. Of course, I will make this time back later by 1. having a full Dual Ingram for level 7, and 2. cutting all detours for extra Ingram ammo—as detailed also in my weapon route post. Thus it may come as a surprise that—despite the relatively big detour—this new version of level 6 is only 30 frames slower than version 1 of the TAS. Here are the reasons for this positive discrepancy:
  • Room M2 (2s video time): I managed to save 17 frames here by not killing the first enemy. This was always viable in theory because in TAS I don't need the M9 that first enemy drops, but in practice the problem was that running away would aggro him which, in turn, aggro'd all other enemies. So the timesave from not killing him melted away immediately because in the next room I could not do the stealth kill anymore. However, as I played around with it more I realized that this is not the full story. While, yes, it is true that running past the first guy immediately does aggro him and ruins the next room, waiting for just a few frames before moving delays "activating" him; so much in fact that, while he still fires at me twice, that's not enough of a ruckus to alarm the other enemies.
  • End of room M3 (10s video time): While the route through this room is largely the same, I saved 22 frames by not switching to the M4 right when I pick it up. Instead, I switch the weapon in the room right after because that's a scripted elevator ride (I only have to press the button as early as possible, after that it's ~3s of waiting where I can switch to the M4 for free)
  • Rooms M9-M11 (37s video time): I saved 78 frames here, which is a mix of timesaves & timelosses from the weapon route. First, the fight in room M9 I finish 30 frames faster than in v1 because back then I had to use bullet time, whereas this time around I found inputs where the enemy on the right misses me so often that I can just ignore him. Then at the end of the room the underflow preparation begins: first I switch to the Ingram and shoot once (+18f), and then I shoot again at the end of room M10 (+1f), but I save 5 frames in that room because I no longer have to pick up the shotgun ammo. Now I have the perfect amount of Ingram ammo to underflow at the end of M11 (this underflow loses roughly 20 frames), yet doing the boss fight with the Ingram saves ~80 frames over using the M4 (which I had to use in v1)
All this is to say that the timeloss in this level from the weapon route change was a lot milder than I expected, which further affirms my decision to go with the Ingram route (instead of picking up tons of Ingram ammo later)
Post subject: WIP level 7 / 12
toca
He/Him
Player (51)
Location: 🇪🇺 Europe
Joined: 6/27/2017
Posts: 31
Location: 🇪🇺 Europe
Link to video and bk2 file Clocking in at a casual 522k re-records, I am finally done with level 7. I knew I'd be saving time in this level by using the Dual Ingram instead of the Sawed Off—with my initial prediction being a timesave of 123 frames—but for reasons I'll describe below, in the end I saved a whopping 298 frames (!) over v1 of my TAS. Which is even crazier to think about when converting this into: "I saved 5s off a ~1 minute level" (and that 1 minute was already the previous TAS time). One general thing to note about level 7 is that, while HP management was important before, this is the first level where it is crucial. For example, I deliberately lost 3 frames in 7-M5 to save 133HP which in turn saved me many more frames later on. This is also the reason why the re-record count jumped by such a large amount: 1. I had to test many rooms a lot more than usual because now time and HP were important parameters, and 2. I had to test routes spanning multiple rooms to find how outcomes of certain rooms impact later rooms. With that said, here's the highlights:
  • Room M3 (8s video time): Because I no longer need the Ingram in this room (actually, it would lose time to get it in this route because I'd have to waste that extra ammo later for the final underflow) I could search for ways to clear the room without killing any enemy. And indeed, I—or rather AdvancedBot—found a handful of such paths through the room. The best one it found was not only 19 frames faster than the best route where I killed 1 enemy, it also ended the room with 89 more HP! Compared to v1 of the TAS this no-kill route saved 18 frames.
  • Room B1 (14s video time): The first of three bossfights. Having the Dual Ingram here saved 65 frames over the old Sawed-Off route. The route you see in the video uses no slowmo (didn't find any advantage from the resulting lag-frame reduction), but it does 4 frames of diagonal inputs which are crucial for manipulating the enemies to come out of hiding faster. Similarly, Room B2 saves 64 frames, and boss 3 (Room M13) saves 55 frames over v1.
  • Room M9 (38s video time): The extra painkiller I picked up in level 4 in exchange for 2 frames really paid off here. I took it right before entering this room, which allowed me to get through here without killing anybody (I tried the same without using a painkiller but my bot found no working path in that case). Overall this saved 27 frames.
  • Room M12 (45s video time): What's interesting about this room is not the route, but rather the fact that it is a prime example of how little sense lag frames make in this game. If you looked at the input file you'd see that I hold "A" 2 frames longer than I have to to kill both enemies here. However, without these two extra frames I get through the room in 201 frames, whereas with these "unnecessary" inputs I exit the room after just 190 (!) frames. Again, let me stress that these extra inputs do not affect gameplay at all (if anything, they make me slower because I run at 50% capped speed for 2 more frames), but for whatever reason they result in 11 less lag frames
  • Room M14 (51s video time): Actually, the previously mentioned 55 saved frames in M13 would actually be 72 frames, but I have to switch the weapon before entering M14. However, I save 56 frames at the end of this level because v1 of the TAS had to underflow here (and did so rather slowly) so that's a good trade-off
Post subject: WIP level 8 / 12
toca
He/Him
Player (51)
Location: 🇪🇺 Europe
Joined: 6/27/2017
Posts: 31
Location: 🇪🇺 Europe
Link to video and bk2 file Another day, another level where I managed to save 327 frames. Now this one is a bit of a special case because half of that timesave comes from just one room: In v1 of the TAS I had to pick up an extra Ingram in Room C2 which lost 163 frames as it is one of the slowest Ingrams to get; and this time around I already have all the Ingrams I need so I can just exit right away. Now for the other notable timesaves in this level:
  • Room M1 (10s video time): Right at the beginning I saved 14 frames by cancelling the forced weapon animation (indicated by the 1 frame of weapon menu appearing on screen; blink and you'll miss it!)
  • Room M12 (49s video time): More timesave by omission. In v1 I had to break a box in this room and grab an extra painkiller for the upcoming damage boost, but it turns out that if you plan ahead you don't have to take such detours, resulting in 39 saved frames.
  • Room M20 (1m32s video time): 38 saved frames from finding a way to exit the room without having to kill the bottom enemy. Thanks, AdvancedBot!
  • Room M23, second half (1m49s video time): Overall I save 20 frames in this room, but this timesave has two aspects to it:
    1. I saved 36 frames from optimizing the room exit. The condition for the fade-out to happen is kind of weird; it seems to be related to be in a moving state while being close enough to the exit. So what I do is move in parallel to the door for the briefest time while shooting the last enemy, which leads to the aforementioned timesave. I did test a number of paths but many of them ended on frame 38855 and I couldn't get below that, so I took the liberty to conclude that this is how far this particular mechanic can be optimized
    2. As a result of the whole weapon route I have to waste 54 Ingram ammo between level 7 and level 10, else I cannot underflow the Ingram at the end of level 10 & the ammo for level 11 does not work out (and there is no viable way around this constraint). Anyway, right here is the one spot where (a) I have the Dual Ingram out, (b) my inputs aren't locked, and (c) I have to wait for an event: the time between calling the elevator and the door opening & the two enemies spawning. While the time is just slightly too short—it allows me to waste only 44 ammo instead of 54—this is still very worth it as all these shots lost only 16 frames (as opposed to other spots where this loses ~40-50f). Overall this makes the double-underflow route ~2-3s faster than if I had picked up all the Ingram ammo I need along the way
One strat I tried to implement but which I didn't get to work is the door clip in rooms M19 and M20. I theorized about those in my posts about door clipping (1, 2). These two clips would save ~11 and ~5 seconds, respectively, but they were less likely to be possible for multiple reasons. First, unlike in level 2 there is less manipulation potential here as there are no boxes right before the room where the clips happen. Second, and more importantly, the door clip in M19 needs the uninitialized byte in the box section of RAM to have a value of 0x02 (instead of 0x01, like in level 2) which is just less likely statistically (compared to the more likely bool values 0 and 1). All this is to say, while these door clips are theoretically possible, practically I could not get them to work because testing them is a lot more difficult than in level 2 (which itself is already hard to get to work, but the testing space here is much much larger. And it also doesn't help that the uninitialized byte jumps around in memory so targeted manipulation is impossible either way. Hence all I can do is test random things and hope they work which, for these two clips, they unfortunately didn't...)
Post subject: WIP level 9 & 10 / 12
toca
He/Him
Player (51)
Location: 🇪🇺 Europe
Joined: 6/27/2017
Posts: 31
Location: 🇪🇺 Europe
Link to video and bk2 file Level 9 done, 94 frames saved. With the exception of four quick fights, this level is mostly a walking simulator; the upside of this is that it allowed me make extensive use of AdvancedBot here, while the "downside" is that it was clear from the beginning that I'd save less time here than in the previous levels (also because this level is not affected by the new weapon route in any way). As such, the list of notable rooms is shorter than in my previous posts.
  • Room M2 (4s video time): 35 frames saved because I don't have to switch weapons here (I was able to do that at the end of the last level "for free" when I had to wait for the elevator)
  • Room M3 (8s video time): 21 frames saved from optimizing the fight
  • Room M11 (1m23s video time): In v1 I needed one painkiller in this room to damage boost through the mines. And while there are three viable painkillers to get in this level, they all require some enemy manipulation (and thus timeloss, if just a few frames)—so when I got to this room I was curious how much this damage boost even saves. And it turns out that strat... is slower. Shooting the mine normally and exiting after it explodes save 13 frames (bonus points for it not requiring a painkiller either). The reason I didn't test this back in v1 is that the damage boost is the RTA strat because it is safer/more consistent. And only here in v2 did the thought "wait, how much does this even save?" occur to me lol

Edit: Instead of making a new post for level 10, seeing how the two levels are quite similar in terms of what changed, I decided to merge them into one post Link to video and bk2 file In total I saved 44 frames here: 79 frames of pure timesave minus 35 frames of timeloss from having to underflow at the end so the ammo route for levels 11 and 12 works out. Details:
  • Room M1 (start): Through small changes like delaying the turn at the start, or manipulating the second enemy into missing me, I gradually got the timesave up to 26 frames. Through similar delays I also saved 21f in room M2
  • Room A1 (42s video time): I have to delay killing the second enemy because I cannot pick up the Ingram ammo he drops. Coincidentally, this seems to be faster; overall I saved 12f in this room
  • Room M11 (54s video time): Without the underflow, the fastest I was able to finish this room was 1f faster than in v1 (interestingly, the room inputs from v1—adjusted for lag—are 2f slower than what I got here). However, underflowing cost me 35 frames in this room (but doing so is necessary & will save me a lot of time at the end of level 11 because in v1 I ran out of Ingram ammo there)
Also you may have noticed that I shot a handful of times right before exiting a room. The reason for this is also the underflow: because the elevator wait time at the end of level 8 was too short I have to waste an additional 6 Dual Ingram shots (12 ammo) in this level for the underflow to work out. This is best done on a room exit (because letting go of the shoot button sets your speed to 0) where it loses only ~1f each, so the ammo waste in this level cost me another 6f

1761690257