An inverted Collision boxes (for 2.5D like stages)

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
User avatar
D0NM
Party member
Posts: 203
Joined: Mon Feb 08, 2016 10:35 am
Location: Zabuyaki
Contact:

An inverted Collision boxes (for 2.5D like stages)

Post by D0NM » Fri Nov 09, 2018 7:39 pm

Hey everyone!
We make an open source game and we use Tiled as the stage editor.
It is used to set up sprites and collision polygons.
Now, I think that the approach when you have an unlimited walking area with obstacles is a complex thing to do in Tiled.
e.g. you should add more and more shapes to strict your units movements and keep the on the road.

Some pic of the Castle Crashers where they use polygons for both obstacles and walkable areas.
Image


My idea is to leave only walkable areas polygons. All the rest space is an obstacle.
(Ofc, I want to keep some platforms and slanted places in the game, too)

I need your ideas and help on how to make it more easy with existing collisions libraries: HC, Bullet...
Our LÖVE Gamedev blog Zabuyaki (an open source retro beat 'em up game). Follow @Zabuyaki.
Twitter @FaMeSoft / GP32 Free Platformer: SUPER PLUSHA
:joker: LÖVE & Lua Video Lessons in Russian / Видео уроки по LÖVE и Lua :joker:

User avatar
pgimeno
Party member
Posts: 1440
Joined: Sun Oct 18, 2015 2:58 pm

Re: An inverted Collision boxes (for 2.5D like stages)

Post by pgimeno » Wed Nov 14, 2018 2:49 pm

D0NM wrote:
Fri Nov 09, 2018 7:39 pm
My idea is to leave only walkable areas polygons. All the rest space is an obstacle.
I can see why they have polygons for obstacles too. If you have, say, a column in the middle of a rectangular walkable area, in order to turn that column into an obstacle you have to subdivide the walkable area into at least four parts, in order to leave an unwalkable hole where the column is, while from a map designer perspective, it's easier to add a rectangular obstacle where the column is.
D0NM wrote:
Fri Nov 09, 2018 7:39 pm
I need your ideas and help on how to make it more easy with existing collisions libraries: HC, Bullet...
Bullet? Do you mean Box2D?

I'd say Box2D doesn't adapt very well to 2.5D. You could perhaps create it as a top world view, without gravity, and make the slopes sensors, applying forces to the objects that pass through them depending on the angle.
Thrust II Reloaded - GifLoad for Löve - GSpöt GUI - My NotABug.org repositories - portland (mobile orientation)
The MS-Github repositories I had have been closed after the acquisition announcement and will be removed in the near future.

User avatar
D0NM
Party member
Posts: 203
Joined: Mon Feb 08, 2016 10:35 am
Location: Zabuyaki
Contact:

Re: An inverted Collision boxes (for 2.5D like stages)

Post by D0NM » Wed Nov 21, 2018 6:28 pm

pgimeno wrote:
Wed Nov 14, 2018 2:49 pm
I can see why they have polygons for obstacles too. If you have, say, a column in the middle of a rectangular walkable area, in order to turn that column into an obstacle you have to subdivide the walkable area into at least four parts, in order to leave an unwalkable hole where the column is, while from a map designer perspective, it's easier to add a rectangular obstacle where the column is.
Thank you for a good point! You're right.
pgimeno wrote:
Wed Nov 14, 2018 2:49 pm
D0NM wrote:
Fri Nov 09, 2018 7:39 pm
I need your ideas and help on how to make it more easy with existing collisions libraries: HC, Bullet...
Bullet? Do you mean Box2D?
Sorry, I mean Bump 2.0.
pgimeno wrote:
Wed Nov 14, 2018 2:49 pm
I'd say Box2D doesn't adapt very well to 2.5D. You could perhaps create it as a top world view, without gravity, and make the slopes sensors, applying forces to the objects that pass through them depending on the angle.
Some 2.5D games like "River City Ransom: Underground" use such physical engine.
Yes, I understand your idea.

Now I think to add another layer with obstacles that are passable but contain these vector forces and platform height.
I just cannot finish this idea's plan yet.
Our LÖVE Gamedev blog Zabuyaki (an open source retro beat 'em up game). Follow @Zabuyaki.
Twitter @FaMeSoft / GP32 Free Platformer: SUPER PLUSHA
:joker: LÖVE & Lua Video Lessons in Russian / Видео уроки по LÖVE и Lua :joker:

Post Reply

Who is online

Users browsing this forum: Google [Bot], orangeglo and 6 guests