Intelligence Datums
Created by: Kurfursten
This was an idea I tried to implement independently a while back, but it didn't pan out, but people liked the idea and Probe asked me what we'd need to do it.
What We Talk About, When We Talk About Intelligence Datums
Currently, all mob behaviors (what we can loosely call their AI) are handled inside each individual mob's life code. That is to say, when you see a cow wander that's because the local wander_move proc is called by simple_animal's life code. There are a few problems with this.
- Obfuscated code. It is difficult to find the intelligent behavior you want, and life code becomes longer to read for people looking for things related to the mob's life that aren't related to its intelligence code.
- Poor maintainability. If we invent a better mousetrap in terms of, for example, melee fighting, we want that to carry over to every mob that fights in melee, not to have it bottled up in one place and need to paste that into each mob's life.
- Not very modular. If you want a non-wandering mob to wander currently as an admin, you're basically out of luck. If we had a datum with access to all the behaviors, you would simply need to activate the wander flag for that mob's intelligence.
How Do We Fix It?
We need two things.
- Create a comprehensive list of behaviors we want to exist as procs within Intelligence datums. These would be things like tactics procs that provide the general strategy for approaching a fight (melee lethal, melee nonlethal, ranged, grappling, etc.), but less elaborate things like wander movement, and a generic proc that could be used for many one-off behaviors specific to mobs (like egg laying). This also means differentiating between what goes into the intelligence datum and what needs to stay in the mob. For example, logic for when to speak could go into the intelligence datum, but the lines the mob speaks should probably remain inside the mob itself. In practice, intelligence says to pick a line when entering battle, cow mob provides "Moo" as an available line.
- To find the prime examples of each of these behaviors that exist in the code so they can be used in the intelligence datum (e.g.: our best pathfinding code). We can have a wish list of behaviors we want to have some day too, such as Goon-esque Punpun MMA, where a mob uses its environment, throwing objects and tabling foes.
After that, it's a matter of writing it, and then cleaning up mobs to make them compatible with the new intelligence. Everything from goats to medbots to ayyliens could use this intelligence. Blobs aren't mobs, but blob spores are. This is a thread for general discussion about reaching those goals, implementation, and other structural issues (for example, how do we want to use flags in our implementation of intelligence datums?)