News | Forum | People | FAQ | Links | Search | Register | Log in
Coding Help
This is a counterpart to the "Mapping Help" thread. If you need help with QuakeC coding, or questions about how to do some engine modification, this is the place for you! We've got a few coders here on the forum and hopefully someone knows the answer.
First | Previous | Next | Last
AI Tutorials 
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. 
Example Of Grunt's Aiming Leeway 
https://imgur.com/a/DMMkpxO

if you sneakup behind grunt and he shoots, seems there's a 60d arc where it's considered "pointing the gun at you"

This also applies to enforcers and such

trying to reduce this to 5d or less 
^It's FacingIdeal In AI.qc 
delta 
Bug Where Monster Turns Into Solid BSP But Is Still Alive 
I was following one of the tutorials to add strafing to monsters,and i think it might have caused this bug - but i am not familiar with

nothing looks wrong?

have any ideas?

if it helps i vaguely remember reading that if a fiend kills a nuclear box, it took becomes treated as BSP event though it's still alive? 
Nvm I Found The Cuase, It's FoundTarget ... I Can't See What's Wrong? 
void () FoundTarget = //causes invincible bug??
{
local entity head; //new
local float alertRadius; //new

if ( (self.enemy.flags & FL_MONSTER) || (self.enemy.classname == "player") || (self.enemy.classname == "hologram") || (self.enemy.classname == "cbot") || (self.enemy.classname == "CBot_Create")) //new
{
// let other monsters see this monster for a while
sight_entity = self;
sight_entity_time = time;
}
self.show_hostile = time + 2.00; // was 1 wake up other monsters
alertRadius = 512; // Large radius for alert spread (default was usually 1000)?


// Alert all monsters in radius
head = findradius(self.origin, alertRadius);
while(head)
{
if (head.flags & FL_MONSTER)
{
if (head != self) // Don't alert self
{
// Make other monsters aggressive
head.show_hostile = time + 2;
head.enemy = self.enemy;
head.think = head.th_run;
head.nextthink = time + random() * 0.5; // Stagger response times

// Chance to alert even more distant monsters
//if (random() < 0.3) // 30% chance
// {
// head.noise_time = time + 2; // Make noise to attract others
// }
}
}
head = head.chain;
}
//end new


SightSound ();
HuntTarget ();
}; 
Clarification 
I can't see anything in the code you posted that looks relevant. Are you getting a error message like "MOVETYPE_PUSH with a non bsp model" or are you just seeing a monster that's frozen solid and invulnerable?

If it's the latter, it can be helpful to get a snapshot of the entity data of the frozen monster. One way to do that without much fuss is to save the game once you've reproduced the error, then open the save file in a text editor. Then after a bit of searching for the classname you should find the stuck entity. Easier to do in a test map with a small number of monsters! 
 
the monster is still alive and attacking, but when you hit with an axe, has the "plink" sound like you are hitting a wall & invincible...

also is "MOVETYPE_PUSH with a non bsp model" is this fixable? 
Error 
If you had the "MOVETYPE_PUSH with a non bsp model" error you would know it - the game crashes to console with that text.

My guess is that your oddball monsters come from the following sequence of events:
1) A monster is killed and starts its death animation
2) Another monster wakes up nearby and runs FoundTarget
3) FoundTarget finds the dying monster and changes its animation from dying to running

In step 3 you've quite literally reanimated the dead! When a monster dies, it turns non-damageable immediately, but usually becomes non-solid at some point midway through the death animation. So if you hit the right timing you'd get the behaviour you report. Fix is to exclude dead monsters from the process. 
First | Previous | Next | Last
You must be logged in to post in this thread.
Website copyright © 2002-2024 John Fitzgibbons. All posts are copyright their respective authors.