Skip to content

Genkido: Wrong collision for event with tile graphic #3366

Description

@florianessl

Name of the game: Genkido

Attach files (as a .zip archive or link them)

Download for game & savefile is found here:
https://community.easyrpg.org/t/gamebreaking-collision-issue-in-genkidou-short-platformer-from-2006/1607

Describe the issue in detail and how to reproduce it:

Access the platforms on the right side by avoiding the enemies and touch both barrels to create a passable way on the left platform. (First, drop the lower one of the barrels, then go up the ladder and sacrifice some HP by touching the pig enemy. Then you have access to the other barrel and can make your way back)
In RPG_RT this new passageway can be used to walk to the exit. In EasyRPG this remains inaccessible. The player can't walk over the barrel.

Notes:

In this specific example, the barrel event itself is based on a non-passable tile (EV0022), but on the spot where it lands, another event (EV0023) is activated which would take precedence for collision detection.
Tested across a few different RPG_RT versions, including 2k3 & the newest MP build. All seem to interpret this the same way.

Also: Moving EV0023 to a lower ID makes the tile impossible to pass on any version. Event ID takes precedence here.

For some reason EasyRPG Player has another special condition in its collision detection:
When checking for passability by examining all events with "below" status on the target spot X/Y, it only considers events when the tile_id is greater than zero. This filters out EV0023 & makes walking over the this spot impossible.

Patching this should be quite simple. But one has to wonder, why this specific check is there & if this was introduced to fix some other rare issue?

 src/game_map.cpp | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/src/game_map.cpp b/src/game_map.cpp
index 5180fdd43..e47162820 100644
--- a/src/game_map.cpp
+++ b/src/game_map.cpp
@@ -1018,7 +1018,7 @@ bool Game_Map::IsPassableTile(
 			}
 		}
 
-		// Highest ID event with layer=below, not through, and a tile graphic wins.
+		// Highest ID event with layer=below and not 'through' wins.
 		int event_tile_id = 0;
 		for (auto& ev: events) {
 			if (self == &ev) {
@@ -1028,10 +1028,7 @@ bool Game_Map::IsPassableTile(
 				continue;
 			}
 			if (ev.IsInPosition(x, y) && ev.GetLayer() == lcf::rpg::EventPage::Layers_below) {
-				int tile_id = ev.GetTileId();
-				if (tile_id > 0) {
-					event_tile_id = tile_id;
-				}
+				event_tile_id = ev.GetTileId();
 			}
 		}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions