I was looking around openRPGMaker and it has a really cool feature, called passability.
What it does is, you can select in the editor the area where you allow the player to be able to pass through or jump through.
If you don’t select an area, that is not passable or jumpable by the player.
Here is a tutorial video that demonstrate how it works in openRPGMaker:
I think something similar would be really cool in GD, this way we don’t have to set Z order and collision between hundreds of objects in thousend of different conditions on a bunch of layer, simply we could just select the area inside the editor if it passable, not passable or jumpable on the specified layer.
Becasue in GD no collision applied anywhere by default it would work a bit different. Instead of selecting area to be passable, we could select area to be “not passable” on the specified layer, so the player can’t pass through the selected area on the specified layer, but if we move the player object to an other layer, player can pass through, as/if no area is selected on the layer or we could select the area as jumpable, in this case the player can’t pass through but can jump through. Though, we could also select areas to be “passable” to force the engine to render player object above everything in the selected area.
To identify player object, we could use object variables. If a specified object variable is present, the object (the owner of the variable) can be considered as a “player” and apply passability rules to it or we could select in object or passability properties if an object is a “player”.
To identify when player is jumping, we could simply select a key or key combination as “jump key” in object or passability properties, when the key(s) is pressed, that would mean, the player is jumping and apply the jump rules to it in jump areas.
I think this can be a very practical way to setup collision between player and the game world individually on every layer.
Just watch the video, I love it.
In RPG Maker and its clones, everything is done using a grid system, so it’s quite easy to offer such a feature. But it’s not so hard to add collisions in Game Develop: Just add an event with a single action: Separate “Player object” and “Obstacle”.
Then create a group named Obstacle containing all the objects that should prevent the “Player object” from passing through and it’s done!
The action uses a sophisticated algorithm that work for all kind of collision mask, from single rectangles to complex polygons.
Yeah, but using objects is more powerful: You can dynamically move, resize, rotate, add or remove such areas during the game! This is a lot more flexible and more powerful, and you can even use hidden objects used to create invisible wall, and make these objects visible if you need to debug the area
True, but I thought about that, this kind of (passability) system can be really helpful in more complex cases, when collision, also depends on location, layer and position of obstacle and player. At the moment if I come across a complex case, something similar to what you can see in the video, we have to check not only collision, also layer, and position of obstacle and player which can leads to very long events only to set collision in right places with right objects and we don’t even mentioned jumping yet. In a 2.5D isometrick world, jumping can make collision even more tricky.
We can also use an invisible object as a “collider” and use it similar way as a passability phase. We could just put the collider object in place and scale it to the right size and set it invisible in the game. This is the nice thing about GD, everything is possible one way or another. BUT it is not necessarily means that, it would be useless to implement features to make already possible things even more easier, faster and practical to do.
Just think about that how easy, fast and practical would be to simply draw (select) in the editor where you want to apply collision for any case or only if player don’t jump. You don’t have to use events just draw it, select it. Player can’t pass here, player can jump there, player can walk on this or under this right here but not over there…independently from objects and no long codes or events only draw/select in the editor, how cool is that. Anyway, I think it is.