GW: Bloddy Camp

Started by Gatobot14, August 26, 2015, 12:41:07 AM

Previous topic - Next topic

Gatobot14

Another game for the ludum dare 33 i made it under 3 days
if you want to play it go here http://gamejolt.com/games/gw-bloddy-camp/88550

Everything goes well with jpct but doing collision(Ellipsoid collision) really make things a bit slower
so i have to remove a few of them, it also didnt resolve well when the player an another entity
end up in the same place(weird things happend) .

EgonOlsen

Ellipsoid collision detection can't resolve existing collisions. It can only prevent them from happening in the first place. Existing collisions should be handled different (either with spherical collision detection as an additional step or with some simple distance check or whatever).
About your performance issues...how many checks did you do per frame and at which number of iterations?

Gatobot14

well for the ellipsoid collision i have 5 monsters, all of them moving with a collision depth of 2,
ok i undesrtand that ellipsoid  can't resolve existing collisions and is the only way ive been using
but could you explain more on this:
Quote
Existing collisions should be handled different (either with spherical collision detection as an additional step or with some simple distance check or whatever).

i would like to know because if the player gets in the same place of a monster they both collision and start to floating  ;D
for now i only move the monster if they are close to the player and everything works smooth

EgonOlsen

What you mean by "floating" in this case? Do they move up?

Gatobot14

yes they go up to the sky

EgonOlsen

Sorry, I forgot about this question...it happens most likel, because your ellipsoid climbs up the polygon mesh of the collision target. You can try to work against it by setting the y-coordinate of the corrected translation to 0. But that usually leads to entities moving into each other. A better solution is to use a collision mesh like a cylinder instead of the actual polygon mesh. To do this, at such a collision mesh as a child to the actual mesh but make it in visible expect during the collision detection phase.

Gatobot14

instead of polygon mesh i already attached a ellipsoid from primitives class made of 16 polygons, the collision happens between the player ellipsoid and the enemy ellipsoid, also the ellipsoid its use for the collision avoidance.
I understand you that player can climb the enemy beacuse of the shape of the ellipsoid and the enemy ellipsoid its a bit smaller,
so using a cillinder will resolve most of the issue player vs enemy, and using a ellipsoid for collision avoidance,
could these be good??

im using a ellipsoid primitive because i think i will be good using with "checkCollisionEllipsoid"

EgonOlsen

Yes, using a cyclinder instead sounds like a good idea. Either that or a box. It depends on the actual shape for your collision targets.

Gatobot14

ok just one last question(for educational purpose):  the shape used for collision does not have to match the methods in the api??
for example: you suggest using a cillinder, there should be a checkCollisionCillinder????
just wondering  ::)

i will try to fix my collision according to your advice
many thanks

EgonOlsen

Quote from: Gatobot14 on September 09, 2015, 08:11:13 PM
ok just one last question(for educational purpose):  the shape used for collision does not have to match the methods in the api??
for example: you suggest using a cillinder, there should be a checkCollisionCillinder????
just wondering  ::)
No. The name of the method refers to the primitive used to approximate the collision source. The collision always happens primitive (like ray, sphere, ellipsoid) against mesh, which can be anything.