Tip: You can use Lunar Magic's Overworld Layer 3 Editing system to edit or create your own layer 3 images (castle bricks, fish, rocks) and apply unique effects per level via the Layer 3 Bypass in the main editor.
Two core things happen here: random sprites spawn in, and random velocities are added on to each sprite (including ambient sprites). Idea credit goes to p4plus2.
An exclusion lookup table has been included to exclude any sprites that are problematic. A roughly reasonable default has been assigned to prevent crashes & softlocks and also to make the vanilla game somewhat beatable. Feel free to modify as you please. The format of each byte in the table is:
M = exclude from moving around (setting velocity)
S = exclude from spawning in
C = custom use per sprite
r = reserved for future use (or use these as custom if you please)
An occasional Yoshi animation corruption effect can happen; if it turns on, Yoshi's animation frame gets changed to a random value
every so many frames. Values are tweakable in "consts" in the ASM file.