by CIB » Mon Dec 29, 2014 13:09
There are various mob/NPC frameworks, all do similar things, all do them a bit differently. I'd like to add some DwarfFortress-like features to the game, but for that I'd first need a functional, solid and extensible mob/NPC API. It makes sense to develop this with the community, as mobs/NPCs are a desired feature anyway, and compatability between my work and that of others would be a good thing.
Here's what I currently need:
- Unified NPC/mob API: High level commands like "goto X", "Follow X", "Pay attention to X", etc.
- A behavior callback API that lets you implement the way these commands are carried out for individual mobs/NPCs
- An abstract pathfinding API, with possible implementations ranging from simple "move directly toward the target tile", to elaborate pathfinding mechanisms that involve building and storing a topology map of a chunk(C++ implementations must be possible for obvious reasons)
Optional features:
- An AI API that implements goals and planning
- Some blueprint implementations of movement/animation for some generic body types, because frankly, the ones I've tried looked terrible
I'd like to take feedback on this and work it into the design, then hopefully get to a point where a bunch of us can agree on an API.
EDIT: To elaborate a bit on the pathfinding idea, I think it'd make sense for it to be based on tiles. So you'd use it, for example, for a builder NPC who needs to path a way to some resource stockpile, and then from there to the build destination. The NPC would then plan as if they were a tile-based mover, and only interpolate the "analogous" steps as they actually move along the path. This would reduce cost of pathfinding significantly, while not looking too terrible.