Larger Sprites collide properly#3587
Conversation
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.
|
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? |
|
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! |
|
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. |
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.