TIGSource Forums

Developer => Technical => Topic started by: paulkowalewski on September 12, 2010, 01:37:07 PM



Title: Game Maker platforming novice problems
Post by: paulkowalewski on September 12, 2010, 01:37:07 PM
This is the right place to post this kind of thing, right? Isn't it? Okay, so I've been working on my typical first-experimenting-figuringstuffout platformer in Game Maker, and for some reason I decided to use some sprites I made like a year and a half ago and a tutorial package from probably before that. I've mostly been able to figure out how to fix most of the problems I've had but there's 2 that have been a problem since the beginning.

First problem is, my main playable character's walking loop animation doesn't work when he walks. I tried having walking as move in a direction and also as jump to position a few pixel sideways. Can't come up with any ideas for that one, it just gets stuck as one frame of the animation and you just slide around. I messed around and got it to play the animation when you STOP walking, though. Uh, anyway.

Second problem is if you touch the right side of the solid block object I've been using as platforms and the ground, you get stuck in the spot you're standing in and can't escape unless the block wall is short enough for you to jump out of it, otherwise you have to restart the room. The action is something like collision with character move to contact direction:direction maximum 12 set vert speed to 0. I don't know. Also, strangely, if you touch the left side of the block you can jump up it infinitely, if they're stacked like a wall. This problem doesn't exist in the tutorial example game, and as far as I know my objects are identical to all of the tutorial's.

If it helps, the weird old tutorial I used was apparently Game Maker's official platformer tutorial, but way back for version 7. Should I just find some other method/tutorial and change all my physics or is there anything I can do to try to fix it?


Title: Re: Game Maker platforming novice problems
Post by: Nix on September 12, 2010, 03:58:57 PM
Should I just find some other method/tutorial and change all my physics or is there anything I can do to try to fix it?

These sound like pretty standard platformer-physics/animation bugs. Is there anything you can do to fix it? Sure. Just stare at your code (or whatever it is that Game Maker does) for a while until you see what's wrong with it. Or just delete everything that you did that had to do with the physics and redo it. The new version might work a bit better  :giggle:.  You could go copy the method of another tutorial if you want, but I don't think that would help you with one of the most valuable skills in programming: making things work. Just screw with it until something good happens.

About your specific problems, it's nearly impossible for anyone to help you without you posting the source. Your problems are specific to what you did and there are probably countless ways in which your problems could have been caused.

Good luck!


Title: Re: Game Maker platforming novice problems
Post by: lasttea999 on September 12, 2010, 06:59:53 PM
Allow me to recommend Mr. Matt Thorson's engine: click here (http://forums.tigsource.com/index.php?topic=5790.0)

Also, allow me to suggest posting code; we may be able to help you with specific coding problems. :)


Title: Re: Game Maker platforming novice problems
Post by: paulkowalewski on September 12, 2010, 10:42:48 PM
See here's the thing, I'm not a programmer, or a coder. I'm not using... code? I guess? I wouldn't know how to give you any code. I've been using the basic beginning actions and events stuff, that's why I'm using Game Maker. All the things involved in the block glitch are identical to everything in the engine/tutorial I'm using and I've tried a million different things. The animation thing, I can't get animations to work no matter what I do, except for one time and I did the exact same thing for something else and it didn't animate. I just thought maybe there was a general animation glitch that Game Maker users had a problem with that might be responsible. I guess I'll just figure it out on my own then, or just make characters that have rollerskates on all the time.


Title: Re: Game Maker platforming novice problems
Post by: Nix on September 13, 2010, 06:48:04 AM
I just thought maybe there was a general animation glitch that Game Maker users had a problem with that might be responsible.
No, but that would certainly be nice.

Quote
...or just make characters that have rollerskates on all the time.
:giggle: that's one solution.

Anyway, when people say to post "code" with Game Maker, the best equivalent would probably to post the project file.


Title: Re: Game Maker platforming novice problems
Post by: lasttea999 on September 13, 2010, 04:24:11 PM
Maybe you could post the actions and stuff you're using? It might be a bit more difficult to interpret than code, but it might work.

A general description of the problem might be a good introduction, but it doesn't necessarily shed light on how to solve it. The cause of the problem could be anything from a tiny bug to a misunderstanding of how GM works.

I remember finding the official platformer tutorial very useful when I didn't know much GML. I wonder if that's the same tutorial as yours? If it is, I wouldn't think a GM7 version would have any problems with GM8.


Title: Re: Game Maker platforming novice problems
Post by: paulkowalewski on September 13, 2010, 07:35:04 PM
Yeah I checked out the Grandma engine which has a lot of stuff I'd like to do then I was like oh it's all coding. So, like, I guess I should just learn... legit coding, shouldn't I? In that case I might as well start over anyway, which would probably fix all of my problems! I think I'm just gonna do a little bit more messing around with what I have, then decide what I'm going to do for a legit game.


Title: Re: Game Maker platforming novice problems
Post by: lasttea999 on September 13, 2010, 09:56:20 PM
Sounds great! GML's fun! I wish I could be as enthusiastic about learning other programming languages as you are about GML, ha ha.

I wish I could point you toward a few GML tutorials, but I'm not really sure I've seen any that I could recommend with confidence. Consider searching at www.gmc.yoyogames.com.

What I would definitely recommend, though, is learning the basics of code from a class, perhaps an introductory college course, and then reading the Game Maker help manual. If I'm not mistaken, GML is made to be similar to many different programming languages, so stuff you learn about other programming languages will probably be applicable to GM. I think the basics are key. After learning the basics, I got to the point where, even if I'd never done something in GM before, I could look it up in the help manual and learn it on the fly.


Title: Re: Game Maker platforming novice problems
Post by: lasttea999 on September 13, 2010, 09:57:11 PM
EDIT: That's weird, I wonder when I quoted myself...

By the way, I had forgotten Mr. Derek Yu's tutorials which, in fact, cover some GML. They, however, cover more than just GML. You might find other useful information too! Here are the links:

Part I (http://forums.tigsource.com/index.php?topic=3251.0)
Part II (http://forums.tigsource.com/index.php?topic=3630.0)
Part III (http://forums.tigsource.com/index.php?topic=4325.0)
Part IV (http://forums.tigsource.com/index.php?topic=8432.0)


Title: Re: Game Maker platforming novice problems
Post by: baconman on September 15, 2010, 07:42:29 PM
I had that movement problem when starting off.

Key = this is a one time button function, like pressing a key to shoot. Holding here will not repeat the effect.

Key Press = This is where you want your walking animation/direction. "Move Fixed" is an option that works well for me; and IIRC, you can stack vertical/horizontal movement in different keys to create diagonal movement. (Up + Right = Up-Right, you don't need a seperate command).

Another cheat thingy I do? After a successful ground check (contact solid @ y+1), I actually set movement to down-left and down-right (as the character won't enter solids). This automatically handles 45-degree inclines correctly most of the time. ;) If left makes a contact at x-1, or right makes a contact at x+1, I change it to straight left/right, to trace up the inclines (at a lesser speed).

Key Release = Here's where you set your speed back to 0 (to stop moving), and your image_speed to 0 (to stop the animation). Alternatively, you can "skid" your character to a stop by adding friction (like 0.2), instead. (Speed = last speed x friction... so 2.0 friction would basically double your speed, 0.25 would cut it to 1/4 of your older speed. Then if it, so "IF your speed is less that 2," for instance, "THEN set speed = 0.")

My guess is that you should simply change your "key" functions to "key press" functions. GM help should clarify that a little better, it hung me for quite awhile, for being a minor thing like that.


Title: Re: Game Maker platforming novice problems
Post by: lasttea999 on September 16, 2010, 03:20:17 PM
Isn't "Keyboard" the one that can be held, and "Key Press" the one that records a single press?

Also, just in case you hadn't noticed my edit, allow me to recommend Mr. Yu's tutorials again:

Part I (http://forums.tigsource.com/index.php?topic=3251.0)
Part II (http://forums.tigsource.com/index.php?topic=3630.0)
Part III (http://forums.tigsource.com/index.php?topic=4325.0)
Part IV (http://forums.tigsource.com/index.php?topic=8432.0)


Title: Re: Game Maker platforming novice problems
Post by: paulkowalewski on September 16, 2010, 07:48:08 PM
Thanks, guys, I'm going to look into all that stuff next time I can. Right now I have some other unrelated problems I'm working on troubleshooting, the whole game is programmed in a really roundabout sloppy way but it manages to work. I think I actually will post it to more than just my friends, but I'd have to clean up some earlier stuff and change some sprites. So, I guess I'll show you guys it when I'm done.


Title: Re: Game Maker platforming novice problems
Post by: lasttea999 on September 16, 2010, 10:01:03 PM
Looking forward to it, sir!  ;D  Feel free to post more questions.