0
\$\begingroup\$

I'm creating a 2D platformer in MonoGame and I'm thinking of using AABB as physical colliders for characters and then have a trigger polygon collider on each character for checking for example if an enemy's weapon is touching the player, making it more precise. The polygon collider is animated so every frame in every animation has its own points. That's a lot of work. Is that precision needed? What is usually done in this situation?

\$\endgroup\$
0
\$\begingroup\$

Updating a primitive collider position is already costly, polygon colliders are really expensive by definitnion, i only use it for static objects, changing a polygon collider position is really expensive. And on top ot that changing a polygon collider actual polygon.? Its probably not a good idea, you could try but i dont thinl you will succeed. Most people use primitive colliders next to each other to fake a more complex geometry.

\$\endgroup\$
5
  • \$\begingroup\$ So, should I have an AABB for physical collisions and then some primitive trigger colliders for character collision testing that get updated depending on the animation and frame of the animation? \$\endgroup\$ – Martin Jun 23 '17 at 14:46
  • \$\begingroup\$ Yes, i wouod do that! \$\endgroup\$ – Guilherme Junqueira Coutinho Jun 23 '17 at 14:48
  • \$\begingroup\$ If you decide to try the polygon collider editing in runtime solution, let me know your results! \$\endgroup\$ – Guilherme Junqueira Coutinho Jun 23 '17 at 14:49
  • \$\begingroup\$ I don't think the performance results will be visible with just a handful of characters, but if you have tons of them in the same level the framerate might drop, but I don't know, maybe my PC is too good to be slowed down by a 2D platformer under (almost) any circumstance. The performance of a polygon collider depends on the amount of points and I try to keep it low (5-8). \$\endgroup\$ – Martin Jun 23 '17 at 15:00
  • \$\begingroup\$ But maybe the collision is not really accurate. Anyways, i wanna know it :D \$\endgroup\$ – Guilherme Junqueira Coutinho Jun 23 '17 at 15:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.