Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


#ActualMilcho

Posted 01 February 2013 - 09:07 PM

That's one possibility yes.
I actually went through the metanet tutorials when I was writing the physics of my engine about a month ago. From my understanding, their design limitations to which you are referring to are because they keep each collision shape 'inserted' into only 1 grid cell at a time - thus they only check the 9 cells (1 + 8 surrounding) for collision.
If you started inserting the object into multiple grid cells, you could collide with it fine.

However, I too broke down my character into smaller shapes, but for totally different reasons (I wanted to have a taller but thinner collision shape, that also could 'lean' as the ninja in n does (which in their game is achieved by making him one big circle in terms of collision) - and rectangle collision shapes can't be rotated, so I went with multiple circles instead)
Example:
nvNfTQgs.png
There's a third circle between the two.

However, I do use objects in a way such that they are bigger than 1 tile size. The objects get collided with the player (well, technically the player collides with them, not the other way around), but in principle, bigger objects like that will work.
At least, I'm planning on testing that because I have to write some NPCs, which I was planning to implement as just one giant rectangle that's 0.8 wide by 1.8 wide (while my tile size is 1). When I get to that, I simply plan to use the method I described above.

If you're still experiencing issues, could you perhaps trace your collision to see which tiles the collision occurs with? I'm very interested because like I said, my understanding was that by 'inserting' the object into multiple tiles should allow it to be bigger than the tile.
Edit: Shrunk the huge img

#1Milcho

Posted 01 February 2013 - 09:06 PM

That's one possibility yes.

I actually went through the metanet tutorials when I was writing the physics of my engine about a month ago. From my understanding, their design limitations to which you are referring to are because they keep each collision shape 'inserted' into only 1 grid cell at a time - thus they only check the 9 cells (1 + 8 surrounding) for collision. 

If you started inserting the object into multiple grid cells, you could collide with it fine. 

 

However, I too broke down my character into smaller shapes, but for totally different reasons (I wanted to have a taller but thinner collision shape, that also could 'lean' as the ninja in n does (which in their game is achieved by making him one big circle in terms of collision) - and rectangle collision shapes can't be rotated, so I went with multiple circles instead)

Example: 

There's a third circle between the two.

 

However, I do use objects in a way such that they are bigger than 1 tile size. The objects get collided with the player (well, technically the player collides with them, not the other way around), but in principle, bigger objects like that will work.

At least, I'm planning on testing that because I have to write some NPCs, which I was planning to implement as just one giant rectangle that's 0.8 wide by 1.8 wide (while my tile size is 1). When I get to that, I simply plan to use the method I described above.

 

If you're still experiencing issues, could you perhaps trace your collision to see which tiles the collision occurs with? I'm very interested because like I said, my understanding was that by 'inserting' the object into multiple tiles should allow it to be bigger than the tile.


PARTNERS