19 users online: Ahrion,  AmperSam,  Anorakun, ASSATAKKU, Cappaque, Children's Digest 1950-2009, FELIPECOSTA10, fenas, Green Jerry, GrenCarret, Hanox, HeitorPorfirio2006, Kaurrs, Klug, lx5, MoxieCat, Sammmoo, SubconsciousEye, ToxicRave - Guests: 77 - Bots: 332
Users: 56,258 (2,267 active)
Latest user: BriGuy

No Sprite Interaction Fix

SMW Patches → No Sprite Interaction Fix

Submission Details

Name: No Sprite Interaction Fix
Author: chillyfox
Tool: Asar
Requires Free Space: Yes
Bug Fix: Yes
Featured: No
Description: Depending on sprite slots, sometimes a few sprites won't interact with other lower priority sprites, like Thwomp vs shell, so this small patch gives consistent sprite-on-sprite interaction to a couple of enemies:

Fire Snake
Tags: fire snake hopping flame interact interaction lorom shell sprite sprite contact thwimp thwomp
Comments: 4 (jump to comments)
Download 859 bytes | 340 downloads


View all

Comments (4)

HammerBrother Link
Explanation: $01A40D (called from $018032 by the current sprite being processed) only handles with interaction with sprite slots below the current sprite slot. Meaning if the current sprite is at slot 8 (slots are index-numbered 0-11), then only sprite slots 0-7 are handled.

It loops through the slots like this:

Each dash/A/B is a sprite slot, representing slot numbers 0-11.
A = Sprite_A - Current sprite processed
B = Sprite_B - Other sprite to check for collision.
-------BA--- (Sprite_A:08, Sprite_B:07)
------B-A--- (Sprite_A:08, Sprite_B:06)
-----B--A--- (Sprite_A:08, Sprite_B:05)
----B---A--- (Sprite_A:08, Sprite_B:04)
---B----A--- (Sprite_A:08, Sprite_B:03)
--B-----A--- (Sprite_A:08, Sprite_B:02)
-B------A--- (Sprite_A:08, Sprite_B:01)
B-------A--- (Sprite_A:08, Sprite_B:00)

And therefore, sprite interactions are “one-way” as to prevent the collision code to run twice by each of the two sprites in question (only the sprite with the higher index handle the collision of both).

The thwomp, thwimp, and hopping flame DID NOT call $018032 but shells and any other kickable sprites DO call $018032, despite their tweaker settings are set to interact with other sprites. In order for an interaction code to be executed, the sprite with the higher slot MUST call $018032 in order for it to happen. And if that higher slot happens to be a thwomp, thwimp, hopping flame, then no interaction is processed which that is a bug.

Even further detail (but not a major problem) is that the routine will entirely skip if both Sprite_A's index and the frame counter $13 are even or odd. If one is odd and other is even, then it will process the interaction. Therefore half of the slots are processed in one frame, while the other frame are the other half of the slots. This is to prevent huge slowdown, as assuming all 12 slots are used up and calls $018032, there would be 66 possible combination pairs of the 12 sprite slots ((12!)/(2!(12-2)!) = 66).
qantuum Link
Does this work for Skull-form mobs.
Brutapode89 Link
Hi. Please, by using the patch, there're interaction problems with Suu (Spider from Super Mario Land) and Flying Wiggler. Sometimes, these two enemies aren't K.O by using a Koopa shell.
 Maarfy Link
Another entry for the “thought we would have had something like this already” list. Makes Thwomps, Thwimps and Hopping Flames behave more consistently, which is surely a good thing - glad this code is more available now!