Eggsplode!

Eggsplode! is a power pad game that came on a combo cart with Short Order. Step on the bombs that the naughty fox has placed before they Eggsplode!

Game objectives

  • Emulator used: Bizhawk 2.4
  • Beat stage 6 (60 bombs)
When I first picked this game up and started looking at the win condition it looked like 0x4B was the stage counter and it looked like the game would soft lock after 255 stages. After putting more time into it however I discovered that 0x4B is the number of foxes on the stage. There is no actual level counter, the number of bombs in the stage (0x4D) starts at 10 and increases by 10 each stage up to 60. The other difficulty parameters are derived from this. Stage 6 has 60 bombs and is the most difficult. This 6th stage with 60 bombs repeats indefinitely. It was a bit hard to test because they stored the score directly in the nametable, but the score just wraps if you max it out and it doesn't break anything.

Controls

  • 1-12 stomp on the corresponding bomb

RNG

The RNG (0x55) in this game is pretty well done. The function that advances the rng does 0x55 RNG next = (previous << 2) + previous + 0x11, but this is not just called every frame, it is also called in the wait loop at the end of each frame. Since the outcome after each from depends on how much other code executes that frame this means it is difficult to manipulate the RNG for a specific value, but easy to influence it. Just pressing some buttons influences the execution, even if you aren't actually hitting anything. This is used frequently to try to spawn the bombs as quickly as possible.

Strategy

From a tas perspective once you've influenced the RNG the game becomes trivial, just press the button corresponding to the bomb location. This is done through the 6 stages (210 bombs total)

Unused Game elements

There are a couple of things not seen in this run, namely that the character that holds the sign can walk across instead of the fox and no bombs will be planted during this time. This mechanic is not useful and easily avoidable
Also the chickens can lay eggs which you can see at the end when stage 7 plays itself out. If you crack an egg you lose a bird (life). The game is over if you lose 2 lives or a bomb explodes.

Improvements

  • You have to wait for the bomb crumble animation anyway, but I tried to make the wait time between animations as small as possible. In some cases all of the foxes are between bombs and it takes a few frames for one to come in range. It may be possible to spawn in a different order in some places to reduce this slightly, or possibly allow multiple bombs to spawn before crushing them. I think there could be a few frames shaved by spending a bunch of time messing with it, but probably not too many.

Thanks to:

  • The TASMania team

Screenshots:

13, 700, 9786, 11023

Blaze's comments

I discovered that the input end can be extremely early in this game. The game uses a queue system that can hold up to 255 inputs, and while you're crumbling a bomb, it doesn't deplete. Thanks to link for finding the RAM addresses for the queue array and the queue size.
I ended up saving 1101 frames off the end of level 6 by filling the queue nearly to max and getting lucky enough for the bombs to be planted fast enough that the queue didn't run out too soon.

ThunderAxe31: Judging.
ThunderAxe31: File replaced with a 1102 frames improvement.
ThunderAxe31: Even after deeper researches, it seems to me that beyond stage 6 there is no increase of difficulty in any form. So I consider this movie to be complete.
Execution seems good, but gameplay resulted aesthetically plain, and the audience reactions were overall not nearly enough welcoming.
Accepting for Vault.
feos: Pub.
feos: The manual doesn't have ! when spelling the game name, even tho in arts it is there. Inconsistent, so it's up to the publisher, and I prefer manual's text.


TASVideoAgent
They/Them
Moderator
Joined: 8/3/2004
Posts: 15629
Location: 127.0.0.1
This topic is for the purpose of discussing #6770: link_7777's NES Eggsplode in 02:38.07
Player (13)
Joined: 6/17/2006
Posts: 510
Voting No due to this TAS being very repetitive to watch. Nice job for the RNG manipulation though!
Blazephlozard
He/Him
Banned User
Joined: 2/27/2013
Posts: 175
Location: Ohio
Well, I may as well continue looking at every short NES TAS that shows up... It definitely feels like there's potential to save here, since timelossless RNG manipulation using controller inputs has SO many options. The limiting factor in levels 2 through 5 is mostly the time it takes the last fox to go off screen. But the timings of the foxes can be modified by which is planting a bomb, as well as by stepping on bombs while another is being placed (which freezes a bomb-placing fox in place until the crumble is over). With 210 bombs though, I don't want to look into trying to improve a level's end, just to have the rest desync. The input end for level 6 is another beast, however. There's something odd going on with this game and having a tendency to execute inputs WAAAAY after you've done them. (Which actually greatly annoyed me trying to possibly save time in earlier levels with different RNG manip.) It seems to me that, during the animation of either a fox placing a bomb or a bomb being crumbled, inputs are very slow to update, and your bomb crumble attempts get queued in some way, which can be abused by TAS having 12 appendages. I kept pushing the input end back further and further, adding more and more random garbage inputs with the hopes of my meaningful bomb-crushing input getting delayed, and it just kept working. The foxes are coming so fast in Level 6 that it can be like there's never a break from the animations, so the queue stays full. In the end, I decided to basically generate "white noise" inputs using Lua, and just see if they'd succeed. Sometimes they'd hit an egg, or a bomb would blow up, or the Sign Holder would come in and make me run out of inputs too soon, or the foxes would just plant bombs too slowly. I got a few crashes too... When I had a seemingly very effective white noise input, I shaved a few more frames off it by testing deleting random frames of it, most failing but some still succeeding. Here's an 813 frame faster input end: User movie #63826368958758434 Also the very barebones white noise lua (but hey, it works): https://pastebin.com/f79LyNvZ I have no doubt more frames could be squeezed out of it, but perhaps not many; if I add more inputs to this, it seems like the queue might overflow or something and empty out. So it'd probably have to be faster bomb placing RNG. I couldn't find anything in RAM that looked related to this 'queue', knowing more about it could help a lot if you wanted to try to save more. edit: spikestuff encoded it Link to video
Experienced player (878)
Joined: 11/15/2010
Posts: 267
Nice one again Blazephlozard. I suggest swapping movies and adding Blazephlozard as a co-author. I also added edit privileges in case you wanted to make changes to the submission text. I also added permissions for you on the Rollerblade Racer submission. I have in my notes that 0x12 and 0x16 are the user inputs, but maybe one of them is holding for later processing? I did notice the the fairly extensive buffering, but didn't really think to abuse it to end input early.I didn't see were they were buffering the data, but I have in my notes that 0x43 is the outstanding input check count. This seems to be how it knows that there are buffered inputs that it still needs to process.
Blazephlozard
He/Him
Banned User
Joined: 2/27/2013
Posts: 175
Location: Ohio
Ah, yes, 0043 is looking very useful. Though I have NO clue how the game knows WHAT is queued (I was looking in RAM for some huge area growing in size and didn't see anything). But yeah, this can overflow back to 0 like I suspected. What I have now gets it to 239, and ends at 7 left. My spam input right now is actually overflowing it multiple times; perhaps I should go back to your original input, get as many bombs on screen as possible, and get 0043 neatly to 255, and it could result in a faster input end through trial and error for the spam. So I'll try a bit here tonight to improve it more. Thank you for that knowledge.
Experienced player (878)
Joined: 11/15/2010
Posts: 267
Looks like when you press a button it puts any values in an array at 0x314 and adds to the outstanding count at 0x43. it looks like it uses decrement to process so if there are 0xA outstanding items it will process 0x314+9 first. Essentially it looks like it is a stack (lLIFO), so you could delay processing of an earlier input buy using other inputs. I would note that the elements are 0 based, so if you press button "2" it will put a 1 in the array (0-B instead of 1-C)
Blazephlozard
He/Him
Banned User
Joined: 2/27/2013
Posts: 175
Location: Ohio
Hmm, nice find. Quite wasteful for them to be putting 0-15 into a byte, I was expecting that to be more compressed! With this array going up to 0x413, and obviously them never expecting to have this much of a queue, those crashes I've experienced must be related to this. Well, with this knowledge it definitely feels more possible to carefully plan out the ending and having much more of the 255 queued inputs actually be used to pop a bomb. Although, with RNG changing so easily from the slightest adjustment of input, it might be difficult to plan so far ahead. It's an interesting challenge.
Experienced player (878)
Joined: 11/15/2010
Posts: 267
It doesn't seem like they were too tight on memory, so they probably opted to make the code simple. This does seem in direct contrast to the score though. The score isn't even kept in memory, they directly use the nametable itself. I had to do a slight hack to even check what happens when the score maxes out (it just rolls over) since there is no way to poke the nametable value in the emu
Blazephlozard
He/Him
Banned User
Joined: 2/27/2013
Posts: 175
Location: Ohio
Right now I'm testing just trying an odds and evens approach: 13579B, 2468AC. This will fill the queue as quickly as possible, and guarantee a bomb will get crumbled within 12 attempts if there is one on screen, and keep my sanity by not fiddling around with random garbage. The game's crashing very frequently, possibly always, if I input end with the queue at 240+ full. So there may be a decent upper limit here. Still playing around with it. There is one issue though, Pad 11 and 12's inputs get used at that very moment to the LIFO if there isn't currently a bomb being crumbled, so the queue ends up with none of them in that case. Right now, I patched that by just starting a new bomb crumble before I start my spam, as well as having a bomb ready to crumble on B/C during the spam, so I'd have some Bs and Cs deeper in the queue still. Less, but enough to survive. I did get good Sign Guy luck and a successful input end 89 frames faster (9709). Queue started at 235, ended at 33 left. Will keep playing around for the next few hours. edit: 9678, 244 start, 57 end 9636, 238, 46 9567, 239, 24 9538, 240, 5 9532, 245, 7 9525, 244, 9 9522, 249, 9 9513, 240, 30 (wow, lucky) 9512, 242, 14 9509, 245, 22 9501, 245, 7 (this one took a while) 9500, 243, 0 (I wanted a round number) 9499, 242, 3 (but then I remembered the movie length is actually one frame after input end so I forced one more out) There could be a bit more frames squeezed out still probably, but the RNG is getting very tight, plus this RNG has an egg spawn after the last bomb, so, entertainment B) http://tasvideos.org/userfiles/info/63849490957770407
Editor, Reviewer, Skilled player (1361)
Joined: 9/12/2016
Posts: 1646
Location: Italy
According to GameFAQs, the chance of spawning eggs rises after level 6:
- The game has a limit on its speed. Once blue bombs appear, the game has reached its maximum speed. However, eggs will appear more frequently as the game progresses.
I looked for the routine that decides if spawning an egg, and I found one starting at ROM address 0x826B. However, it doesn't seem to me that there is any variable that could define a different spawning chance. I'm going to do more researches these days, but if anyone feel like taking a look, that would help.
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"
Experienced player (878)
Joined: 11/15/2010
Posts: 267
I described how the difficulty worked a bit in the submission notes, but here is a much deeper analysis. The spawn rate is nearly maxed out in the last stage anyway, so I'd be surprised if additional code to set it one point higher existed. Here are the difficulty parameters and the code that changes them (with pseudo-code). As I said it looks like it uses the count of bombs in the stage to set the rest of the parameters, and the bomb count gets capped at 60.
0x4B enemy count
0x4D bomb count for this stage
0x4F current bomb count
0x22 triggers stage end at 0xA5 (set to 0xA5 + stage bomb count)
0x23 enemy speed
0x24 spawn rate (0 is high)
0x25 bomb types (higer number means more red bombs)
0x26 turns off spawning
0x56 unknown
0x3E unknown
0x101 bomb color (to change the bombs and the word points to blue)

if current bomb count == 0
    if stage bomb count != 60
        add 10 to bomb count
        store back to stage bomb count and current bomb count

96DE:  A5 4F     LDA $4F         A:01  X:FF  Y:96  SP:F1  P:24  nvTbdIzc  Cy:24448012  PPU-Cy:0
96E0:  D0 3D     BNE $971F       A:00  X:FF  Y:96  SP:F1  P:26  nvTbdIZc  Cy:24448015  PPU-Cy:0
96E2:  85 2B     STA $2B         A:00  X:FF  Y:96  SP:F1  P:26  nvTbdIZc  Cy:24448017  PPU-Cy:0
96E4:  A5 4D     LDA $4D         A:00  X:FF  Y:96  SP:F1  P:26  nvTbdIZc  Cy:24448020  PPU-Cy:0
96E6:  C9 3C     CMP #$3C        A:0A  X:FF  Y:96  SP:F1  P:24  nvTbdIzc  Cy:24448023  PPU-Cy:0
96E8:  F0 05     BEQ $96EF       A:0A  X:FF  Y:96  SP:F1  P:A4  NvTbdIzc  Cy:24448025  PPU-Cy:0
96EA:  18        CLC             A:0A  X:FF  Y:96  SP:F1  P:A4  NvTbdIzc  Cy:24448027  PPU-Cy:0
96EB:  69 0A     ADC #$0A        A:0A  X:FF  Y:96  SP:F1  P:A4  NvTbdIzc  Cy:24448029  PPU-Cy:0
96ED:  85 4D     STA $4D         A:14  X:FF  Y:96  SP:F1  P:24  nvTbdIzc  Cy:24448031  PPU-Cy:0
96EF:  85 4F     STA $4F         A:14  X:FF  Y:96  SP:F1  P:24  nvTbdIzc  Cy:24448034  PPU-Cy:0

set $26 to #$00
set $25 to #$0B
A = #$B9
Y = #$04
if stage bomb count != 20
    set $25 to #$09
    A = #$CF
    Y = #$06
    if stage bomb count != 30
    set $25 to #$07
        A = #$D9
        Y = #$04
        if stage bomb count != 40
            set $25 to #$07
            set $56 to #$04
            A = #$EF
            Y = #$06
            if stage bomb count != 50
                set $25 to #$09
                set $3E to #$02
                set $101 to #$12
                A = #$F9
                Y = #$08
$22 = A
$23 = Y

9657:  A9 00     LDA #$00        A:00  X:FF  Y:96  SP:FB  P:26  nvTbdIZc  Cy:240982579  PPU-Cy:0
9659:  85 26     STA $26         A:00  X:FF  Y:96  SP:FB  P:26  nvTbdIZc  Cy:240982581  PPU-Cy:0
965B:  A6 4D     LDX $4D         A:00  X:FF  Y:96  SP:FB  P:26  nvTbdIZc  Cy:240982584  PPU-Cy:0
965D:  A9 0B     LDA #$0B        A:00  X:3C  Y:96  SP:FB  P:24  nvTbdIzc  Cy:240982587  PPU-Cy:0
965F:  85 25     STA $25         A:0B  X:3C  Y:96  SP:FB  P:24  nvTbdIzc  Cy:240982589  PPU-Cy:0
9661:  A9 B9     LDA #$B9        A:0B  X:3C  Y:96  SP:FB  P:24  nvTbdIzc  Cy:240982592  PPU-Cy:0
9663:  A0 04     LDY #$04        A:B9  X:3C  Y:96  SP:FB  P:A4  NvTbdIzc  Cy:240982594  PPU-Cy:0
9665:  E0 14     CPX #$14        A:B9  X:3C  Y:04  SP:FB  P:24  nvTbdIzc  Cy:240982596  PPU-Cy:0
9667:  F0 39     BEQ $96A2       A:B9  X:3C  Y:04  SP:FB  P:25  nvTbdIzC  Cy:240982598  PPU-Cy:0
9669:  A9 09     LDA #$09        A:B9  X:3C  Y:04  SP:FB  P:25  nvTbdIzC  Cy:240982600  PPU-Cy:0
966B:  85 25     STA $25         A:09  X:3C  Y:04  SP:FB  P:25  nvTbdIzC  Cy:240982602  PPU-Cy:0
966D:  A9 CF     LDA #$CF        A:09  X:3C  Y:04  SP:FB  P:25  nvTbdIzC  Cy:240982605  PPU-Cy:0
966F:  A0 06     LDY #$06        A:CF  X:3C  Y:04  SP:FB  P:A5  NvTbdIzC  Cy:240982607  PPU-Cy:0
9671:  E0 1E     CPX #$1E        A:CF  X:3C  Y:06  SP:FB  P:25  nvTbdIzC  Cy:240982609  PPU-Cy:0
9673:  F0 2D     BEQ $96A2       A:CF  X:3C  Y:06  SP:FB  P:25  nvTbdIzC  Cy:240982611  PPU-Cy:0
9675:  A9 07     LDA #$07        A:CF  X:3C  Y:06  SP:FB  P:25  nvTbdIzC  Cy:240982613  PPU-Cy:0
9677:  85 25     STA $25         A:07  X:3C  Y:06  SP:FB  P:25  nvTbdIzC  Cy:240982615  PPU-Cy:0
9679:  A9 D9     LDA #$D9        A:07  X:3C  Y:06  SP:FB  P:25  nvTbdIzC  Cy:240982618  PPU-Cy:0
967B:  A0 04     LDY #$04        A:D9  X:3C  Y:06  SP:FB  P:A5  NvTbdIzC  Cy:240982620  PPU-Cy:0
967D:  E0 28     CPX #$28        A:D9  X:3C  Y:04  SP:FB  P:25  nvTbdIzC  Cy:240982622  PPU-Cy:0
967F:  F0 21     BEQ $96A2       A:D9  X:3C  Y:04  SP:FB  P:25  nvTbdIzC  Cy:240982624  PPU-Cy:0
9681:  A9 05     LDA #$05        A:D9  X:3C  Y:04  SP:FB  P:25  nvTbdIzC  Cy:240982626  PPU-Cy:0
9683:  85 25     STA $25         A:05  X:3C  Y:04  SP:FB  P:25  nvTbdIzC  Cy:240982628  PPU-Cy:0
9685:  A9 04     LDA #$04        A:05  X:3C  Y:04  SP:FB  P:25  nvTbdIzC  Cy:240982631  PPU-Cy:0
9687:  85 56     STA $56         A:04  X:3C  Y:04  SP:FB  P:25  nvTbdIzC  Cy:240982633  PPU-Cy:0
9689:  A9 EF     LDA #$EF        A:04  X:3C  Y:04  SP:FB  P:25  nvTbdIzC  Cy:240982636  PPU-Cy:0
968B:  A0 06     LDY #$06        A:EF  X:3C  Y:04  SP:FB  P:A5  NvTbdIzC  Cy:240982638  PPU-Cy:0
968D:  E0 32     CPX #$32        A:EF  X:3C  Y:06  SP:FB  P:25  nvTbdIzC  Cy:240982640  PPU-Cy:0
968F:  F0 11     BEQ $96A2       A:EF  X:3C  Y:06  SP:FB  P:25  nvTbdIzC  Cy:240982642  PPU-Cy:0
9691:  A9 09     LDA #$09        A:EF  X:3C  Y:06  SP:FB  P:25  nvTbdIzC  Cy:240982644  PPU-Cy:0
9693:  85 25     STA $25         A:09  X:3C  Y:06  SP:FB  P:25  nvTbdIzC  Cy:240982646  PPU-Cy:0
9695:  A9 02     LDA #$02        A:09  X:3C  Y:06  SP:FB  P:25  nvTbdIzC  Cy:240982649  PPU-Cy:0
9697:  85 3E     STA $3E         A:02  X:3C  Y:06  SP:FB  P:25  nvTbdIzC  Cy:240982651  PPU-Cy:0
9699:  A9 12     LDA #$12        A:02  X:3C  Y:06  SP:FB  P:25  nvTbdIzC  Cy:240982654  PPU-Cy:0
969B:  8D 01 01  STA $0101       A:12  X:3C  Y:06  SP:FB  P:25  nvTbdIzC  Cy:240982656  PPU-Cy:0
969E:  A9 F9     LDA #$F9        A:12  X:3C  Y:06  SP:FB  P:25  nvTbdIzC  Cy:240982660  PPU-Cy:0
96A0:  A0 08     LDY #$08        A:F9  X:3C  Y:06  SP:FB  P:A5  NvTbdIzC  Cy:240982662  PPU-Cy:0
96A2:  85 22     STA $22         A:F9  X:3C  Y:08  SP:FB  P:25  nvTbdIzC  Cy:240982664  PPU-Cy:0
96A4:  84 23     STY $23         A:F9  X:3C  Y:08  SP:FB  P:25  nvTbdIzC  Cy:240982667  PPU-Cy:0

if stage bomb count == 40 or stage bomb count == 20
    A = #$0F
    increment enemy count ($4B)
else
    A = #$03
    if stage bomb count == 60
        A = #$01
$24 = A

(pulled together from multiple trace logs)
96A6:  E0 28     CPX #$28        
96A8:  F0 02     BEQ $96AC       
96AA:  E0 14     CPX #$14        
96AC:  D0 07     BNE $96B5       
96AE:  A9 0F     LDA #$0F        
96B0:  E6 4B     INC $4B         
96B2:  4C BD 96  JMP $96BD       
96B5:  A9 03     LDA #$03        
96B7:  E0 3C     CPX #$3C        
96B9:  D0 02     BNE $96BD       
96BB:  A9 01     LDA #$01        
96BD:  85 24     STA $24         
Post subject: Movie published
TASVideoAgent
They/Them
Moderator
Joined: 8/3/2004
Posts: 15629
Location: 127.0.0.1
This movie has been published. The posts before this message apply to the submission, and posts after this message apply to the published movie. ---- [4220] NES Eggsplode by link_7777 in 02:38.07