Thanks! It Is Working Now!
#3513 posted by
ranger on 2024/12/26 19:29:06
But sadly i'm getting a very bizarre unrelated bug?
Host_Error:PR_ExecuteProgram: Null Function
I even restored the original unedited monster code and it's still having the error?
Nvm I Figured It Out It Was An Properly Coded Animation
#3514 posted by
ranger on 2024/12/26 20:18:23
Regarding Monster AI
#3515 posted by
ranger on 2024/12/26 20:30:09
I was wondering how to improve it?
like even simple pathfinding? (funnily enough the Vore bomb has better cornering than the actual vore/monsters)
or being able to go up and down reasonable heights?
and how to change the angle before the monster can shoot? because seems grunt can shoot the player before his barrel is even pointed straight at the player?
and how to change the max & min "tilt" angles for monsters? because want some monsters to not be able to shoot at enemies at are at too steep angles
(this is what i have so far but honestly i don't really know what i am doing - very new at this)
---
float CheckMonsterJump(entity self)
{
vector start, end;
// Check ground below
start = self.origin;
end = start;
end_z = end_z - 64; // Adjust drop height check
traceline(start, end, TRUE, self);
if (trace_fraction == 1)
return FALSE; // Too high to drop
if (trace_fraction < 1)
{
// Safe to drop - within acceptable height
if ((start_z - trace_endpos_z) <= 64)
{
self.flags = self.flags - (self.flags & FL_ONGROUND);
self.velocity_z = -300; // Adjust drop speed
return TRUE;
}
}
// Check for jumpable height
start = self.origin;
end = start;
end_z = end_z + 32; // Jump check height
traceline(start, end, TRUE, self);
if (trace_fraction == 1)
{
self.velocity_z = 300; // Jump velocity
return TRUE;
}
return FALSE;
}
float TryAlternativePath(entity self)
{
vector dir, right, left, start, end;
float right_clear, left_clear;
// Get perpendicular directions
dir = normalize(self.enemy.origin - self.origin);
right = '0 0 0';
right_x = dir_y;
right_y = -dir_x;
left = -right;
// Check right path
start = self.origin;
end = start + (right * 128); // Adjust side check distance
traceline(start, end, TRUE, self);
right_clear = trace_fraction;
// Check left path
end = start + (left * 128);
traceline(start, end, TRUE, self);
left_clear = trace_fraction;
if (right_clear > left_clear)
{
self.ideal_yaw = vectoyaw(right);
return TRUE;
}
else if (left_clear > right_clear)
{
self.ideal_yaw = vectoyaw(left);
return TRUE;
}
return FALSE;
}
AI Tutorials
#3516 posted by
Preach on 2024/12/26 23:11:18
The gold standard for quake AI tutorials are found at the “AI cafe”.
https://web.archive.org/web/20080603081043/http://minion.planetquake.gamespy.com:80/tutorial/main.htm
There are several tutorials about navigation. But bear in mind there’s no magic wand to switch perfect navigation on. Most modern games get better navigation by tagging their levels with lots of metadata. In Quake levels that don’t have any, you’ll never get the same results.
Also tutorials there about aiming. But bear in mind that the current aiming for grunts is
1 aim exactly at the player
2 “correct” the aim to slightly behind where they are now
The point I’m circling is that fun AI needs to be imperfect. Making them shoot the way they are facing is a simple change. The hard part is making them rotate in such a way that they are still fun to fight when they fire straight.