Better bot AI

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
User avatar
Sphagne
Posts: 513
Joined: Wed Jul 16, 2003 3:36 am

Better bot AI

Post by Sphagne »

Well, another idea here, this time I think actually a brilliant one :wink:

How about combining the Bot code and actor helpers, and make a new type of intelligent actors that could attack the players or help them.

The designers place some spawn spots for this new type of actor-bots (co-op or deathmatch style) and give them an optional tid to manipulate them later if required. and they would use the bots ai to do their works, but the level designers could use the actor mover script functions to manipulate them later, or place some new special patrol points to help them, (More on these helper objects later).

They would automatically spawn on these spawn spots at the begining of the level and optionally respawn there if they die in the level, and they would trigger the lines that are normally triggered by the players and not the monsters, and generally use bot ai unless especially manipulated by level designers, and there would be an option to tell them to move at the speed of the bots or at a specified speed.

If they are told to folow a path or do something else it would override the previous hate targets, and optionally they are forced to complete the job and ignore new hate targets.

Some new patrol points are for special uses, i.e. Health Spots, Weapon Spots, Mission Spots, Watch Spots, Target Spots, and maybe some new special points for CTF levels. Later I will describe them in detail.

If the actor-bot needs health either it uses a nearby health item, or it looks for the nearest Helth Spot in the level and starts its patrol from that point, and the points guides it to more health and optionally triggers a special to open doors or use lifts and so on.

If it needs more ammo or weapon then it looks for them or for a Weapon Spot.

And depending on their charactristics defined in a BOTS lump they can have different skins and sounds and speeds and good or bad aims and weapon preferences, or they would prefer to stand by Watch Spots and guard areas or go for Mission Spots and jump into action, They would hate some ActorTypes more than others, and would change target on sight, Some of them are braver and stay longer, and some would depart if they loose just a tiny part of their health; some of them are greedy for ammo, and some of them for armour; some of them would have more initial armour and health (combined woth different skins sounds reasonable) and they would have different initial weapons and ammo.

Some of them would be organic and would bleed on being shot and some would cause a bullet puff, and even some of them would fly.All of them have their individual names and also all of them would have different Intelligence Factors that is available to scripts for taking differnt decisions depending on their intelligences.

I.E. More intelligent bots would use an elevator while the dumber ones would have to use a longer rout to the roof or they would not be able to reach it at all.

We can have a network of special Target Spots that would help the bots to reach different areas of the level, each Target Spot would have a tag that is related to the sectors with the same tag, and each Target Spot knows about a few adjacent Target Spots and the way to reach them.

Each Target Spot has one or more Rout Objects linked to it, (by tag), and each Rout Object has a new Target spot in destination and an Intelligence Factor to check the with bots ai to see if it can use the rout, and optionally a Special to run, with the bot as the activator.

When a bot wants to reach a target on a balcony for instance, it goes to the Target Spot of the sector that it is standing in. and asks for the rout to the Target Spot of the balcony, the Target Spot Network (TSN for short) checks the routs with the bot`s inteligence and other charactristics (like ability to fly) to find a rout for it.

If no rout is found then the bot can act like current normal bots or it can go to a Watch Spot or Mission Spot, depending on it`s preferences level factors.

If it finds a rout the bot is given to the First Rout Object, and it either runs it`s special with the bot as activator or if it does not have a special it just tells the bot to go toward the next Target Spot. and that Target Spot sends it toward the next and so on...

Whenever a special is called, the next Target Spot and the Intelligence of the bot are two of its parameters and maybe the bits that tell the Script about the bot, like if it flies or can enter or leave water areas , can jump, is player friendly or not... Or maybe these characteristics of the activator can be accessed by normal ACS functions like "int ActorIntelligence()".

The level designers can check these parameters to react differently to the bot actions and make them look more real, for instance an inteligent bot can be sent to a rout that forces it stand before an elevator`s control panel and then lowers it and then tells the bot to enter it, then lifts the elevator to the roof, and then tells the bot to go to te next Target Spot.

Another example is for instance a bot may jump off a ledge wile another may search for a staircase.

In the end, if this ai can be applied to all the normal doom monsters then we can have a totally new game out of the current one, with as much intelligent monsters as the level designers can use these Special Spots in different areas of the levels, and we can have intelligent Bots in CTF levels, or normal co-op or deathmatch levels, with equally real monsters with different levels of intelligence, not like current monsters that any of them react exactly like the others.

P.S. Randy, will you give the current available monsters diffenent intelligence factors accessable by a new Actor-property argument? It will not affect the previous designed levels at all but would give us a new option to manipulate the monsters. (How about Dehacked?:)

P.S.2. How about an Actor-can-fly or Actor-can-swim check? and give all the current flying default monsters a swimming bit as well, and maybe we can change it to force a cacodemon to stay over the waterline or under an invisible deep-water sector.
User avatar
Sphagne
Posts: 513
Joined: Wed Jul 16, 2003 3:36 am

Post by Sphagne »

The budding idea just got a bit more mature:

The Health Spots and Weapon Spots and Armor Spots ... all of them are just specified Target Spots in the Target Spot Network (TSN). and they are seeked by the bots not when they want to reach a target place but when they are in need of more health or ammo...

Mission Spots and Whatch Spots and Idle Spots are another subtype of the original Target Spots and are seeked out by bots in the begining of the level upon initializing the level or when they have accomplished the previous tasks. and they seek these spots according to their charactristics defined in BOTS lump and also according to the level circumstances.

There are some other Spot types like Attack Spots, and Defence Spots and Hide Spots, that are seeked out whenever a bot sees an enemy, and they would seek each type of these after comparing themselves to the target enemy and also according to their own charactristics (braveness, rushness, intelligence...) also defined in the BOTS lump.

if they want for instance attack the enemy they seek a nearby Attack Spot and search its target places for the sectors containing the target enemy. and if they find it they would follow the istructions and if they dont find a match then they act as a normal bot would do or they might switch the tactic and become defensive, i.e. search a nearby Defence Spot for instruction.

Each Action Spot has one or more accompanying Target Object that work just like a Rout Object described before, but those Target Objects can point to distant Target Spots and are not forced to point to an adjacent Target Spot (as Rout Objects), and they also have a special that contains the instructions that the bot would perform.

For instance when a bot finds some enemies across the level and decides to attck them, it seeks a nearby Attack Spot, and searches it`s Target Objects for the Target Spot of the sectors containing the enemies, and if it find any of them then it runs the Special of the Target Object with the bot as the activator.

In the special script we can tell the bot to stand beside a switch and then we flip the switch and start an alarm sound and then spawn some troops beside the Target Spot.

Or we can tell the bot to stand behind a turret and pour some imp fireballs uppon the enemies, or we can do other things...

The Defence Spot examples can be locking doors or activating laser barriers or sounding allarm to call help for the base.

The Hide (Sneak) Spots can force the bots to perform some hide and seek actions with enemies.

And each time the bots get rid of the offending enemies, they can seek some Initializing Spots like Mission Spots or Idle Spots or Watch Spots, and they would seek them according to their changing emotions and also their charactristics defined in the BOTS lump, or they can seek Supply Spots (Health Spots...) for reinforcements before Mission Spots.

The Mission Spots can tell them to patrol areas and perform tasks or maybe they can attack other bases and as their personas and intelligences differ, their actions may differ with each other, so we may see some bots attack another base and each of them doing some special task that differ with others.

The Watch Spots forces the bot to stand still looking at some direction.

And Idle Spots give the bots some random unimportant tasks from a list.
For instance they can walk seemingly aimlessly and standing infront of the windows looking at the view... as we play some whistling sound from them.

There is no limit in the scenarios that may come to the mind of the level designers... 8)
Mighty Duck X-treme
Posts: 272
Joined: Tue Jul 15, 2003 5:48 pm
Location: Chesterfield, Missouri

Post by Mighty Duck X-treme »

MOST. OUTSTANDING. DAMN. DISCOVERING. PERIOD.

*OMG ILLEGAL BANANA USAGE*
Last edited by Mighty Duck X-treme on Thu Jul 17, 2003 2:00 pm, edited 2 times in total.
Thrasher
Posts: 73
Joined: Wed Jul 16, 2003 3:08 am
Location: Imperial Moon Base: Thal Vaishet
Contact:

Post by Thrasher »

I am hoping that the teamplay bug will get fixed too.

I would also like to see the bots more hostile against monsters then they currently are, prehaps they could be trained to protect members of their team in DM, or the player in coop.

I would also like to see VWEAPS support added. The bots change their skin to match which ever weapon they have. Would be good for the player too.

You could have seporate commands for each weapon, to tell Zdoom which weapon goes with which skin. It would allow you to build a conveinant & customizable cfg file or edit the autoexec.cfg with the settings you want. Commands would be like:

Pistolskin [skin name]
ect...

Plus you would need a command to turn the effect on & off:

VWEAPS 1/0

The only thing I would want left alone would be the way the bots fight, I don't want a ZDoomBot style attack, because they are much too hard to fight.
User avatar
wildweasel
Posts: 21706
Joined: Tue Jul 15, 2003 7:33 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): A lot of them
Graphics Processor: Not Listed
Contact:

Post by wildweasel »

Mighty Duck: Please, do NOT even start with the bananas on this forum. I've seen enough humanoid bananas to make a whole sci-fi movie on them.

Thrasher: I like where you're going with the VWeap support, if that gets implemented I think I'll use it on my "Flynn" bot. However, I think that the ZDoomBot fighting style should be retained, but scaled more for the different skill levels. As seen in this chart below...

SKILL 1
* Bots act like normal Doom monsters - move randomly, fire, move. If something's in the way, they try and open it like a door. Does not actively seek items. (Similar to the bots in Duke Nukem 64)

SKILL 2
* Bots still act like normal Doom monsters, but they now also seek out weaponry and health when they need it. They will not use any weapon above the Rocket Launcher.

SKILL 3
* Bots now strafe, and use weapons up to the Plasma Rifle. They also now use the weapon that they have the most ammo for, unless it happens to be the Pistol.

SKILL 4
* Bots begin using player-style movements and attacks, actively dodging your shots, strafe-running, strafe-jumping, and suchwise. Will actively seek mega-powerups.

SKILL 5
* Bots have dead-on accuracy now, will use the BFG without remorse, and will use the environment to their advantage (ie. leading players through crushers, using barrels, sludge, etc).
User avatar
Sphagne
Posts: 513
Joined: Wed Jul 16, 2003 3:36 am

Post by Sphagne »

All good ideas, but hey, did you read my posts throughout, too long to read, I know, but if implemented, it will let the level designers to force the bots to act just as they like. they can make them sound alarms or chase the players or sneek behaind them or try ot crash them with traps or jump on their head from above or turn the light out and then perform a surprise greeting party for them... anything you can think of.
User avatar
randi
Site Admin
Posts: 7746
Joined: Wed Jul 09, 2003 10:30 pm
Contact:

Post by randi »

Sounds like a lot of work to me. I doubt I would be able to use much, if any of the existing bot code to do what you're asking.
User avatar
Sphagne
Posts: 513
Joined: Wed Jul 16, 2003 3:36 am

Post by Sphagne »

How about just adding the new IQ and Swim,(and Optional temperament) values and bits for a start and making them available for scripters, then using the current monster AI, you can combine the path following features with hate system to make just one system, to let the level designers add new specilized path nodes that monsters seek whenever they want to attack their enemies, instead of just charging and following.

i.e. change the Chase code pointer. (more on that later)

Ok. a lot of work here, I know. 8-)

In detail: why not start adding new Link Objects that let the designers link these new Node objects together, then attach Setors to the Nodes by tags, then add the code to let the monsters check the sectors containing their enemies for linked Node objects, then their own Sectors for one.

This would replace the current Chase code pointers but any time it fails (no node and links placed by designers, or no route found to the target), then they use their normal Chase and Attack frames, (the current ones).

Then searching Node-Link-Network for a path to the target, and following the NLN net just like a normal patrolling monster , with the difference that they are aware of the enemy target and may stop to shoot at them at intervals if they can see them in their view, but after that they recheck the net and continue their path, (instead of just trying to go toward their target.

A Link object may optionally prevent the monsters from shooting at their target to the next Node.

OK. milstone two complete.

Now you can add the checks for the monster values like IQ and style of the movement... before the selecting the links to other nodes, so that the designer can taylor the net for different monsters.

Then adding the Specials to the links with target Node as the first parameter and the monster for Activator and the ability to check the monster IQ and other charactristics to the scripts for the designers to furthur taylor the movement, like calling an elevator...

OK. milstone three complete.

Then change their initial actions as they see their target, from just starting the chase to compairing the target strength with themselves and seeking Action Nodes like Attack Nodes or Defence Nodes or Hide Nodes accordingly, (their persona values like braveness... can change the selection).

Now they start the normal Chase-Check-NLN with the target as normal shooting target and the selected Node as the node target. (if the target is just a few nodes ahead and they want to Attack, then they may just use the normal attack-seek-node method without seeking the Attack Node)

By the way, Near Attackers can Ignore the nodes if they think they are near the target and the nodes are increasing their distant from the target.

They can also search the selected Action node from afar, before reaching them to see if they have a link to the Nodes of the Sectors containing the target enemy, and if not they just start their shoot-seek-node route.

And if they find a match in Action node to the target Sectors, (with their IQ and other charactristics checked), and when they reach the Action node, the Special of the Link-object to the target Node is run with them as the activator and the target sector`s Node as the first parmeter.

The designers than can perform lots of actions and then can guide the aware monster to places and it would follow even as it shoots at the target at intervals, just like the normal shoot-seek-node Chase action.

You know the Chase will change from shoot-follow to shoot-seek-node and hopefully the nodes will bring them nearer to their targets if there is a way, or maybe they will circle areas and follow a path that normal peaple would select, (all depending the level designers), or they may jump in a pit and go underground and then surprise the target from behind...

Just dont forget the Archviles, 8-)

OK. milstone four complete.

Now you may go for actor health and ammo restorations and friendly AI with selective Nodes and Specials to make reasonable friendly actors that help the players like openning the gates as they see them (without shooting at them :wink: ) or helping them if the players are low in health...

You can go on from here, to a totally new doom experience. :P
Last edited by Sphagne on Sat Jul 19, 2003 2:57 am, edited 1 time in total.
User avatar
Sphagne
Posts: 513
Joined: Wed Jul 16, 2003 3:36 am

Post by Sphagne »

Randy, if you assure me that you at least may try these ideas a bit, then I can go into the finer details of the current ones and adding new ideas like:
  1. Watch, Mission and Idle nodes to keep the monsters busy, but letting them select the actions that suit them most
  2. New NPC system to personalize the individual monsters with names and new bahaviour and charactristics that may differ with their race
  3. A bit of randomization in the node network for adding a bit of surprise here
  4. Enhanced actor helpers that make full use of this network and behave more like a live helper
  5. Mearging the curent bots with these new features, or maybe cobmining them totally with the actor helpers
  6. Tips about how to make a full interactive mission scenario with this system, in a battle scene between two opposing forces, with the players as a part of the battle
Lots of works here but surely worth the try, eh? :wink:
User avatar
Sphagne
Posts: 513
Joined: Wed Jul 16, 2003 3:36 am

Post by Sphagne »

OK. some more detail here:

How about the ability to turn off and on some nodes in the realtime, for instance for the times when we want to flood areas with lava and want to force the monsters to avoid these areas or maybe when we want to make the monsters ignore some places initially and then after removing obstacles let them use that areas.

How about nodes that are not attached to Sectors but can have a defined radius and height (like bridge objects) and we can place them over the bridges, then they are used as intermediate nodes that connect two other areas or seeked initially if the target is within their volumes.

Some nodes can be placed in the middle of the air for Flying monsters and the Link objects lead to them can make sure that only flying monsters would try to reach them.

The route finding engine can make a circular list of the links starting from a node and then start the check from a random link within the list and then try each of them until the list finishes.

You can find the routes recursively and each route passing more than once from a single node is instantly skipped, and the next link in the list is checked.

Whenever the monsters loose sight of their target, they remember the node of the place where it was last seen, and try to reach it, and after reaching there, they look around for the target and if they dont see him, they look around for nearest Mission nodes or they may try to return to their previous jobs, or maybe they would look for a Mission-Failed node around, or anything you suggest.

And if in the middle of the route they see their target again after loosing it`s sight, they recheck the NLN net for the new location and try to adjust their route for it.

And I think for the monsters that are following a route, if they loose sight of their target, and they reach the target node, and fail to see their target, they should completely forget about him and become unaware of him, and would do normal jobs until they aquire new targets. This should be default behaviour of the monsters in the end of the routes, and it would not affect the monster behaviours in the current levels, because there are no routes in them.

By the way how about giving the monsters a sight value and make a calculation with this value and the distance between the monster and the target and the light value of the sector containing the target to decide if the monster would see the target or it will ignore him?

i.e. A monster spots you and tries to reach your place to attack you, you jump in a dark place, the monster reaches the target node and looks arround for you, then takes instructions from a Mission-Failed node and goes about his way. Doom3, eh?

The monsters would have Unaware mode and Alarmed mode after hearing your shots for instance and trying to reach the node where the original shot was heard from, (before spotting the target in the way, I mean) and an Aware mode after seing the target for the first time and those would affect the sight value.

i.e. Unaware monsters would have lower sight values, and Alarmed ones would have a better value and the Aware ones would have even a better sight value than the last modes, and those values may differ between the races or for individual NPCs defined by level designers, and may be adjasted with Dehacked for a race.

Someone just stop me before I explode with ideas! :wink:

P.S. all these work only if there are nodes in the level and/or by a MapInfo option and for ye old Doom levels nothing would change.

P.S.2. you can add the option in main menus to add this sight checking for the old levels, for the ones who like them.
Last edited by Sphagne on Sat Jul 19, 2003 2:56 am, edited 1 time in total.
User avatar
wildweasel
Posts: 21706
Joined: Tue Jul 15, 2003 7:33 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): A lot of them
Graphics Processor: Not Listed
Contact:

Post by wildweasel »

Whoa, man, slow down! ^^;

You have some really good ideas here. It would be utter heck to implement them all in the near future, though, based on what you're asking for...but then, my ideas are probably just as tough...
User avatar
David Ferstat
Posts: 1113
Joined: Wed Jul 16, 2003 8:53 am
Location: Perth, Western Australia
Contact:

Post by David Ferstat »

I think that there are some terrific ideas here, but ...

Coding believable, pseudo-intelligent bots (AI) has been a pain for game designers since the beginning of computer games.

Trying to do more than a fraction of the (quite admirable) things you've discussed will take MUCH work just to design the code, let alone get said code working.

From what I've gathered of Randy's short-to-medium-term plans, improved bot AI is not on the agenda. Probably the only way you're likely to see it sooner is if someone else sits down and starts design. Note that any bot that takes much notice of its environment will probably need some serious consultaion with between our hypothetical developer and Randy, just so that the bot code knows what to look for.

I'm not saying that better bots are impossible, just that what you describe will take a LOT of work.
User avatar
bimshwel
Posts: 704
Joined: Tue Jul 15, 2003 5:15 pm
Location: misplaced
Contact:

Post by bimshwel »

I've convinced myself and accepted that all video game monsters are just morons. It seems to be true.
User avatar
Sphagne
Posts: 513
Joined: Wed Jul 16, 2003 3:36 am

Post by Sphagne »

Hey, I know it takes a lot of work to implement them and I dont expect Randy to wag a wand and BOOM, and for the AI stuff I am suggesting we can put lots of that in the level designer era, not the coders alone.

And I am sure if Randy takes his time to implement them we shall have intelligent-looking monsters and bots together, by the help of the level designers.
User avatar
bimshwel
Posts: 704
Joined: Tue Jul 15, 2003 5:15 pm
Location: misplaced
Contact:

Post by bimshwel »

Hell governments don't consider education a top priority. That's just the way it is. Their thinking is "there's no problem if demons kill each other, we'll just make more."
Locked

Return to “Editing (Archive)”