Observation: Is this a bug or not

Found a bug in R'n'D? Report it here!

Moderators: Flumminator, Zomis

Post Reply
User avatar
SLAPPYHAPPY2000
Posts: 93
Joined: Wed Jun 03, 2020 10:27 am

Observation: Is this a bug or not

Post by SLAPPYHAPPY2000 »

Since I'm making a multiplayer levelset, I had to test all kinds of stuff that you can do with two players or more. In one of my levels, both players had to move at the same time to avoid the rocks falling on them. However, as I noticed, it only worked with the first player at the lead, because when I had the second player at the lead, the rocks fell in front of the first player.

I observed, and the image below is what happens when you have the first player in the lead with the second player following as closely as possible (can be replicated by having the first player standing still, pressing on the first player with the second player in the desired direction, and then moving in the desired direction while still having the second player pressed closely behind against the first player - simple stuff!):
This is what happens if the first player is in the lead. Notice how there is no space between the two players - at all!
This is what happens if the first player is in the lead. Notice how there is no space between the two players - at all!
numba1.PNG (10.82 KiB) Viewed 46 times
And then here it is for when the second player is in the lead:
For when Number Two himself is in the lead. See how there is a small space between the first and second player!
For when Number Two himself is in the lead. See how there is a small space between the first and second player!
numba2.PNG (16.21 KiB) Viewed 46 times
For some reason, the results are different, when I think they should be the same...?
I don't know if this is another feature or if this is a bug, but I wanted to showcase this observation just in case.
Toodles! :D
User avatar
Holger
Site Admin
Posts: 3510
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Re: Observation: Is this a bug or not

Post by Holger »

Yeah, right. That's because when moving players, there's a loop over all four players, starting with the first one (that's the yellow one). If he successfully started moving, the tile he is leaving is immediately marked as "free", so the second player can immediately start moving, too. That's your first example.

In the second example, the yellow (first) player is again checked first, but cannot move, because there's still the red (second) player. The red player is checked next, and yes, he can move now. But the yellow player is not checked anymore unless the next game frame is reached! That's why the red player is now one step (one game frame) ahead of the yellow player.

This effect (the different behaviour as you have described it) could be removed by always blocking the tile a player is leaving for one game frame. This would then result in the player that starts moving to be always one game frame ahead of the player that follows him.

You can test this by activating the usually deactivated player option "[ ] block last field when moving" in the level editor (on the properties page of the player elements). When activated, the players will move with the same distance in both of your examples. However, this option blocks not for a single game frame, but until the field is completely empty (which is eight game frames with normal speed).

But you can at least remove the different distance depending on moving order that way.
filbo
Posts: 500
Joined: Fri Jun 20, 2014 10:06 am

Re: Observation: Is this a bug or not

Post by filbo »

This sounds like a case for special cases in the code... if P1 and P2 play out a level successfully, then they switch positions and do exactly the same motions (down to the frame), they should get the same result! Of course it is not quite so, since the cycles of other things in motion will have changed, and random seeds and stuff. But at the crude level of 'how do the players move', it should be the same.

... so maybe an early pass to see if each player might be vacating their space, then allow any player to move into the now-vacated place? It sounds 'easy' but I can see there's all sort of scope for crazy results, players moving into the same space at the same time (or being able to exchange places through each other), so probably not really very easy, but still doable...
Post Reply