Jump to content

  • Log In with Google      Sign In   
  • Create Account


Megalukes

Member Since 01 Feb 2013
Offline Last Active Feb 05 2013 05:50 PM
-----

Posts I've Made

In Topic: Bigger Hitboxes in a Tile based sidescroller

02 February 2013 - 04:46 PM

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.

 

Ah, now I get it. I realized what happens here. Even though the hitbox's size is bigger than the tilesize, it checks each side correctly, but it never checks the middle of the hitbox while moving, that's why it gets inside the tiles. It also occurs because, as you said, it checks just one cell at a time:

mapateste-654_zps1b9f5a4d.png

Ok then, I guess I should try to do what you said: inserting objects into multiple cells. I have to make some little changes in my code, but I guess it may work.
Thank you very much. If I succeed with that I'll tell you biggrin.png


In Topic: Bigger Hitboxes in a Tile based sidescroller

01 February 2013 - 06:30 PM

Oh, I see. That's actually what I'm doing here. But it seems that's a normal issue.
I found out that there's no solution for that. According to Metanet Software:

The one problem with our approach is that all dynamic objects must be smaller than a grid cell; while this limitation can be circumvented (for instance, by representing a single large object as multiple smaller objects), in actionscript, it really helps keep things running fast. Thus, it was a self-imposed design constraint.

 

So I guess the best option I've got is using multiple hitboxes for each character object.


PARTNERS