Event/Player Collision Detection

AdamWillard

Villager
Member
Joined
Dec 2, 2013
Messages
5
Reaction score
0
First Language
English
Been trying to recreate a project made with VXAce in MV and I noticed some problems while testing the collision detection with moving events. I'm using events that are set to a route and kill the player when the event touches the player, or the player moves into the event. Problem is when setting the Player speed to max and the event speed/frequency to max I am able to pass through the event when it switches move directions.

Event touch will not work for what I am after so I am using a parallel process on the event with the conditional branch below.

$gamePlayer.x == $gameMap.event(this._eventId).x && $gamePlayer.y == $gameMap.event(this._eventId).y

I have tried multiple approaches to get a working moving enemy that causes a teleport to start of map with no luck. Anyone have any ideas or came across this collision problem yet? To be fair rpg maker vxace has this problem as well.
 

Blue001

Veteran
Veteran
Joined
Jan 13, 2014
Messages
231
Reaction score
112
First Language
English
Primarily Uses
RMMV
As far as I know, when an event moves... it's actual position doesn't really match it's sprites current X,Y

The moment a sprite starts to move, it's relative position immediately changes to the new tiles X,Y and isn't considered being in the old tile anymore. So as you say, move speed really alters how this works. Even if it takes your sprite 4 seconds to move to the left one tile, the game may already consider it being there. So if you run into it in the old tile, even though it's on top of you, it won't count.

As for how to solve this issue.... maybe someone can make a plugin to have the game consider the event at both locations at the same time?
 

AdamWillard

Villager
Member
Joined
Dec 2, 2013
Messages
5
Reaction score
0
First Language
English
In testing I have a solution to this problem by doing two more conditional checks.

IF  $gamePlayer.isMoving()

  IF  $gamePlayer.x == $gameMap.event(this._eventId).x && $gamePlayer.y -1 == $gameMap.event(this._eventId).y && $gamePlayer.direction() == 2

  IF  $gamePlayer.x == $gameMap.event(this._eventId).x && $gamePlayer.y +1 == $gameMap.event(this._eventId).y && $gamePlayer.direction() == 8

The last sets of IF statements should be repeated for all 4 directions if this is needed, in my case its only up and down.

Perhaps there is still a better way to achieve this? I worry about lag when using many of these event (enemies) such as in a room full of moving fireballs from wall to wall.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c

Forum statistics

Threads
105,857
Messages
1,017,019
Members
137,564
Latest member
McFinnaPants
Top