• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Design 2d platformer fundamental design

S

Snayff

Guest
Morning all,

Having read around I understand, like most things, there are more than a few ways to handle the underlying design of platformer. The main ones I have seen mentioned are grid and tile based, with two other prominent ones being bitmask and vectorial. There is a great article in the stickied post about design articles which talks about these but I would like to know how people have found implementing these.

Which approach did you choose and why? What were the advantages or disadvantages of that approach? Are there additional layers of complexity to that method?

Hopefully this is more of a discussion than a exposition of the objective best - though if there is an objective best it'll make life easier (and be a first!)

-Snayff
 

Yal

🐧 *penguin noises*
GMC Elder
I think what's the best method depends a lot on what type of game you want to make - is the platforming the game's main focus (e.g. Super Meat Boy, N++) or is it a means to an end (e.g. Axiom Verge, metroidvanias)? If the game is all about platforming, picking a method that lets you do interesting new types of challenges is the best option, so something like a vectorial engine, or using bitmasks to allow for arbitrary slopes, would be the better choice. If the game will mostly be about fighting enemies and the platforming is just there to let you dodge and take cover, a simple tile-based engine is enough... and generally even preferable, since it makes the environments easier to read so the player can focus more on the combat aspect. I'm pretty sure there's no objective best or worst option here :p
 
S

Snayff

Guest
@Yal thanks for the reply - and glad to hear there is merit in the discussion!

My intention is that it is more along the lines of dead cells or castlevania; fighting is the focus not the platforming element. The platforms are not expected to be more than a physical space to allow for the action to take place.

Is there an expectation difference in using a tile or grid based system? I.e. how to structure other elements of the game based on that decision? From reading it seems grid based requires that movement is handled on a grid system or exceptions are managed if it isn't.

If grid based is the way to go then we have at least narrowed down the required reading I need to do before implementation!
 

Yal

🐧 *penguin noises*
GMC Elder
Dead Cells is kinda interesting... as far as I know, it has a tile-based system, everything is basically a rectangular block. So platforming definitely is a means to an end in this case, and the combat system is the main focus.

Grid-based and tiles... tiles need to be aligned to a grid (in GMS2 and any other engine that uses a proper tilemap), but for the sake of this discussion I'll assume 'grid-based' means that movement is also aligned to a grid, so movement is done in well-defined increments. For instance, you always move 1 grid cell when you move horizontally, and so on. I'd generally advocate against this because it makes movement feel stiff and removes control from the player, but it has a bunch of benefits:
  • It's easier to control movement for players with low dexterity
  • You can mathematically check whether a level is possible to beat, making it easier to use with procedural generation
  • You only need to check a single cell for collision checking purposes, and stuff like enemies' AI gets much easier when everything is done in increments of known size.
Tile approaches basically has a grid but it doesn't affect movement, only level design. You can prettty easily check a cell in the grid using an x/y position in the room since you know the grid's origin and the size of a cell, it's just a matter of pretty simple maths to convert (xcell = xpos div gridsize, since the origins overlap in GM, where div is the integer division operator).
 
S

Snayff

Guest
Dead cells is quite the inspiration, though I don't intend to try to copy it whole cloth. The basic platforming is pretty much what I think I want to achieve. However, I thought it best to start the discussion asking about methods in general, rather than narrowing myself down from the start!

Would a plausible approach be to shrink the grid to small proportions so that the smallest movement increment was already reasonable? Presumably that would add computational overhead though?

Tile sounds preferable; it sounds like it is still quite easy to determine locations but allows for more fluidity/gradation. Any fundamental challenges you would warn of, such as things that become hard to do with this method?
 

Yal

🐧 *penguin noises*
GMC Elder
Tile sounds preferable; it sounds like it is still quite easy to determine locations but allows for more fluidity/gradation. Any fundamental challenges you would warn of, such as things that become hard to do with this method?
  • Moving platforms needs to be objects (since tiles don't move), so build your logic around allowing this from the beginning if there's any chance you'll add moving platforms later.
  • With tiles, you can only get info about whether a cell contains a tile or not, and also which tile in the set is in the cell, but you can't get collision data. To have slopes and such, you'll need to have a system for certain tiles being slope tiles and then compute collision data using tile IDs. (How to do this differs a bit between GMS1 and GMS2)
  • In GMS1, there's no way to enumerate or name layers, so you need to make sure the tile layer used for collision tiles has the same depth value in every room.
 
S

Snayff

Guest
You're a star, @Yal , thank you very much for your input. You have given me lots to think about!

Onward to Tile implementation!
 
  • Like
Reactions: Yal
S

Snayff

Guest
@Yal and I just saw you have a platformer engine for sale on itch! I want to build my own from scratch, mostly to learn, but I expect it will be a good reference guide. What approach did you use in that?
 
Which approach did you choose and why? What were the advantages or disadvantages of that approach? Are there additional layers of complexity to that method?
I was practically raised on Metroidvanias so what better game to develop than a Metroidvania? They are the "superior" game genre, after all.

Advantages:
- I've noticed a large part of the gaming community seems to enjoy playing these if done correctly.
- There's a lot of great design inspiration out there.
- It's what I know best. ;)

Disadvantages:

- In my opinion, they are one of the hardest games to design.
- They are easy to mess up. (Sorta ties in with the first point)
- Every detail counts.
Additional layers of complexity?
- Striking a balance between mechanics, level design, and story is harder than it may seem (depending on the game of course).
- Making it to where the player doesn't loose their objective while lost in the world can be a challenge. In other words, keeping the players' interest.
- And whatever else I can't think of right now lol.​
 

Yal

🐧 *penguin noises*
GMC Elder
@Yal and I just saw you have a platformer engine for sale on itch! I want to build my own from scratch, mostly to learn, but I expect it will be a good reference guide. What approach did you use in that?
MariaEngine uses objects for everything, one of the main selling points is how it has moving platforms and jumpthrough platforms that every object reacts to (player, items, enemies) and the logic is based around all platforms inheriting from a terrain parent object. Maybe not the best implementation, but it means you don't have to have two separate cases :p
(also probably was a pretty good idea for forwards compatibility since GMS2 changed how tiles works dramatically)

There's also some functionality in place that lets you just stretch out most level design objects and they automatically adapt their graphics to it, so you can keep instance counts low. I've seen a ton of horrific games where people place tons of invisible wall objects rather than stretching them... even made some myself in the past x3
 
S

Snayff

Guest
@CardinalCoder64
Haha, I have to say I missed both the metroid' and 'vania games, until a few years ago with Dust and more recently Dead Cells, so I can't comment so much on their superiority. I'll take your word for it! ;)

Do you have any examples of design you would recommend?

From a technical perspective how do you structure the map in your platformer games? Do you utilise a tile based system as Yal suggested? And what do you think is easy to mess up about them?

If I said that Dead Cells is my current inspiration would that change your perspective at all?

@Yal
MariaEngine (interesting name!) purchased and I look forward to rooting through it. The tutorial series I have just finished was primarily object based so I am hopeful I wont be too lost. Thank you for your help!

(And hopefully I wont need any invisible walls! ;) )
 
Last edited by a moderator:

RangerX

Member
Maybe you should try classic games that created the genre too. I very highly suggest you play at the very very least:

- Super Metroid (SNES)
- Castlevania Symphony of the night (PS1)
 
I think I use a grid based system everything is based on a grid, but I have made an editor so things can be taken off the grid. Working with the grid is just so much easier. The player and enemies are free to move around. Moving platforms can do so as well.

I use 1 massive solid object for everything that doesn't move. It seems to get far better performance on lesser systems like my phone and 10+ year old computer. With my older games that use other methods, I could see Let's Plays of people with lesser computers getting poor performance with different methods as well.

Here is the 1 solid object that is untiled:



Over top of the one solid object are the tiles. Here are the tiles:



Moving things and interactive objects are their own instance.

Here is an early shot of my own little editor with the grid. Once the solid objects are made, time to place the tiles. Now I just have an auto tiler to make things so much easier. There's just no easy .gif of it to show you. Everything can be detached from the grid, but eh why bother taking the time to make things off grid? Also side note... I made the editor so my friends could make me levels and I could speed up production so naturally no one has used it:



Here is a .png export of a map with 300 rooms for a MetroidVania I was working on. Everything white is 1 solid area based on you guessed it... a grid. Since this export everything has been broken into smaller chunks:

 
S

Snayff

Guest
Thank you for taking the time to explain that, it was really interesting to read. I haven't come across people building editors in GM but it seems such a beneficial step in development. Unity has a deluge of editors on their marketplace and I was surprised to find none on the GM marketplace when I am switching over. Did it take you long to put together?

Did you set your movement to the the grid, too? It looks to smooth for that to be the case.
 
Every movement in the game is independent from the grid. So maybe that makes my system NOT grid based even if the levels are?

As for my own editor its a few days to setup and then just using it every day for a few weeks or months I add features and smooth things out.

This is my third in game editor. 2 were for platformers and 1 was for a shmup. The shmup editor looks far better and has far more user features and I need to upgrade the platform editor to look better.
 
I took the time to evaluate whether I do a grid collision system and from the look of it I don't. I even took the time to ponder the logistics of implementing one, but I think with so many moving parts, moving platforms and falling boxes, I have to have something that isn't based on a collision grid. Maybe if my levels were just static it would be easier and I'd probably get more frames per second.
 
S

Snayff

Guest
Thanks for clarifying @sitebender . (not sure why I didn't get an alert!)

I believe the grid based collision system works fine with moving platforms and the like, so perhaps something to consider on your next game? Unlikely to be worth it with you already having to much in place.

Without derailing this thread too much, how did you implement the editor? Is it a room or something like that?
 
Thanks for clarifying @sitebender . (not sure why I didn't get an alert!)

I believe the grid based collision system works fine with moving platforms and the like, so perhaps something to consider on your next game? Unlikely to be worth it with you already having to much in place.

Without derailing this thread too much, how did you implement the editor? Is it a room or something like that?
The editor at this point just runs over top of a real level. Everything in the level is reset to its original starting point and frozen. It should probably be recreated so its not taking place during the actual game.

I think my games only have 5 rooms.
- Run first (things that only need to be set once like importing external files)
- company logo (the logo uses built in GameMaker physics so it was just easier)
- reset game (to reset variables since game_reset keeps the variables without doing a bunch of stuff that only needs to be done once)
- game room
- next map room (clear out map and take you back to the game room).
 
Top