Skip to content

Larger Sprites collide properly#3587

Open
LizardKing777 wants to merge 3 commits into
EasyRPG:masterfrom
LizardKing777:master
Open

Larger Sprites collide properly#3587
LizardKing777 wants to merge 3 commits into
EasyRPG:masterfrom
LizardKing777:master

Conversation

@LizardKing777

Copy link
Copy Markdown

When using larger sprites with "$" in the title, the game still uses the single 16x16 block for the event's collision, so you would have to line up extra events to create realistic collision. This fixes that by reading the size of the sprite drawn on the screen and adding additional collision boxes accordingly. So a sprite which is three tiles wide now occupies three tiles of game space.

Looks like I forgot to update the CMakeLists.txt when I uploaded the new files. My bad. This should hopefully resolve the build error.
When using a modifired size sprite (with "$" in the filename) the system now detects the size of the sprite that is drawn on the screen in pixels. If the sprite is larger than 48 pixels wide, it adds additional collision boxes to the left and right of the even, so a sprite that occupies three tiles now actually occupies three tiles of game space. Events can be triggered from these additional spaces. Currently this only adds additional collision boxes on the horizontal plane.
@Mimigris

Copy link
Copy Markdown
Contributor

This may require discussion, as some games may rely on this feature and this change could make them incompatible depending on how the game is designed (I know two games using this feature, DEEP 8, which uses a custom EasyRPG version so already not fully compatible, and Collective Unconscious; no clue if it changes things for them).

I was wondering, does this hitbox modification changes anything if the $ CharSet is applied to a player or vehicle, or does it only affect regular events?

@LizardKing777

LizardKing777 commented Jun 30, 2026

Copy link
Copy Markdown
Author

I haven't tested it with vehicles yet, but when the player is a larger sprite they adopt the larger collision. To ensure compatibility with existing games, I'll make it an optional flag to enable this in the next update (similar to the allow_pixel_movement flag) so it doesn't break anything. Thanks for the feedback!

@lumiscosity

Copy link
Copy Markdown
Contributor

i wonder if there could be a filename-triggered opt-in for this instead? it'd be nice to mix the classic behavior with this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants