Language…
12 users online: BUX88, DanMario24YT, deported,  DeppySlide, Domokun007, ForthRightMC, hhuxy, Knight of Time, koffe190, Pizzagamer9791,  Ringo,  yoshi3706 - Guests: 304 - Bots: 250
Users: 64,795 (2,375 active)
Latest user: mathew

[GM 8.1 Lite] Please Help! Platformer Collision Problems

I'm trying to make a game using Game Maker. It's supposed to be a MegaMan fan-game, to help learn how to make a platformer. However, I've hit a hurdle rather early on. My engine seems to work fairly well for what I've put together so far, up until I run into a wall. A lot of the time, MegaMan spazzes out when I press up against a wall. I've been looking through a bunch of different platforming engines to figure out how to fix this, but I can't figure it out. Could somebody please pick through what I have made so far and help me fix this?

http://www.mediafire.com/?l9n6id4n3f6p7io

By the way, I kind of just picked graphics I liked for the testing rooms. That's why it looks like MegaMan is invading Kirby's Dream Land. I thought it would be somewhat amusing while testing things out.
Current Projects: "Legend of Zelda: Balance of Power" (A Zelda Classic quest)
im no expert, but i decided to take a look at it and so far, i somehow managed to turn the ground into a trampoline.

ill be sure to update if i figure out the problem.

EDIT: im pretty sure at this point it has something to do with using the solid tic box because of how the solid option works.

it works by upon contact, if the mask would have gone through, it pushes it back to the last known spot that wouldnt have gone through it. at the very least, the blocks didnt seem to like corners by treating it for a split second as ground and the occasional right before hitting ground, push up and treat the float as ground frame.
I don't know how useful this will be, but you can study this old file I made for a competition ages ago. The documentation isn't so good, but it has tags on everything. It's a bit more basic than Megaman's engine, but the collision works with no issues that I know of.

http://www.mediafire.com/?db6b6xg3z64tdfm
Krakenskin Leather Works, my Etsy store.
LordVanya, my art page.
FundamentalEssence, my game development page.
Heh, it's nice to see somebody else working on a Megaman fangame. I've started using Game Maker pretty recently and I'm working on a Megaman fangame as well.

Anyway, one thing I have learned about platformers in general is that solid blocks are actually deceptively evil to code. Looking at your project, I notice you've used collision events. I personally handle collision coding manually and am not familiar with collision events, so I can't offer you much insight for the actually coding itself, but one thing I noticed that could also be a potential problem is that your player graphic has an inconsistent hitbox size. Generally, you want your player's hitbox to be the same for nearly all of its frames, despite how much space the actual image takes up. (It may seem a little bit odd for the hitbox to not match the size of the graphic image, but many official video games did it that way.)

In the original Megaman series, his hitbox size was around 16x28 pixels or so, so that would be a good starting point. Also make sure that the center of the hitbox stays relative to his X and Y origin for each of his animations. Hopefully that should fix solid collision a bit.

A few minor unrelated nitpicks:

- Don't use fixed scale graphics. This can actually cause the game to look blurry on many graphics cards. Switch to "Keep aspect ratio" instead. As for scaling the graphics, go to Views tab in the room editor and in the "Port on screen" section, change the values to the same ones in "View on room" multiplied by 2 and plus 1. (So in this case you'd want to change 200 and 168 to 401 and 337 respectively.)

- Megaman's jump speed is too consistent. In the original Megaman games you could jump much lower by quickly tapping the button. I'm not sure if this is something you just haven't gotten to yet, but it's something to keep in mind.

- Megaman runs way too fast.

I hope that all of this helped. Good luck with your fangame!
Go to this thread:

http://www.sprites-inc.co.uk/files/forum/showthread.php?tid=561

Someone posted a LUA script for Megaman 2 all 6 Megaman games that shows the hit boxes exactly as they are in the game's code. That should give you some insight.

Alos, I agree with Jimmy. It's better to use two sprites for left and right facing than to use the scaling feature as it still acts a little wonkey to this day.
Krakenskin Leather Works, my Etsy store.
LordVanya, my art page.
FundamentalEssence, my game development page.
I had tried keeping the hitbox consistent before, and somehow it resulted in Mega Man somehow warping through the solid ground and falling to death. Still, since you gave me some dimensions to work with, I'll give it another shot. I think I can get it working right this time, and the hitbox sounds like it's what's giving me the problems I'm having. It should also fix my problem with Mega Man's foot getting caught in walls and him sticking.

Regarding jump height, I just put in a really basic jump routine to test jumping height and movement speeds, so I had something to use as a starting point. Same goes for movement. It was just something to use to start with and to be able to test the collision and basic level design. Can't test how the levels work if Mega Man doesn't move.

Anyways, I haven't played an NES Mega Man game in forever, so the mechanics I'm working with obviously aren't exact. Once I get everything at least functional (meaning being able to traverse the levels and shoot at things and have them react to getting shot), I'll start working on making things closer to the actual games.

Thanks for all of your help, guys. I wasn't really sure that I'd get a response on this, let alone anything this useful. I'll work on this for a bit and let you know how things go.
Current Projects: "Legend of Zelda: Balance of Power" (A Zelda Classic quest)