Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411604 Posts in 69388 Topics- by 58445 Members - Latest Member: gravitygat

May 08, 2024, 03:33:01 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperDesignOf Mice and Moving Platforms
Pages: [1] 2
Print
Author Topic: Of Mice and Moving Platforms  (Read 4859 times)
___
Vice President of Marketing, Romeo Pie Software
Level 10
*


View Profile
« on: April 19, 2009, 02:20:30 PM »

Moving platforms are awesome.  SEE VIDEO.  It seems like a lot of awesome platforming games all make use of them, and they're a lot fun but... a pain in the ass to make.

So right now, my question to you folks, is how do you like moving platforms to behave when overlapping the player?  So far the choices I can immediately think of:


1.) The platform detects that its pushing the player into a wall and reverses direction to prevent overlap

  • Seems good, but if I'm trying to organize some sort of moving platform jump challenge, the instant reverse in direction could de-sync it's movement with other moving platforms that I set up in a very particular way.
  • Looks good, no platforms ever overlap objects.

2.) The platform crushes the player, damaging/killing him/her.

  • Is more expected thanks to the Mario games and being crushed between two moving walls.
  • Sucks for the player, especially if you're not really doing a Mario type platforming game (set levels, lives, a lot of deaths expected, etc.)

3.) Overlaps the player and continues moving on it's set path, but while overlapping the player is stuck (or pushed out?)

  • Doesn't desync the platform movement
  • Player doesn't die, or take damage
  • But it looks kinda buggy...
« Last Edit: April 19, 2009, 02:30:51 PM by xerus » Logged
ChevyRay
Guest
« Reply #1 on: April 19, 2009, 02:54:51 PM »

I've usually gone with #2. While it seems like it might suck to have a platform crush you, it actually doesn't occur that much. Platforms that move horizontally are usually fairly narrow in height, so it rarely occurs that your character, while falling downward, gets caught between the platform and a wall (or another platform). With vertically moving platforms, I don't often see them placed in games in a situation that has them colliding vertically with ceilings and floors (their placement is usually over pits, water, etc. where there is no ceiling or floor at all), so the issue doesn't even occur with these ones.

#1 is definite no if you have multiple moving platforms, and the level design depends on their timing.

#3 is buggy looking, which is worse than #2 in my opinion.

So I'd say go with #2, because with proper placement, a player will probably go through the game without even being crushed. And if you have big, fat moving platforms that push up against walls, the player would have to be pretty ignorant if they weren't expecting to die when pinched between one and a wall.

PS: If you're having trouble programming them at all, you've got my number.
Logged
Glyph
Level 10
*****


Relax! It's all a dream! It HAS to be!


View Profile
« Reply #2 on: April 19, 2009, 03:05:38 PM »

I'd probably have the platform push the charachter, and when up against a wall, have it stop for the alloted time for it to have moved into where the player is then turn around. This is really complex I know, but it's an alternative to death.
Logged


___
Vice President of Marketing, Romeo Pie Software
Level 10
*


View Profile
« Reply #3 on: April 19, 2009, 03:07:43 PM »

I'd probably have the platform push the charachter, and when up against a wall, have it stop for the alloted time for it to have moved into where the player is then turn around. This is really complex I know, but it's an alternative to death.

This is one that popped into my head as well, but I couldn't really think of any way to program it as such because I am dumb.  But yeah, this would be my ideal resolution, I think.
Logged
pgil
Guest
« Reply #4 on: April 19, 2009, 03:20:45 PM »

well, you could have it wait for HSPEED(pixels per step) * width of the character... or something. But I've had a few beers and can't do math.



EDIT: I noticed that nobody mentioned jumpthrough platforms. That would solve the platform having to stop for the player (at least for horizontal movement). Also, when a character is standing on it and they hit a ceiling, they could just fall through it.
Logged
omnilith
Level 2
**



View Profile
« Reply #5 on: April 19, 2009, 03:21:44 PM »

I'd do a mix of #2 and #3, with two very different types of platforms that are easily distinguished from each other.

Type #3 will probably be your most common platform, like the kind seen in Mario Bros 3 or Yoshi's Island. This type of platform is usually very thin height-wise, and doesn't look like it's made of tough material. The player can only interact with the top part of these platforms, meaning that they can jump up through the bottom and land on top. They otherwise won't affect the player, meaning that they will pass through you if you are standing on a piece of ground as they come at you from the side or something like that. The player is of course free to move while overlapping with this kind of platform, allowing them to do a hop on to it if they like.

Type #2 is rarer, and is usually represented as fat, chunky blocks of land that are made of solid materials, such as stone or metal. In other words, they look like most of your other tiles. You can interact with all sides of these blocks, and they will push you around if you get in their way. For these, I'd recommend having them either crush you for getting between them and a hard place, since they are clearly solid, or do it like Glyphmasta says if you don't want to punish the player too much.

But yeah, for your typical, everyday platforms I'd go with the Type #3. It's a bit annoying to be shoved around by a typical platform, I think.
Logged

Reiss
Level 1
*



View Profile
« Reply #6 on: April 19, 2009, 04:50:39 PM »

I'd do a mix of #2 and #3, with two very different types of platforms that are easily distinguished from each other.

Type #3 will probably be your most common platform, like the kind seen in Mario Bros 3 or Yoshi's Island. This type of platform is usually very thin height-wise, and doesn't look like it's made of tough material. The player can only interact with the top part of these platforms, meaning that they can jump up through the bottom and land on top. They otherwise won't affect the player, meaning that they will pass through you if you are standing on a piece of ground as they come at you from the side or something like that. The player is of course free to move while overlapping with this kind of platform, allowing them to do a hop on to it if they like.

Type #2 is rarer, and is usually represented as fat, chunky blocks of land that are made of solid materials, such as stone or metal. In other words, they look like most of your other tiles. You can interact with all sides of these blocks, and they will push you around if you get in their way. For these, I'd recommend having them either crush you for getting between them and a hard place, since they are clearly solid, or do it like Glyphmasta says if you don't want to punish the player too much.

But yeah, for your typical, everyday platforms I'd go with the Type #3. It's a bit annoying to be shoved around by a typical platform, I think.

Yeah, I agree with this.  Just as a visual note, so that type 3 doesn't look buggy and weird, you definitely would want to draw the non-deadly platforms behind the game's protagonist, so it doesn't look like the character is getting cut in half.  I think that's often the technique used in games with those kind of platforms.

Alternatively, the way Super Smash Bros (which is in 3d perspective, so if you're going for literally a straight 2d look where the player can't see the floor the character is standing on, this might not help) did it was to have the characters pop through the center of the platforms.  If you have a kind of faked perspective going on, where the player can see the side of the platform as well as the "floor" of the platform, you could have the platform be drawn in two parts: one piece behind the player, and one piece in front, so that the player is very obviously popping straight through the center of the floor.  That way, it's clear that it's not a bug that the character isn't getting pushed around or killed, and it also serves as a visual cue that the the platform is permeable from the bottom.
« Last Edit: April 19, 2009, 04:56:20 PM by XUE » Logged
William Broom
Level 10
*****


formerly chutup


View Profile
« Reply #7 on: April 19, 2009, 11:22:48 PM »

La-Mulana does #3 and it looks fine, probably because the moving platforms are semi-transparent.
Logged

Saint
Level 3
***



View Profile WWW
« Reply #8 on: April 19, 2009, 11:54:51 PM »

I'd go with 1, but keep the "wanted" position as well as the actual position. That way, should the platform get out of sync you can easily raise the velocity for a few seconds to have it get back where it's supposed to be.

It might look kind of weird depending on the platform, though.
Logged
Chris Z
Level 7
**



View Profile WWW
« Reply #9 on: April 20, 2009, 12:20:14 AM »

Mario 3 and most platformers of the day usually pushed you off in that situation (option 3?) but do whatever works for your game.
Logged

Alex May
...is probably drunk right now.
Level 10
*


hen hao wan


View Profile WWW
« Reply #10 on: April 20, 2009, 12:32:28 AM »

You can get around it with level design as well. Proper placement of moving platforms will ensure they can never get into this situation.
Logged

moi
Level 10
*****


DILF SANTA


View Profile WWW
« Reply #11 on: April 20, 2009, 02:55:14 AM »

Moving platforms are awesome.  SEE VIDEO.  It seems like a lot of awesome platforming games all make use of them, and they're a lot fun but... a pain in the ass to make.

So right now, my question to you folks, is how do you like moving platforms to behave when overlapping the player?  So far the choices I can immediately think of:


1.) The platform detects that its pushing the player into a wall and reverses direction to prevent overlap

  • Seems good, but if I'm trying to organize some sort of moving platform jump challenge, the instant reverse in direction could de-sync it's movement with other moving platforms that I set up in a very particular way.
  • Looks good, no platforms ever overlap objects.

2.) The platform crushes the player, damaging/killing him/her.

  • Is more expected thanks to the Mario games and being crushed between two moving walls.
  • Sucks for the player, especially if you're not really doing a Mario type platforming game (set levels, lives, a lot of deaths expected, etc.)

3.) Overlaps the player and continues moving on it's set path, but while overlapping the player is stuck (or pushed out?)

  • Doesn't desync the platform movement
  • Player doesn't die, or take damage
  • But it looks kinda buggy...

Yeah moving platforms are the most difficult thing to do ever.
1)if player is riding ON the platform and coming into contact with a wall on the way.
I think the player should either be pushed out of the platform or crushed/killed (depending on the game).
2)if player is on the side of the platform (not riding it) but comes in contact with a moving platform at the same height.
The platform should either stop, or it should push or crush the player (depending on the game)
Logged

subsystems   subsystems   subsystems
mirosurabu
Guest
« Reply #12 on: April 20, 2009, 06:22:08 AM »

I don't see where's the problem.

With horizontal moving platforms (which cause lateral sides of character to collide with solid objects) the collision should result with solid objects resisting with negative force - hence pushing you back.

With vertical moving platforms, when top side of character's bounding box collides with solid, the player should die/be damaged. If you don't want this to happen, then just put the ceiling higher.

At the end, it's down to level design and design goals whether there are going to be such collisions or not.

Hence, I don't see where's the problem. (unless I'm misunderstanding something)
Logged
Traveller
Level 1
*


View Profile
« Reply #13 on: April 20, 2009, 08:06:26 AM »

I lean towards #3, mostly because I'm used to Contra-style players' interactions with the world.  In other words, if it's not insta-death, the only interaction is "your feet" and "the top of the platform"; higher platforms are also a little bit further back, so you can always jump through them.

Besides, #3 gives you a little more latitude with placing enemies and other things that you might not want to push around.
« Last Edit: April 20, 2009, 08:19:34 AM by Traveller » Logged
Valter
Level 10
*****


kekekekeke


View Profile
« Reply #14 on: April 20, 2009, 08:46:32 AM »

The key is knowing when to switch between #2 and #3. I've found that #2 is best for "solid" platforms (platforms that you can not jump through from underneath), and #3 is best for "transparent" platforms (platforms that you can jump through from below).
Logged
Lynx
Level 5
*****


Upstart Feline Miscreant


View Profile WWW
« Reply #15 on: April 20, 2009, 01:38:17 PM »

Graphic design probably helps here.  If the bottom of the platform is this open framework, it doesn't look that dangerous, and in fact, the player might assume that it's in the background, an open lift you can step into, rather than right on top of the player.  If the bottom of the platform is full of spikes or crackling with dangerous energy, the player might get the idea it's dangerous and should not be touched.

Logged

Currently developing dot sneak - a minimalist stealth game
AlexWeldon
Level 0
**



View Profile
« Reply #16 on: April 24, 2009, 04:33:59 AM »

I have a completely different suggestion. You can do #1 without it breaking the level design if you do it this way:

Every platform has a real position and an intended position. The intended position is what you, as the level designer, are moving. Say it moves back and forth at, say, two pixels per frame. The real position of the platform is moved automatically by the program at a faster rate, towards the intended position, let's say at up to five pixels per frame.

That way, you can allow the platform to stop when it hits the player, and enemy, or whatever. As soon as the obstruction is removed, it will race to catch up with its intended position relative to the other platforms. Alternately, if the obstruction is there long enough that the intended position starts to come back the other way, then once it passes the player again, the platform will automatically just join up with it and move back the other way.

E.g.:

Code:
function onFrame():void {
frame_count++;
if ( int(frame_count / 20) % 2 == 0 ) platform_target.x += 2; // Move right for 20 frames, then left for 20 frames, etc.
else platform_target.x -= 2;
if (platform_target.x > platform.x) platform.x += Math.min(5,platform_target.x - platform.x,getUnobstructedDistance(platform,true));
else platform.x -= Math.min(5,platform.x - platform_target.x,getUnobstructedDistance(platform,false));
}

function getUnobstructedDistance(spr:MyGameSprite,positive:Boolean) {
/* Some code to get the maximum distance a sprite can travel in a positive
(true) or negative (false) direction before hitting an obstruction */
}
« Last Edit: April 24, 2009, 04:39:07 AM by AlexWeldon » Logged

Games, Puzzles and Game Design Blog: http://www.benefactum.ca
RadLab
Level 0
**



View Profile
« Reply #17 on: April 24, 2009, 08:15:15 AM »

Killing the player with a moving platform should be a solution only if it's considered to be a challenge for the player to jump at the right time and avoid being crushed.

Jumpthrough platforms (mentioned by pgil) should follow the same "challenge" logic. It does not appear to be buggy.

Another solution would be having the platform wait at the end of its path before going backward. This way, you can make it stop when the player passes by and shorten/extend its waiting time to restore its synchronicity with other moving platforms, without altering moving speed.
Logged
Traveller
Level 1
*


View Profile
« Reply #18 on: April 24, 2009, 08:24:06 AM »

Every platform has a real position and an intended position.

I like this idea because it implies some pretty sick sequence breaking, to me.  I wouldn't say that it doesn't break the level design.  But it sure would be fun to mess with.  Especially if platforms that are 'catching up' and moving faster do add their speed to a riding player's jumps.
Logged
JLJac
Level 10
*****



View Profile
« Reply #19 on: April 24, 2009, 08:40:09 AM »

I'd go with 1, but keep the "wanted" position as well as the actual position. That way, should the platform get out of sync you can easily raise the velocity for a few seconds to have it get back where it's supposed to be.

It might look kind of weird depending on the platform, though.
If what you want is solid platforms that push the player, but still doesn't crush him, this seems like the best alternative to me.
Logged
Pages: [1] 2
Print
Jump to:  

Theme orange-lt created by panic