Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
tomatoKetchup

Monster's artificial intelligence before compilation

Recommended Posts

Hi there,

While building my maps (with Doom Builder 2), I noticed that when I test them the monsters seem really stupid. I mean much more than they are normally when I play any Doom game.
They seem to be lost, they kinda walk in every direction and are more willing to fight each others than to attack the player.

I was wondering if the reason could be that the map has not yet been compiled and thus the monsters' pathnodes have not yet been built.

Could you confirm that to me because I'm starting being worried about the relative facility of my maps... :(

Share this post


Link to post

I don't think nodes are the problem, either DB2 or the source port builds nodes when you try to playtest before saving (otherwise you couldn't play at all, I think?).

The Doom AI is simple by default. From what I understand, monsters try to reach the player in a straight line, alternating sidesteps to the left and the right; they fire if they have line of sight, with an increasing probability as they get closer to the player.

If you want monsters to be efficient at navigation, you might have to take extra steps in your level design. Avoid nooks and crannies, cramped corridors, long elevated floors with tiny access points; or use monster blocking lines to restrict their movement to more optimized paths. It's a little hard to put in words, but I think you can get good results by working empirically. Playtest your map, watch where the monsters are getting stuck, move vertices around in that specific area, rinse and repeat.

When a monster hits another monster before the player hits them, they will retaliate. Unless they're from the same kind; imps won't take damage from other imps and won't fight imps, hell knights won't take damage from other hell knights, and so on. Hitscanners (zombies) are the exception, they take damage from their own kind and they will fight each other.

Careful monster placement is generally the answer. Don't throw every monster type at once, unless you specifically want to have a chaotic brawl. Place zombies so they don't gun down each other immediately. Try to think of what is going to happen once you hit "play", or even easier if time intensive, move your player start and see it for yourself, then tweak as needed.

Tying back to the previous point about navigation, if you make sure your level design has various entry points for rooms, multiple windows, it gives monsters different locations to shoot from; and so they don't gather in one spot, and they hit each other less. Likewise, varying floor heights can be helpful, so you have monsters shooting above the heads of their friends rather than hitting them.

Share this post


Link to post

It's not a problem with your tools or anything like that. You simply pay more attention to the AI when testing your maps. When you're playing casually, you just want to kill the monster as soon as you see him. You're concerned about survival more than anything. And if he does something stupid, you're happy to use that chance and you're not worried about it. But when testing your map, you want to ensure that all monsters are placed well and are doing the best they can to threaten the player. You want everything to be nice and efficient. So you start noticing all these silly things like pinkies running away, monsters dancing on pillars without shooting for a long time, getting into fights with each other, etc. This is one of the many reasons why I don't enjoy my levels that much. The perception is very different when you are the author.

Share this post


Link to post
tomatoKetchup said:

I was wondering if the reason could be that the map has not yet been compiled and thus the monsters' pathnodes have not yet been built.

Doom's monster AI is primitive enough that it doesn't use path nodes. Nodebuilding in Doom is not for creating paths for the monsters, it's to create the binary space partition tree.

See node.

It isn't possible to actually play a level without building nodes first. However, some ports (such as ZDoom or Doomsday) have a built-in nodebuilder, so if a map where the nodes have not been built, then they can generate their own nodes to use instead. With today's computers and the typical Doom maps, it takes just a fraction of a second.

Share this post


Link to post

Ok that's what I was afraid of... As always, I was trying to convince myself that the problem was something else than me.

Anyway, I'll work harder and will study more carefully how the original maps were made in order to improve that aspect.

Thanks to you guys for bringing me back to reason. ;-)

Share this post


Link to post

Lol at pathnodes. Doom monsters are just dumb pawns who always walk roughly in their target's direction, and try random maneuvers when reaching an obstacle. All of us mappers and players take the behaviour as natural. It surely has disadvantages, but also advantages - large scale and otherwise elaborate gameplay scenarios can be used to test player's skill of understanding the game mechanics, which is in fact Doom's greatest strength in regards of creating challenge.

tomatoKetchup said:

Anyway, I'll work harder and will study more carefully how the original maps were made in order to improve that aspect.

The obvious and most common solution from mapper's perspective is to give a "deaf" flag to the monsters. Then they will only wake up upon seeing the player, and won't be just randomly wandering the entire map and getting cluttered around corners.

It also helps to learn how the Doom engine handles sound propagation. It's simple. The "sound" (it's just the AI-affecting sound information, not actual sound!) travels through all adjancent sectors, except sectors with 0 (or lower) height - closed doors, etc. It will also be blocked by a row of 2 linedefs flagged as "Block sound", you can place them in windows, corridor entrances and anywhere you consider them fitting.

Share this post


Link to post
scifista42 said:

Lol at pathnodes. Doom monsters are just dumb pawns who always walk roughly in their target's direction, and try random maneuvers when reaching an obstacle.

I used to make simple 8-bit games that had Doom/Pacman-like AI (Move diagonally towards the object; if you hit a wall on the way, too bad), and I must say that Doom's AI does one of the best jobs at getting around local-minima of any simplistic AI I've seen. In other words, to make it any smarter would take a lot of additional code, which would probably slow it down.

Having said that, adding some pathfinding would be an interesting task, especially if you want to add smart bots.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×