|
Re: Entities getting stuck
[Re: rtsgamer706]
#435278
01/05/14 14:18
01/05/14 14:18
|
Joined: Jan 2002
Posts: 4,225 Germany / Essen
Uhrwerk
Expert
|
Expert
Joined: Jan 2002
Posts: 4,225
Germany / Essen
|
You could post in the gamestudio forums and describe the problem there. If you include the corresponding code in your post someone may be able to help you.
Always learn from history, to be sure you make the same mistakes again...
|
|
|
Re: Entities getting stuck
[Re: rtsgamer706]
#435280
01/05/14 15:16
01/05/14 15:16
|
Joined: Dec 2009
Posts: 361
rtsgamer706
OP
Senior Member
|
OP
Senior Member
Joined: Dec 2009
Posts: 361
|
maybe this will help. I'm using:
vec_set (temp, pOne.x);
vec_sub (temp, my.x);
vec_to_angle(my.pan, temp);
to have the entities face player one, and am just using a c_move command to have them move forwards so they "chase" the player. If I only have one enemy there's no problems but when I have two, because they are both facing the player, they get stuck on each other during movement.
|
|
|
Re: Entities getting stuck
[Re: rtsgamer706]
#435282
01/05/14 15:44
01/05/14 15:44
|
Joined: Jan 2002
Posts: 4,225 Germany / Essen
Uhrwerk
Expert
|
Expert
Joined: Jan 2002
Posts: 4,225
Germany / Essen
|
But the problem isn't with my code, Then you're screwed anyways because you can't change a thing, right? it's just that in G8 when you're using c_move commands and two non passable entities collide, 1 stops moving. Of course one stops moving because otherwise it would end up inside the other one. Btw. there is always exactly one entity moving. You cannot move two objects at the same time. Have you set the glide flag? What part of my code would I need to show? The relevant one ...
Always learn from history, to be sure you make the same mistakes again...
|
|
|
Re: Entities getting stuck
[Re: Uhrwerk]
#435283
01/05/14 15:48
01/05/14 15:48
|
Joined: Dec 2009
Posts: 361
rtsgamer706
OP
Senior Member
|
OP
Senior Member
Joined: Dec 2009
Posts: 361
|
1. Yes I have told them to glide 2. I don't know which part is exactly relevant since my question is about how the collision engine works so here is the entire action that the enemies run:
action enemy()
{
c_setminmax(me);
my.emask |= (ENABLE_IMPACT);
my.event = hit_enemy;
my.health = 20;
my.damage = 0; //1 = took damage (invinci timer)
var temp;
while (my.health >= 1)
{
vec_set (temp, pOne.x);
vec_sub (temp, my.x);
vec_to_angle(my.pan, temp);
c_move(me, vector(3*time_step,0,0), nullvector, IGNORE_PASSABLE | GLIDE);
// DEBUG_VAR(my.health, my.y);
if (my.damage == 1)
{
set (my, PASSABLE);
wait(30);
reset(my, PASSABLE);
my.damage = 0;
}
wait(1);
}
ent_remove(me);
}
|
|
|
Re: Entities getting stuck
[Re: rtsgamer706]
#435288
01/05/14 17:50
01/05/14 17:50
|
Joined: Jul 2008
Posts: 2,107 Germany
rayp
X
|
X
Joined: Jul 2008
Posts: 2,107
Germany
|
U should read about "narrow" and "fat", "obstacle avoidence" and "pathfinding". Did u thought a 3d engine handles "correct" movement of models by itself ? If so, no, they wont. ^^ Take a look at Superku's pathfinding.c included in the goodies.zip, if its up to easy non-cost pathfinding. Edit: Ull find a simple and good oa at bottom of this post: http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=428514
Last edited by rayp; 01/05/14 18:24. Reason: added link to oa example
Acknex umgibt uns...zwischen Dir, mir, dem Stein dort... "Hey Griswold ... where u gonna put a tree that big ?" 1998 i married my loved wife ... Sheeva from Mortal Kombat, not Evil-Lyn as might have been expected rayp.flags |= UNTOUCHABLE;
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|