Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

kk3

Name: Anonymous 2024-12-23 6:28

Good God KK, put on your big boy pants. Do you really think the boys in JP will give Faulkner the boot? Maybe you have visions of a three guitar band (AKA Iron Maiden)? Not gonna happen. You sound like a little girl complaining that she can't participate in a tea party. Someone take your Barbie?
0
allen_pagent 10 · Oct 18, 2021 04:36 PM · report · ↑reply


https://www.ultimate-guitar.com/news/general_music_news/kk_downing_says_its_absolutely_unbelievable_hes_not_allowed_back_in_judas_priest_after_how_rob_halford__glenn_tipton_behaved.html

Name: Anonymous 2025-02-01 3:45

Name: Anonymous 2025-02-01 3:46

Name: Anonymous 2025-02-01 3:54

Name: Anonymous 2025-02-01 3:56

Name: Anonymous 2025-02-01 4:15

Improving the Monsters



So you want to be a programmer, eh? You want to write artificial intelligence just like the big boys, right? No problem! You too can code AI like the game companies do. Step right this way!

First off, let's take a short look at the AI of the two hottest 3D games, Quake 2 and Unreal. Both titles promised advanced monster smarts like evasion, higher awareness, and random roaming. But, um, well, um, let's just say most of it is, well, hard to spot.
However, we will learn all three of those features today! And tomorrow we will be working at highly successful software firms, right? Then we will be paid embarassingly high sums of money, right?



1. Attack evasion.
Okay, now for the first lesson, boys and girls. The most common complaint of creature intelligence is that they just kind of stand there waiting for the buckshot.
Perhaps all demons from hell and aliens from space are pain-loving sado-masochists. But we're looking for a more intiguing opponent.
So what we want to do is open the AI.QC file, where most of the thinking should take place. Scroll down to the last subroutine, ai_run(). This is what is going through the monster's head during a fight. It's a short subroutine.
Let's make the dude strafe while you are shooting. Go to the section halfway down that looks like this:

// look for other coop players
if (coop && self.search_time < time)
{
if (FindTarget ())
return;
}

enemy_infront = infront(self.enemy);
enemy_range = range(self.enemy);
enemy_yaw = vectoyaw(self.enemy.origin - self.origin);

After this line add this:

if (time < self.enemy.attack_finished)
{
ai_run_slide();
return;
}

Boom, that's it! Five years of 3D action games could be changed by five lines of code. The variable .attack_finished is set to something, say, one second for a rocket, to represent how long your attack will take. So the monster instantly knows when you are firing.
Ironically, the subroutine ai_run_slide() is already in QuakeC but is not used much. Go figure. It makes a monster slide from one side to another.
I could talk a whole lot more, but it's as simple as that. That's how to add attack evasion.



2. Higher awareness.
This lesson could cover a whole load of behaviors. For now, let's make the creature retreat when his health is low.
Underneath the new code we added above, insert this:

if (self.health < 25)
{
ai_back();
return;
}

Oh gosh, this is just too easy. I'm going to have to add some arcane jargon or technical terms or something. Anyway, when the monster's health is less than 25 points, he will simply back up, using id's ai_back() routine.
Well, we can make it more complicated. We can make him angry when he's wounded. Replace the above code with this stuff:

if (self.health < 25)
{
ai_back();
self.th_missile();
return;
}

Okay, if you noticed, there is only one new line of code, his "missile attack think." It says "self" because his missile attack is his own, and each of Quake's monsters have their own.
So now he should back up and attack as well. Whoa, neat. I hope the game companies are ready this.



3. Random roaming.
Again, this topic is quite broad. It may not have a purpose except to seem cool, or to add replay value to maps. But perhaps you can teach your monster to roam the level for a reason.
Open the MONSTERS.QC file, which contains a lot of creature initialization. Scroll down to the walkmonster_start_go() subroutine.
What you want to do is replace the two references to self.th_stand with self.th_walk. If you wish, you can simply use the "search and replace" feature in your text editor.
That can't be the secret to monster roaming, can it? Yes, a start anyway. On start-up, Quake's monsters are told to stand. With our changes they will start to walk when the game has begun.
You see, these monsters use a subroutine called movetogoal() to travel. This is called from QuakeC but is really a C function from id. The creature will randomly move toward his goal entity during this function.
Here is the subroutine they think while walking:


/*
=============
ai_walk

The monster is walking it's beat
=============
*/
void(float dist) ai_walk =
{
local vector mtemp;

movedist = dist;



if (self.classname == "monster_dragon")
{
movetogoal (dist);
return;
}
// check for noticing a player
if (FindTarget ())
return;

movetogoal (dist);
};

As you can see, there's not much too it. In fact, the only lines here that do anything are FindTarget() and movetogoal(). The rest is just excess fat.
Of course, our creature won't explore the whole map or come straight for you. Many authors think movetogoal() is limited, but it is nonetheless powerful. It tells the creature to move this and that way around obstacles, and it's only one line of code.

Well, now you've learned how to create monster intelligence smarter than 90 percent of the 3D games out there. Of course there is alot more to it. But now you know enough to get one of those cushy game programmer jobs and make a million dollars.
For the next lesson, we'll learn things that will make us a billion dollars.

Name: Anonymous 2025-02-01 4:16

Quaddicted.com Logo
Small Quake Injector logoEasily install and launch Quake maps with the cross-platform Quake Injector


Frontpage News Maps Wiki Forum Help
Quaddicted.com Forum

Index
Rules
Search
Register
Login

You are not logged in.

Topics: Active | Unanswered

This forum has moved to https://discuss.quaddicted.com

Index
» General Discussion about Quake
» Better AI monsters?

Pages: 1
#1 2016-12-21 14:17:40

etb
Member

Better AI monsters?

I was wondering, with all the incredible projects, also of large scale like Arcane Dimensions, is there anything about making the monsters a bit more clever?

I am aware that part of the fun is fighting hordes of dumb enemies, but I feel dying a bit inside each time I get an Ogre that standing on a step cannot hit me or each time monster cannot walk straight on irregular terrain.

Drake Ogres and Zombies aim the player for example, but still the Fiend have problems walking stairs. The Shambler in Nighmare is dumber than in Hard because he does not try to reach the player and fights become "shot, hide, repeat".

It would great of course, but I am not thinking to F.E.A.R. games level of AI where enemies flank the player and show emotions. Just it would be nice if they were a bit smarter than a brick... perhaps with a bit of pathfinding.

#2 2016-12-21 14:35:09

bfg666
Member

Re: Better AI monsters?

AD does have ogres that can aim at you. Oddly not the regular ogres, by Sock's design, but his alternate versions do. For custom maps that don't come with their own progs.dat, in Darkplaces (and maybe FTE) you can use Seven's SMC: it has ogres and zombies that can aim at you like the Drake ones, and also an optional teleporting feature for the fiends (and scrags, if you don't find them pesky enough as they are) that bypasses this climbing stairs problem and makes them trickier to fight.

#3 2016-12-21 15:04:35

negke
Moderator

Re: Better AI monsters?

In the Shadows has "smarter" enemies, in the sense that the mod uses a waypoint system which makes them get around the levels more easily. Where in vanilla Quake the monsters just blindly run towards the player's location and subsequently hit a wall or an obstacle, in ITS they're able to actually reach him in other rooms or higher floors. The downside of this system is that it has to be set up manually for each map which is a lot of work, and it easily leads to the exceeding of vanilla engine limits.

#4 2016-12-21 17:00:41

etb
Member

Re: Better AI monsters?

Well, if you have a basic .bsp you can also use Drake. It makes the weapons also stronger, though.

Any idea how the bots like Omegabot or Reaper manage to move in the level without adding waypoints?

#5 2016-12-23 18:16:47

negke
Moderator

Re: Better AI monsters?

I don't know for certain. I imagine something like using the traceline function to generate rudimentary routes between the items/level entities and then some prioritization which one to frequent. Probably unreliable and too expensive in SP mode. A QC person would be able to tell you more.

#6 2016-12-26 01:41:44

Madfox
Member

Re: Better AI monsters?

If I remember well the reaperbot oriëntates on ammu and items,
and uses health packs on its "chase" to the player.

I can be wrong.
:P

Name: Anonymous 2025-02-01 4:16

frag.machine
Posts: 2126
Joined: Sat Nov 25, 2006 1:49 pm

Post by frag.machine » Sat Jun 11, 2011 3:41 pm

daemonicky wrote:

frag.machine wrote:
Some time ago I wrote the FragBot, partially inspired in some of the FrikBot concepts (although haven't used any of its code, I decided to wrote it by myself). It was meant for use as a NPC in a now defunct mod, and is based in a small stack of "target entities". Every think cycle, the bot scans around and updates the target stack adding, removing and/or ordering it according weights a special function gives to every stack element, taking in account several factors (bot interests/needs, near players interests/needs, near threats, etc), and then act accordingly to the highest priority target in the stack (try to grab it, walk to it, avoid, attack, use, etc). It was a very interesting exercise, and not really that hard to make actually. There's a video demoing the bot behavior in the "what are you working on ?" thread.

Beautiful. :) I would do it similar way: make list of possible moves with additional information in them, then let AI choose the best. I made Ludo AI, so turn-based game, this way (for player on move every place each piece can go to when given dice -places blocked by own pieces are ignored- with information what piece moves, whether he would go to one of "home/goal position", enemy position, how long is this road ... after that there were several AI to choose from, each was selecting its own best move - longest, shortest, random, "goal/home", enemy "kill").

How did you manage Your bot not to exchange goals too often? I mean, every frame you can have this list of goals ready for You. Did you have some way to pospound it (like "this task takes 3 seconds" or "nextthink = time + 0.2") or was it not necessary :?:

Yes, there's a "interest time" for every target in the stack, so current top target is not swapped while interest_time > time. This time is defined by the same function that weights the bot's interest in the target.

The cool thing about this approach is that you can shape the bot's personality/behavior just changing the weights for interest and interest time. Aggressive bots will spend less time healing themselves (or grabbing armor) and more time searching for better weapons and ammo. You can even implement more complex behaviors like healers or body guarders just applying higher priorities to clients in the bot's interest list.
I know FrikaC made a cgi-bin version of the quakec interpreter once and wrote part of his website in QuakeC :) (LordHavoc)

Name: Anonymous 2025-02-01 4:19

//hs://forums.insideqc.com/viewtopic.php?t=3364

Name: Anonymous 2025-02-01 5:15

optional xyz check to extends for spawning monsters for obj_from_mc? (to make sure some texture is hit somewhere)?

Name: Anonymous 2025-02-02 6:31


Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List