|
Intense Pathfinding 2 Problem GER/ENG
#257127
03/20/09 16:48
03/20/09 16:48
|
Joined: Apr 2006
Posts: 273 Germany, NRW
Meerkat
OP
Member
|
OP
Member
Joined: Apr 2006
Posts: 273
Germany, NRW
|
Hi an alle die Intense Pathfinding 2 nutzen, ich habe da folgendes Problem. Ich versuche ja auch IP2 zu benutzen (warum sollte ich das Rad neu erfinden?), aber mir ist aufgefallen das sobald ich die Prüfung rauswerfe wo geschaut wird ob eine Einheit selektiert ist, die hälfte des Pathfindings nicht mehr funktioniert. Ebenso stört mich das sehr seltsame System womit er die Bewegung und Animation eingebaut hat. Damit komm ich zum frecken nicht klar. Ich fänds super von dir (der grad liest) wenn du mir bitte sagen könntest was ich jetzt von dem Template in mein Projekt packen muss damit es normal funktioniert das ich ein Teammitglied rumschicken kann, oder Feine mich angreifen, bla. Den Basisteil halt.  Ich habe rausgefunden das folgende Funktionen sehr wichtig sind. Load_Graph, RegisterMe, RegisterDynamicEntity, ChoosePosition. Mit "is_Action_Move_To(0,0,0,eTarget);" bewege ich ja den Charakter. Nur wie bewege ich als Spieler mit meinem Char auf Knopfdruck den Kollegen? Das is ja alles auf "my" pointer gelegt. Mit freundlichem Gruß: Rudi Edit: Das Handbuch habe ich oft genug aufgehabt, es spuckt einfach keine genauen Antworten auf meine Fragen auf.  Da steht leider nur wie man eine Entity registriert, und wie man die mit dem "my" Pointer rumschickt. /************************************************************/ Hi all they are using Intense Pathfinding 2, i have the following problem. I try to use IP2, (it is not needet te rebuild pathfinding code), but if i remove the mouse point & click movement, the half of the pathfinding code don't running anymore. And i don't understand the movement and animation code. Isn't there a chance that i can build in my own move and animation code? How i have to costumize this template to let it work for my own needs. I need to send in 1st/3rd Person View my Teams to positions with a single key, that i have to target with my crosshair. Or enemies are attacking me and so on. I've find out that following functions are really important for pathfinding: Load_Graph, RegisterMe, RegisterDynamicEntity, ChoosePosition. With "is_Action_Move_To(0,0,0,eTarget);" i move the character with "my" pointer. But how, i send my team with a button press on keyboard to this location with my crosshair as target? Friendly greets: Rudi Edit: I have opened the manual very often, but it dont give me answer to my questions. There is only standing how i can send a entity with "my" pointer.
Last edited by Meerkat; 03/21/09 08:28.
http://www.gpi-studios.comOS: Windows 7 Home Premium (64 Bit Version) AMD Athlon 64 X2 Dual Core Processor 5200+ 6gb DDR 2 - RAM NVIDIA GeForce GTX 460 GameStudio Version A8 Commercial
|
|
|
Re: Intense Pathfinding 2 Problem [GER]
[Re: Meerkat]
#257176
03/21/09 08:12
03/21/09 08:12
|
Joined: Apr 2006
Posts: 273 Germany, NRW
Meerkat
OP
Member
|
OP
Member
Joined: Apr 2006
Posts: 273
Germany, NRW
|
Najoar. ^^ Also irgendwie denkt man ja das die KI mit ein Basisstück ein jedes Spiel is, und da hier viele an Projekten arbeiten würd man annehmen das ihr damit auch arbeitet.  Weiss denn wirklich niemand bescheid? Ich hatte mir zwar Intense X gekauft, aber da is das noch schwerer raus zu finden und viel zu unflexibel meiner Meinung nach da dort kein Menü existiert usw. . Haaaaalp! ^^
http://www.gpi-studios.comOS: Windows 7 Home Premium (64 Bit Version) AMD Athlon 64 X2 Dual Core Processor 5200+ 6gb DDR 2 - RAM NVIDIA GeForce GTX 460 GameStudio Version A8 Commercial
|
|
|
Re: Intense Pathfinding 2 Problem [GER]
[Re: Meerkat]
#257199
03/21/09 12:10
03/21/09 12:10
|
Fear411
Unregistered
|
Fear411
Unregistered
|
Nur wie bewege ich als Spieler mit meinem Char auf Knopfdruck den Kollegen? Das is ja alles auf "my" pointer gelegt.
du musst eine funktion schreiben, die auf knopfdruck irgendeine Position festlegt (mit c_trace oder was auch immer) und dann musst du is_Action_Move_To(0,0,0,eTarget); mit der position aufrufen. Das ist meine goto Funktion:
void ki_go_to(ENTITY* goto_ent,target_x,target_y,target_z)
{
var ValidPosition=IS_TRUE;
var FoundPath=IS_FALSE;
var MyOriginHeight;
var HitVerticalWall=IS_FALSE;
VECTOR temp;
VECTOR is_temp2;
//Kill previous Red lines
ixT_particle_DestroyLines(IS_NOCOLOUR);
//Find the origint point of the Agent
goto_ent = id_to_ptr(1);
MyOriginHeight = goto_ent.min_z*(-1);
TargetPosX = target_x;
TargetPosY = target_y;
TargetPosZ = target_z;
int i,j;
for (i=1;i<=entity_count;i++)
{
my=id_to_ptr(i);
if (my==you)
{
for (j=1;j<=entity_count;j++)
{
my=id_to_ptr(j);
}
vec_set(Debug_tp.x,vector(0,0,-1000));
return;
}
}
//Wait for the previous action to finish
wait(1);
//If Nothing is hit mark position as invalid
if (!trace_hit) {ValidPosition=IS_FALSE;}
//If position found is inside solid block, mark it as invalid
if (c_content(vector(target.x,target.y,target.z+20),0)==3) {ValidPosition=IS_FALSE; HitVerticalWall=IS_TRUE;}
//Figure out of position is in the air due to player clicking on a steep vertical surface
if (ValidPosition)
{
//Downwards trace to check if position is hovering on air
c_trace(vector(target.x,target.y,target.z+20),vector(target.x,target.y,target.z-MyOriginHeight),IGNORE_PASSABLE+IGNORE_PASSENTS);
//If Nothing is hit on the downwards trace, mark position as invalid
if (!trace_hit) {ValidPosition=IS_FALSE; HitVerticalWall=IS_TRUE;}
}
//If the position found is on a vertical wall, attempt to find a valid position nearby
if (HitVerticalWall)
{
//Find a new Offset Target Position, a little further away from the vertical wall
is_CalculateMidPoint(camera.x,vector(TargetPosX,TargetPosY,TargetPosZ+20),vec_dist(camera.x,vector(TargetPosX,TargetPosY,TargetPosZ+20))-is_ai_WallOffset,OffsetTargetPos);
//Save the result as the new Target Position
TargetPosX=OffsetTargetPos.x;
TargetPosY=OffsetTargetPos.y;
TargetPosZ=OffsetTargetPos.z;
//Make the Position Valid Again
ValidPosition=IS_TRUE;
HitVerticalWall=IS_FALSE;
}
if (ValidPosition)
{
//Clamp target position to the ground
ClampPosition(vector(TargetPosX,TargetPosY,TargetPosZ+20),MyOriginHeight,is_temp2);
//Save the result as the final Target Position
TargetPosX=is_temp2.x;
TargetPosY=is_temp2.y;
TargetPosZ=is_temp2.z;
for (i=1;i<=entity_count;i++)
{
goto_ent=id_to_ptr(i);
if (goto_ent)
{
my = goto_ent;
FoundPath=is_Action_Move_To(TargetPosX,TargetPosY,TargetPosZ,goto_ent);
}
}
}
//Color the X model green if Path was found, or red otherwise
/*if (FoundPath)
{
if (goto_ent)
Debug_tp.skin=IS_GREEN;
}
else
{
if (goto_ent)
Debug_tp.skin=IS_RED;
}*/
//Set the position of the X model to the Position the Npc is commanded to go to
//vec_set(Debug_tp.x,vector(TargetPosX,TargetPosY,TargetPosZ));
vec_set(Debug_tp.x,vector(TargetPosX,TargetPosY,TargetPosZ));
}
Das kannst du aus der is_agentaction oder so rausschreiben und rausfinden
|
|
|
Re: Intense Pathfinding 2 Problem [GER]
[Re: ]
#257204
03/21/09 12:56
03/21/09 12:56
|
Joined: Apr 2006
Posts: 273 Germany, NRW
Meerkat
OP
Member
|
OP
Member
Joined: Apr 2006
Posts: 273
Germany, NRW
|
Okay okay, pathfinding is running now. But not really correct. He trying to run through a wall. O_o' What can be wrong here?
http://www.gpi-studios.comOS: Windows 7 Home Premium (64 Bit Version) AMD Athlon 64 X2 Dual Core Processor 5200+ 6gb DDR 2 - RAM NVIDIA GeForce GTX 460 GameStudio Version A8 Commercial
|
|
|
Re: Intense Pathfinding 2 Problem [GER]
[Re: Meerkat]
#257309
03/22/09 15:14
03/22/09 15:14
|
Fear411
Unregistered
|
Fear411
Unregistered
|
do you generated the graph?
Last edited by Fear411; 03/22/09 15:14.
|
|
|
Re: Intense Pathfinding 2 Problem [GER]
[Re: ]
#257320
03/22/09 16:56
03/22/09 16:56
|
Joined: Apr 2006
Posts: 273 Germany, NRW
Meerkat
OP
Member
|
OP
Member
Joined: Apr 2006
Posts: 273
Germany, NRW
|
Japs, hab ich. Und eingebunden isser auch. ^^ Also bis jetzt funzt wesentlich mehr als vorher. Nu is jetzt der Fall das wenn ich nicht in Sichtweite von dem zu sendenden NPC bin, das heißt um die Ecke stehe, das der dann die Route nicht ausfindig macht. Woran könnte das liegen?
http://www.gpi-studios.comOS: Windows 7 Home Premium (64 Bit Version) AMD Athlon 64 X2 Dual Core Processor 5200+ 6gb DDR 2 - RAM NVIDIA GeForce GTX 460 GameStudio Version A8 Commercial
|
|
|
Re: Intense Pathfinding 2 Problem [GER]
[Re: Meerkat]
#257321
03/22/09 17:07
03/22/09 17:07
|
Fear411
Unregistered
|
Fear411
Unregistered
|
also er soll die Route zum Spieler finden?
|
|
|
Re: Intense Pathfinding 2 Problem [GER]
[Re: ]
#257322
03/22/09 17:09
03/22/09 17:09
|
Joined: Apr 2006
Posts: 273 Germany, NRW
Meerkat
OP
Member
|
OP
Member
Joined: Apr 2006
Posts: 273
Germany, NRW
|
Er soll die Route zu meinen Positionsangaben finden. Ich glaube das Problem gefunden zu haben. "void ix_MouseSelection()" hätte ich mal beachten sollen. Ich muss zuerst scheinbar die Koordinate angeben, und danach ChoosePosition() auslösen. ^^
http://www.gpi-studios.comOS: Windows 7 Home Premium (64 Bit Version) AMD Athlon 64 X2 Dual Core Processor 5200+ 6gb DDR 2 - RAM NVIDIA GeForce GTX 460 GameStudio Version A8 Commercial
|
|
|
Re: Intense Pathfinding 2 Problem [GER]
[Re: Meerkat]
#257323
03/22/09 17:14
03/22/09 17:14
|
Fear411
Unregistered
|
Fear411
Unregistered
|
|
|
|
Re: Intense Pathfinding 2 Problem [GER]
[Re: ]
#257324
03/22/09 17:18
03/22/09 17:18
|
Joined: Apr 2006
Posts: 273 Germany, NRW
Meerkat
OP
Member
|
OP
Member
Joined: Apr 2006
Posts: 273
Germany, NRW
|
Nope, leider nit. Ich hab auch grad was gaaaanz tolles rausgefunden. X_X Wenn ich meinen Soldaten kommandier dann erhöht sich die functionenzahl unaufhörlich. Waaaaaahhh. Herrgott im Himmel, was mach ich falsch? Offensichtlich zuviel! 
http://www.gpi-studios.comOS: Windows 7 Home Premium (64 Bit Version) AMD Athlon 64 X2 Dual Core Processor 5200+ 6gb DDR 2 - RAM NVIDIA GeForce GTX 460 GameStudio Version A8 Commercial
|
|
|
|