Rewrite default non-hostile AI
issueid=3780 07-31-2015 10:02 PM
ixi ixi is offline
Junior Member
Number of reported issues by ixi: 51
Rewrite default non-hostile AI
I'd say current non-hostile AI is dummy. Monsters behave like they're drunk.

Current AI for non-hostile monsters likely is very simple: choose random direction and try move / attack there. There are chances for other actions, for example picking up items or equipping them. I guess it just was never considered for normal implementation since non-hostile AI won't interact with PC too much.

Here is implementation I'm suggesting:
  1. monster chooses random reachable tile on the level as destination;
  2. intelligent monster has X% chance to look for any reachable item within his field of vision and choose it's as destination;
  3. monster uses pathfinding routing to reach the destination tile;
  4. if monster is lawfully or neutrally aligned and path is completely blocked by another creature: chooses a new destination;
  5. if monster is chaotically aligned and path is completely blocked by another creature: fight through;
  6. if path is blocked by obstacle rather than a creature (e.g. closed door which non-intelligent monster can't open or locked door): chooses a new destination.
  7. once destination is reached monster picks up all items (if he is able too), spends AdB+C turns there and chooses a new destination.


Don't think it's overhead but towns filled with non-hostile monsters should look awesome after this change. I think I would feel like non-hostile ADOM monsters are busy with their own things.

Special cases (which I'd love to see implemented too but not as necessary as suggested above):
  • Children should pick destinations very close to them, for example in range of 3 squares. They're not busy, just running around.
  • Ratling traders, beggars, Tywat Pare and ratling rebel could have a chance to choose a PC as their destination if PC is in their LOS, reach it and say whatever they want.
  • Ratling thieves, ratling master thieves, cutpurses could have chance to choose a PC as their destination if PC is in their LOS, reach it, try to steal and on success run as far as possible choosing the most far tile from PC. That only while these monsters are neutral, once hostile they would attack as usual.
  • Village fool is just fine as is, he is the only monster I see for which current behavior is excellent. But existing behavior also might be left for demented ratling and old crone as well.
Issue Details
Issue Number 3780
Issue Type Feature
Project ADOM (Ancient Domains Of Mystery)
Category All
Status Suggested
Priority 4
Suggested Version ADOM r60
Implemented Version (none)
Milestone (none)
Votes for this feature 5
Votes against this feature 2
Assigned Users (none)
Tags (none)




08-03-2015 06:06 PM
Member
Too much effort for something that only increases immersion by a slight bit.

08-04-2015 07:53 AM
ixi ixi is offline
Junior Member
Quote Originally Posted by Bieks
Too much effort for something that only increases immersion by a slight bit.
Can't catch you... Isn't the whole ADOM about impression? Or you play it like chess?

08-12-2015 10:37 PM
Ancient Member
I don't know how the current AI works, but I don't think it's quite as simple as you say. Non-hostiles tend to enter shops, wander them and exit rather often. If their behavior was just random moves I would expect them not to enter them that often (the entrance is narrow) and when they do, stay stuck there for a long while, like when a fly enters a room and can't find the window to go out.

Although maybe I'm totally wrong and it is that simple - these probabilistic things are often not too intuitive.

Anyway, more sophisticated AI for non-hostiles would be nice actually. It would probably need some safety mechanisms and a testing period to avoid deadlocks in corner cases, but I agree it would likely improve immersion. Voted yes.

+ Reply