So, I've been jumping from tutorial to tutorial on platformers. Most of which consist of using AdvTiledLoader, Tiled, and many lines of code I don't understand. Perhaps there is a complete and thorough tutorial on the forums, but I can't find a single one. I have made games with simple physics, but none that consist of platforming. I really want to make a platformer, but I'm just missing the knowledge to do so. If anyone can help me personally so that I could, that'd be amazing. The parts I specifically don't understand are collision algorithms with tiles.
Thanks for your time,
- redsled
[Beginner] I can't seem to grasp platformers
Re: [Beginner] I can't seem to grasp platformers
You're right that there really isn't a good platformer tutorial around, at least, not one that's easily found on the wiki or otherwise. I've seen a couple, but such a subject really should have more information, I'd think.
Re: [Beginner] I can't seem to grasp platformers
Last year when I was looking into love2d programming I was pretty sad at the lack of good tutorials on platformers. I remember reading one that was decent enough, but the author dropped it after only a couple steps
Tile-based collision is pretty simple when you get down to it though, it's arbitrary shapes and slopes that can be annoying to do. Or even, god forbid, arbitrary slopes. I shudder at the thought.
Tile-based collision is pretty simple when you get down to it though, it's arbitrary shapes and slopes that can be annoying to do. Or even, god forbid, arbitrary slopes. I shudder at the thought.
- Jasoco
- Inner party member
- Posts: 3727
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
- Contact:
Re: [Beginner] I can't seem to grasp platformers
Use Bump. It comes with a demo to help you out and while it's only a collision detection and resolution library, kikito wrote a pretty simple example of how platformer physics works in the normal demo .love.
Re: [Beginner] I can't seem to grasp platformers
HardonCollider is pretty good for collision detection.
Re: [Beginner] I can't seem to grasp platformers
I think one of the reasons you're not seeing many tutorials on the subject is that there isn't really one solution that fits all projects. How you implement it is going to vary greatly with how you want it to work.
Two of the most basic things every platformer needs is some kind of physics calculations (how the characters are affected by gravity, friction and other physical forces), and some collision testing (is the character in midair or standing on the ground?). If you want a simple tile-layout (think Super Mario Bros. for the NES), you could implement the map as a matrix of numbers, with for example 0 for air and 1 for a block (and larger numbers for different kinds of blocks, coins etc.), and collision detection will basically be one (or a few) lookup(s) in this matrix. If you want slopes or even arbitrarily shaped platforms, you're obviously going to need a more complex model of your game world, and collisions will be implemented very differently. The size also matters; if you want a huge, scrolling world, you need to take memory management into account, but if levels are small, or divided into smaller chunks, it's going to be easier. It's similar with physics: if you just want simple running and jumping, you can write just a few lines of physics and it'll work just fine, but if you want more complicated things (inertia, wind, varying gravity, swimming, flying abilites, you name it) then you're obviously going to need to do more.
I hope you understand my point: I don't think it's much about finding a tutorial on how to make a platformer; it's more about you deciding what kind of platformer you want to make and how it should work, and then trying to implement it. If you have specific questions on how to implement things, the Löve community is of course here to answer your questions
Two of the most basic things every platformer needs is some kind of physics calculations (how the characters are affected by gravity, friction and other physical forces), and some collision testing (is the character in midair or standing on the ground?). If you want a simple tile-layout (think Super Mario Bros. for the NES), you could implement the map as a matrix of numbers, with for example 0 for air and 1 for a block (and larger numbers for different kinds of blocks, coins etc.), and collision detection will basically be one (or a few) lookup(s) in this matrix. If you want slopes or even arbitrarily shaped platforms, you're obviously going to need a more complex model of your game world, and collisions will be implemented very differently. The size also matters; if you want a huge, scrolling world, you need to take memory management into account, but if levels are small, or divided into smaller chunks, it's going to be easier. It's similar with physics: if you just want simple running and jumping, you can write just a few lines of physics and it'll work just fine, but if you want more complicated things (inertia, wind, varying gravity, swimming, flying abilites, you name it) then you're obviously going to need to do more.
I hope you understand my point: I don't think it's much about finding a tutorial on how to make a platformer; it's more about you deciding what kind of platformer you want to make and how it should work, and then trying to implement it. If you have specific questions on how to implement things, the Löve community is of course here to answer your questions
My game called Hat Cat and the Obvious Crimes Against the Fundamental Laws of Physics is out now!
- Jasoco
- Inner party member
- Posts: 3727
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
- Contact:
Re: [Beginner] I can't seem to grasp platformers
Bump is good for collision detection and resolution. Sadly HardonCollider doesn't resolve collisions. Bump will make sure objects won't overlap if they're not supposed to. It's only flaw is that it only does rectangular collision. No circles, triangles or other shapes or rotated shapes.
Re: [Beginner] I can't seem to grasp platformers
Do you know of any library that does rotated shape collisions?Jasoco wrote:Bump is good for collision detection and resolution. Sadly HardonCollider doesn't resolve collisions. Bump will make sure objects won't overlap if they're not supposed to. It's only flaw is that it only does rectangular collision. No circles, triangles or other shapes or rotated shapes.
PM me on here or elsewhere if you'd like to discuss porting your game to Nintendo Switch via mazette!
personal page and a raycaster
personal page and a raycaster
- kikito
- Inner party member
- Posts: 3153
- Joined: Sat Oct 03, 2009 5:22 pm
- Location: Madrid, Spain
- Contact:
Re: [Beginner] I can't seem to grasp platformers
Platformers are deceptive. There are lots of them. We have played lots of them. They have been around for ages.
The obvious conclusion is that they must be simple to do. If there are so many, people will have "threaded that path" often. There must be libraries and tutorials and stuff. So it should be a good place to start, right?
Well, yes and no. Yes, there are lots of them, and we have played lots of them. But no, they are not a good place to start.
Here's the rub: programming even the simplest platformer is "medium" in difficulty - unless you are doing something equivalent to taking an existing, working codebase and swapping the graphics. Platformers have physic-like movements (acceleration, gravity, friction, etc) and have collision detection with (a very particular kind of) resolution. Even conceiving what all those terms are is a bit difficult when you are starting. Libraries like Bump (disclaimer: I am its developer) or HardonCollider or love.physics make these parts easy, but you still need to understand those concepts, and they are not beginner-level.
So I don't think a beginner should start with a platformer.
A much simpler genre is a shooter, like galaxian or R-type. Shooters have collision detection, but no resolution, and the movement is simple to implement. So that's my advice: if you're a beginner, start there. Leave platformers for a bit later on.
The obvious conclusion is that they must be simple to do. If there are so many, people will have "threaded that path" often. There must be libraries and tutorials and stuff. So it should be a good place to start, right?
Well, yes and no. Yes, there are lots of them, and we have played lots of them. But no, they are not a good place to start.
Here's the rub: programming even the simplest platformer is "medium" in difficulty - unless you are doing something equivalent to taking an existing, working codebase and swapping the graphics. Platformers have physic-like movements (acceleration, gravity, friction, etc) and have collision detection with (a very particular kind of) resolution. Even conceiving what all those terms are is a bit difficult when you are starting. Libraries like Bump (disclaimer: I am its developer) or HardonCollider or love.physics make these parts easy, but you still need to understand those concepts, and they are not beginner-level.
So I don't think a beginner should start with a platformer.
A much simpler genre is a shooter, like galaxian or R-type. Shooters have collision detection, but no resolution, and the movement is simple to implement. So that's my advice: if you're a beginner, start there. Leave platformers for a bit later on.
When I write def I mean function.
Re: [Beginner] I can't seem to grasp platformers
Box2dDavidobot wrote:Do you know of any library that does rotated shape collisions?Jasoco wrote:Bump is good for collision detection and resolution. Sadly HardonCollider doesn't resolve collisions. Bump will make sure objects won't overlap if they're not supposed to. It's only flaw is that it only does rectangular collision. No circles, triangles or other shapes or rotated shapes.
Who is online
Users browsing this forum: Bing [Bot] and 0 guests