Editor, Expert player (2330)
Joined: 5/15/2007
Posts: 3933
Location: Germany
(Combined WRAM) $02065A = Current Room Edit, die and continue to go to a new room.
Editor, Reviewer, Skilled player (1359)
Joined: 9/12/2016
Posts: 1646
Location: Italy
The data of the enemy objects seems to be stored dynamically, which makes it a pain to track down their HP addresses. So have here a lua script that does this for you automatically and displays the enemy HP on screen: Download DBAA.lua
Language: lua

-- GBA Dragon Ball: Advanced Adventure enemy HP display v1.0 by ThunderAxe31 local camera_x_pos_addr = 0x029EE8 local camera_y_pos_addr = 0x029EEC local enemy_pointers_addr = 0x027E00 local enemy_obj_HP_offset = 0xB0 local enemy_obj_x_pos_offset = 0x1D local enemy_obj_y_pos_offset = 0x21 local enemies_limit = 10 memory.usememorydomain("EWRAM") while true do local camera_x = memory.read_u24_le(camera_x_pos_addr) local camera_y = memory.read_u24_le(camera_y_pos_addr) for i = 0, enemies_limit do local enemy_obj_addr = memory.read_u32_le(0x027E00 + i*4) if enemy_obj_addr == 0 then break else enemy_obj_addr=enemy_obj_addr - 0x02000000 end local enemy_HP = memory.read_s16_le(enemy_obj_addr + enemy_obj_HP_offset) if enemy_HP > 0 then local enemy_x = memory.read_u24_le(enemy_obj_addr + enemy_obj_x_pos_offset) local enemy_y = memory.read_u24_le(enemy_obj_addr + enemy_obj_y_pos_offset) gui.pixelText(enemy_x - camera_x, enemy_y - camera_y, enemy_HP) end end emu.frameadvance() end
my personal page - my YouTube channel - my GitHub - my Discord: thunderaxe31 <Masterjun> if you look at the "NES" in a weird angle, it actually clearly says "GBA"
Skilled player (1022)
Joined: 1/9/2011
Posts: 231
ThunderAxe31 and I have just begun work on this TAS. Here's the wip for MUGG to join in on the fun http://tasvideos.org/userfiles/info/44030952697828135 -Edit- MUGG is already proving himself, and he isn't even here, yet. Just read his post (from 10 years ago) about being able to hold the flying kick all the way to the ground. Time saved :)
Challenger
He/Him
Skilled player (1689)
Joined: 2/23/2016
Posts: 1061
WarHippy wrote:
ThunderAxe31 and I have just begun work on this TAS. Here's the wip for MUGG to join in on the fun http://tasvideos.org/userfiles/info/44030952697828135
Woah! Finally someone TASing this game! Good luck, ThunderAxe31 and WarHippy. EDIT: This run doesn't sync on the most recent versions, but synched fine on BizHawk 1.12.2 (I have this emulator version)!
My homepage --Currently not much motived for TASing as before...-- But I'm still working.
Editor, Expert player (2330)
Joined: 5/15/2007
Posts: 3933
Location: Germany
Yay!
  • Downkick at the beginning slope saves 1~3 frames.
  • When landing from a downkick, let go of pressing right to preserve some speed. Holding right: 928→768 Preserving speed: 928→864→800→768
  • You accelerate faster in the air, so after the beginning LR rush, do a running jump.
  • RNG affects enemy spawn locations(?), enemy actions and damage dealt/received. RNG is advanced by these: ○ Enemy starts a new action (change movement, attack) ○ You start an attack ○ Enemy hits you ○ You hit an enemy ○ LR rush
--- $046C50 (Combined WRAM) (2bytes) = RNG? $0205CC (Combined WRAM) (2bytes) = xspeed $0205C4 (Combined WRAM) (4bytes) = xpos I don't know if these are dynamic. --- I think Bizhawk 2.x should be used if possible (mGBA 0.6). --- I saved 3 frames up to the start of the first fight. http://tasvideos.org/userfiles/info/44066406842318028 (Bizhawk 2.x) I don't know if RNG is optimal.
Post subject: Same movies, spaced 30 minutes apart
Editor, Experienced player (853)
Joined: 5/2/2015
Posts: 696
Location: France
Divekicks are faster than running, but only if you can sustain the divekick long enough to make up for the 6 frame windup. Thankfully jumping does not slow Goku down once he runs, so we can jump as high as we can, then divekick, and this will be faster as long as the terrain under Goku is low enough from the terrain he jumps off to make up the frames. I saved 4 frames before the first fight doing this: http://tasvideos.org/userfiles/info/44066904840703641 --- EDIT: Rather surprisingly, I did the exact same thing as MUGG.. who submitted this movie with the same frame amount 30 minutes before mine: http://tasvideos.org/userfiles/info/44066406842318028 --- EDIT: Well, since we're at it, and now that I actually have adresses, I might as well beat MUGG. Doing a 23 frame jump is better. 248 208 168.. (21) 312 248 208.. (22) 312 272 248 208 168.. (23) 312 272 232 192 152.. (24) There are a few mechanics to note here; this happens because when you release A, the game slows down Goku's jump, which correlates which sharply dropping off speed: Goku's Y speed is set at 248. Indeed, when you drop A with low jumps (for example, holding A for 6 frames): (952 248 208..). Why does it not happen when held_A_duration > 23? Simply because 22 is the maximum jump duration. Since A is held for > 23 frames, for the game, it is as if you never released A, so the 248 set never happens. This may not seem like much, but you'ill notice that the way speed is applied to Goku is based off this speed. So, "starting" the after-jump with a Y speed of 248 will mean the next frames will have a Y speed a little higher, than if Goku has 232 speed. Be very careful with divekicks and lag! In some occasions, even though the divekick works and the speed adress is properly updated, Goku's X position is not updated for 1 frame during the divekicks, which effectively makes you lose a frame. (The frame is not marked as lag in the emu, though I suspect it to be.) I didn't notice this and wondered why I lost so much subpixels over MUGG, until I compared my second divekick with his. Delaying the divekick a bit worked. As such, I saved 128 subpixels over MUGG. Movie: http://tasvideos.org/userfiles/info/44067894425415590 --- To finish, here's a file with 17 frames of improvement up to the start of the second fight (synced for Bizhawk 2.2.1): http://tasvideos.org/userfiles/info/44073066059345383 The first fight is just copy-pasted, I tried to improve it a bit but it was already very well optimised. The only change is the jump at the end which is made so that the second divekick is more towards the edge of the screen. After that, one long divekick to gain some frames. I could have made one long divekick or two slightly shorter ones, but the long one ended up faster by a frame (probably because of the 6 frame windup.)
Skilled player (1022)
Joined: 1/9/2011
Posts: 231
MUGG wrote:
[*] When landing from a downkick, let go of pressing right to preserve some speed. Holding right: 928→768 Preserving speed: 928→864→800→768
I think this only works when you don't hit an enemy with a dive kick
MUGG wrote:
[*] RNG affects enemy spawn locations(?)
Yes, but only a few of the enemies can be manipulated with it
MUGG wrote:
I think Bizhawk 2.x should be used if possible (mGBA 0.6).
I had a lot of issues with 2.0, but I just tried out 2.2.1 and it seems to have cleared everything up, so I'm good to use mGBA 0.6 now. Still working on trying to get the second fight finished, but on frame 2095 the enemy spawns from the left side instead of the right side. I haven't found a good way to get it to change. http://tasvideos.org/userfiles/info/44073605584227896 -Edit- Got past the second fight with losing only 2 frames. I skipped the second divekick down the slope before the first fight (1 frame lost), and then did a slightly worse divekick than xy2_'s right before the second fight (1 frame lost). http://tasvideos.org/userfiles/info/44081303871256447 Also would like to figure out how jumping affects Goku's x-position. Just a simple jump before the second fight causes it to desync. I assume it's sub-pixel nonsense, but I would need someone to show me how to look at that.
Editor, Expert player (2330)
Joined: 5/15/2007
Posts: 3933
Location: Germany
2nd exclamation mark at frame 1750 I continued xy2_'s file (the one that he says saved 128 xpos over mine).
Post subject: Subpixels 2: Electric Boogaloo
Editor, Experienced player (853)
Joined: 5/2/2015
Posts: 696
Location: France
A simple script, able to be extended: right now I just added X and Y speed and pos at the bottom. http://tasvideos.org/userfiles/info/44092704218140697 --- On jumping, since this wasn't properly explained in the previous post: here are the different speeds for how much you hold A. Summary: holding A for 23 frames is best (you can see why easily.) https://files.catbox.moe/g1z5zl.png ---
I assume it's sub-pixel nonsense
Yeah, it is! The reason is simple: when Goku hits the ground, the subpixel carry on the Y pos is kept. So, even though two distinct Y positions can have the same pixel value (and both be considered on ground), they can have different subpixel values. Since this is carried over to the next jump, a bigger subpixel carry will ultimately mean a pixel difference when jumping (and a desync.) Here's an example; these are the two Y positions for Goku at the bridge before the second fight, on ground, taken from MUGG's movie and mine. Mugg has 110512, and I have 110344. If you divide these two values by 256, you get 431,6875 and 431,03125 respectively. Notice in both cases, the non-decimal value is the same for both (431) but the decimal value is different (.6875 for MUGG, .03125 for mine.) If a jump is initiated, you can see that the jump will go higher (in some cases even a pixel higher) Why do jumps modify this, and thus "cause desyncs"? Simply because the total height change in subpixels upon landing on the ground is not a multiple of 256, and so the subpixel carry changes. It turns out we have two dimensions to optimise now; both x and y position. Right now we want an Y position as high as possible (so we can do longer divekicks); this means optimising for the highest Y carry. As noted, the easiest way to influence this is simply by jumping - different height will lead to different carry changes as well. All of this is not too easy to optimise, because even if we enter a fight with a good carry, the jumpkicks and divekicks done during fights will modify it.* --- And with some further optimisation, I finally saved a frame: http://tasvideos.org/userfiles/info/44113140486002433 This is probably the last one that's able to be gotten out of this segment. I gained the last subpixels by optimising the pterodactyl jump further (so we stayed in the air at 512 speed a little less). Note that I changed the direction of the upwards kick, but this is only visual.
Editor, Expert player (2330)
Joined: 5/15/2007
Posts: 3933
Location: Germany
http://tasvideos.org/userfiles/info/44154534917594887 Fadeout after the 2nd fight, at frame 2229. I noticed you can fadeout 1 frame earlier by using LR rush, apparently it's hitbox magic or something... Edit: Same with running attack.
Skilled player (1022)
Joined: 1/9/2011
Posts: 231
MUGG wrote:
http://tasvideos.org/userfiles/info/44154534917594887 Fadeout after the 2nd fight, at frame 2229. I noticed you can fadeout 1 frame earlier by using LR rush, apparently it's hitbox magic or something... Edit: Same with running attack.
These also trigger the yellow exclamation marks 1 frame earlier
Post subject: Y subpixel carry
Editor, Experienced player (853)
Joined: 5/2/2015
Posts: 696
Location: France
A kind of summary post regarding the Y carry trick. I will be using the notation pixel:subpixel for position, to illustrate how this works. Before starting, it's important to note that the Y vector is reversed: Goku's Y position goes lower as his height increases. So, a value of 0:32 is actually "lower" than a position of 0:16; the latter is higher. The effective subpixel density of this game is 8 (even though it measures 256 subpixels) because there aren't any moves we've found that displace Goku less than a multiple of 8 subpixels per frame. But because this is only a theory, I will keep the 256 subpixel notation. (Why is a pixel 256 subpixels? It's the size of a byte.) When landing on the ground, Goku keeps his subpixel value. This is because the game only checks for the pixel value to see if Goku lands. Both the positions 30:48 and 30:248 are considered on ground, even though 30:48 is 200 subpixels higher than 30:248. At first, runs would desync seemingly for no reason, until we found this behavior. What if we could turn this behavior to our advantage? Spoiler: we can. Wait a second! How can we gain more X position, even though the X position doesn't even change thanks to this bug? We could gain an extra frame of divekicking, if we could move high enough to gain an extra frame, would be comparable to a frame saving - or at least a high amount of subpixels. This is because we can be, say, 24 subpixels away from getting an extra divekick frame - and Y subpixel optimisation pushes it over the edge. This trick I've gotten used to call the Y subpixel carry trick - and the value we optimise, the Y subpixel, is the carry. In some other situations, it would be beneficial to fall as quickly as possible, because of attack canceling (Goku stops his attack on hitting the ground.) Here it would be actually better to optimise for a low carry - a carry too high will work against us and put us in the air for an extra frame. (In reality this applies only in rare situations; the divekick part is the main one.) Seems complicated, right? It is, kind of, but we can use lua scripts to make it better. In particular, since speed is always the same on jumps, jumpkicks, and divekicks (the three actions that influence carry) we can actually predict them in theory! All the parameters that matter are: * how long the player holds A (determines jump height) * when does Goku touch the ground, if he does so before terminal velocity (terminal velocity is a multiple of 256 and thus does not affect Y subpixels) * if Goku jumpkicks * if Goku divekicks The first two are tightly coupled together. The second and third, take precedence (since thankfully, Goku's Y speed gets set to a constant on a jumpkick and divekick.) As such, I've made a table for the most complicated part, jumping. You can find it at https://github.com/xy2iii/dbaa_lua/blob/master/data/Subpixel%20Table.ods . Only the first and last table are really useful, the other two are just to demonstrate how I did it. I will add jumpkick/divekick later. In particular, the last table is what we use to predict how much carry changes. Take the initial carry, then do the jump and landing. For example, if we jump for one frame and land at frame 30, then the carry difference would be 104. Finally, we substract this from the initial carry value: an initial Y pos of 30:112 would become 30:8 at the end of the jump; and an initial Y pos of 30:16 would become 30:160 (modulo 256)."
Post subject: DBAA: WIP 1/7
Editor, Experienced player (853)
Joined: 5/2/2015
Posts: 696
Location: France
Four skilled TASers group up and TAS the first level of this game; myself, WarHippy, ThunderAxe31 and MUGG. This is a full 32 seconds faster than AnotherGamer's old TAS and is faster than all the first level TASes on youtube. The rerecord count is at 30000 atm (three times as much as AnotherGamer's entire TAS) and the movie file can be found here: tasvideos.org/userfiles/info/44972743131009961 Link to video By no means is this our last pass at this level - we will still be trying to improve it over time, especially because RNG in this game makes hex-editing impossible. However, this pass was ok enough to show. Because of this, we are taking our time and making sure each level is perfect before moving on, so do not expect frequent releases. As usual, feedback appreciated, and do not hestitate to suggest new approaches to things we might have missed, even if it seems dumb.
Challenger
He/Him
Skilled player (1689)
Joined: 2/23/2016
Posts: 1061
32 seconds saved is trully impressive! Keep it up!
My homepage --Currently not much motived for TASing as before...-- But I'm still working.
Alyosha
He/Him
Editor, Emulator Coder, Expert player (3822)
Joined: 11/30/2014
Posts: 2832
Location: US
My goodness y'all sure are throwing a lot of firepower at this one. The results are impressive so far but I hope you don't get burned out.
Active player (261)
Joined: 12/13/2016
Posts: 352
This sure is impressive!
Editor, Experienced player (853)
Joined: 5/2/2015
Posts: 696
Location: France
A small status update; two months later, progress is going well. As a scale of our work, we hit nearly 50000 rerecords, finished Goku's House (first main level) saving quite a few more frames, and are working on Pilaf's Castle atm. After this level, there are only five platforming level left (and a bunch of VS fights.) This is another important platforming level that will probably take a bit more time. Here is the current movie. Pilaf has a bunch of cool tricks in addition to us finally being able to showcase the (many) walljumping tricks; we will post an encode once the level is done.
Skilled player (1022)
Joined: 1/9/2011
Posts: 231
Progress is still happening on this game. Now up through Pilaf's Castle.
Challenger
He/Him
Skilled player (1689)
Joined: 2/23/2016
Posts: 1061
When you collected that capsule (which increases your "KI"), I noted that the message wasn't exited earlier (you can press "A" button after a few seconds - because this has occurred with other capsules on published run). Anyway, great work again with insane optimizations!
My homepage --Currently not much motived for TASing as before...-- But I'm still working.
Skilled player (1022)
Joined: 1/9/2011
Posts: 231
Nice catch! 85 frames saved.
Skilled player (1022)
Joined: 1/9/2011
Posts: 231
Gokou versus Klilyn. And some others, I guess. I wish those were typos. bk2 file http://tasvideos.org/userfiles/info/48147382444843705 Edit: Apparently I didn't spend enough time on the VS fights. Just found a new strat that saved 47, 71, 220 frames on the first fight alone. I'll add a new video once all three fights are completely done.
Skilled player (1022)
Joined: 1/9/2011
Posts: 231
.bk2 file Completely redid the fights. Apparently launching the enemies into the air is way slower than ground combos even though I have to wait for Goku to go back to a nuetral position more often. The sooner I was able to get the enemy to jump the faster I could deal damage to them since I can do more hits during an air combo, and the shield doesn't regenerate between the combos. Having the enemy airborne also creates the best angle for firing the energy shot to get the maximum damage. In total I saved 636 frames over the 3 fights from the previous wip.
Editor, Expert player (2330)
Joined: 5/15/2007
Posts: 3933
Location: Germany
Very nice work! The grounded battles are a nice timesaver
Challenger
He/Him
Skilled player (1689)
Joined: 2/23/2016
Posts: 1061
Very nice work with the other levels! The great amount of optimization (including "Klilyn" boss, on the forest), puts the published run a lot of outdated in terms of optimization (like the other remaining runs of "The First 500"). Also the vs fights looks more entertaining than before. Keep it up this impressive work guys. :)
My homepage --Currently not much motived for TASing as before...-- But I'm still working.
Skilled player (1022)
Joined: 1/9/2011
Posts: 231
Thanks for the cheers! It really does make the slow work feel worthwhile. I've also updated the encode. For some reason I had uploaded the .avi dump instead of the muxed version.