Alcyone wrote:I don't know what is really the cause of that : relevant mob API missing ?
I've spent a lot of time looking at the existing mob "APIs" but they're very minimal. None of them create a truly neutral API that allows mobs to use the same framework without constantly overriding default functions with more specialized functions, which is an unmaintainable situation. This is the reason that there are so many "mob APIs", but in effect they're not APIs at all - they're just mobs disguised as APIs. Any new monster means you'll have to copy most of the code and make major code adjustments if you want your monster to behave differently.
There's also no easy way for monsters to do scenario-based activities (e.g. find a specific node, dig it, find a different node, place the picked up node there) or change behavior (e.g. give up fleeing and return to an original position) on the fly, without again custom programming very long routines.
This is the reason I wrote entity_ai, since it solves exactly this problem:
- remove code from the API itself
- allow code to be replaced for any functionality (drivers, e.g. "flee", "eat", "roam")
- allow entities to behave differently in states (state driven behavior)
- allow easy creation of conditions that makes entities go from one state to another (get hit -> flee)
This allows us to create monsters without code, and code without monsters:
- code to find food nodes
- code to nicely walk from A to B
- code to hit a player
- conditions to handle getting hit by a player, and then code to run away frmo that player
- conditions to handle getting burnt by lava, and run away from it
- conditions to handle spotting a nearby player, and then attacking it
- code to find and target other entities (e.g. sheep herding themselves)
- code to find and target victoms (for attacking players)
- code to find and target villains (to flee from)
So that way we can make new monsters by creating a state model and defining conditions, for example, a simple sheep would look somewhat like this:
- roam state: driver: randomly walk around for X seconds
condition: get hit: change to flee state
condition: near food node: change to eat state
- eat state: driver: consume a node
state end: return to roam state
- flee state: driver: run away from whatever hit it
condition: fleeing too long: change to roam state
As you can see, we can define the sheep's behavior in a very subtle and precise way and make it change intelligently (the sheep won't stop to eat if it's fleeing) without any custom code blocks.
All of this is supported by entity_ai already, it just needs maturity, testing and some more driver code to handle various new drivers (aggressive is missing, abilities are somewhat limited and need more structure), but nobody else appears interested in solving the reason why other mob apis are failing to gain traction.
And ultimately that's why the currently most used mob apis will fail to ever make it into minetest_game.