Mob/NPC API
Mob/NPC API
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.
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.
- Krock
- Developer
- Posts: 4650
- Joined: Thu Oct 03, 2013 07:48
- GitHub: SmallJoker
- Location: Switzerland
- Contact:
Re: Mob/NPC API
I would like to have an API for mobs in the engine and already had the idea about an unified mob API earlier
This is definitely something which would increase Minetest's popularity.
This is definitely something which would increase Minetest's popularity.
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>
- Casimir
- Member
- Posts: 1207
- Joined: Fri Aug 03, 2012 16:59
- GitHub: CasimirKaPazi
Re: Mob/NPC API
That is what I tired to start with "mobapi". But I don't have the time to develop this and there are no other contributers. So it is not that much different from the API that is included in simple_mobs. Also there are many things that better should be done in the engine (Like tool wearout).
I would be happy if some people pick this topic up and create something usable.
I would be happy if some people pick this topic up and create something usable.
- kaeza
- Moderator
- Posts: 2162
- Joined: Thu Oct 18, 2012 05:00
- GitHub: kaeza
- IRC: kaeza diemartin blaaaaargh
- In-game: kaeza
- Location: Montevideo, Uruguay
- Contact:
Re: Mob/NPC API
Spoiler
Your signature is not the place for a blog post. Please keep it as concise as possible. Thank you!
Check out my stuff! | Donations greatly appreciated! PayPal
Check out my stuff! | Donations greatly appreciated! PayPal
- Krock
- Developer
- Posts: 4650
- Joined: Thu Oct 03, 2013 07:48
- GitHub: SmallJoker
- Location: Switzerland
- Contact:
Re: Mob/NPC API
True, some older mob mods are not developed anymore and could be counted as those 14. But the 15th standard would contain all developed and new mobs.kaeza wrote:
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>
- Casimir
- Member
- Posts: 1207
- Joined: Fri Aug 03, 2012 16:59
- GitHub: CasimirKaPazi
Re: Mob/NPC API
Currently all those mods come with their own mobs and own core code, there is no standard api. What I did it to take the existing - sort of - standard of the simple_mobs code and make it accessible.
-
- Member
- Posts: 356
- Joined: Thu May 08, 2014 21:22
- GitHub: Maddie-Myina
- IRC: Maddie-Myina
- In-game: .
- Location: Far Eden
Re: Mob/NPC API
Yeah I think the Player And Mob API Needs Knockback and better turning and such animations.
But as of right now there lots we implementing that I think We need focus on something huge and get it done.
I would like in the game.conf a mods folder naming like..
mods_dir_folder_name = FolderName
as of default it will be mods like as now.
Might not be to hard to rewrite if people added the menu folder.
Now for rewrite work with older versions might be simple.
But I'm really busy making my huge Minetest Project and I need to update it to latest MT Build before I get furthermore on it.
I hope to make an map for it to.
So release date is TBA.
But as of right now there lots we implementing that I think We need focus on something huge and get it done.
I would like in the game.conf a mods folder naming like..
mods_dir_folder_name = FolderName
as of default it will be mods like as now.
Might not be to hard to rewrite if people added the menu folder.
Now for rewrite work with older versions might be simple.
But I'm really busy making my huge Minetest Project and I need to update it to latest MT Build before I get furthermore on it.
I hope to make an map for it to.
So release date is TBA.
I'm a Transgender no shame about it.
I prefer to be considered as a "Girl/Lady/Miss/Madam/Female" for now on.
I prefer to be considered as a "Girl/Lady/Miss/Madam/Female" for now on.
Re: Mob/NPC API
We should probably start by making a list of existing mods and figuring out what features they have. I think most are based on PilzAdam's mod, because they all contain the same basic code.
Here are the ones I've found:
https://github.com/stujones11/minetest-npcf/
https://github.com/sapier/animals_modpack
https://github.com/jojoa1997/peaceful_npc
https://github.com/cornernote/minetest-towntest
Here are the ones I've found:
https://github.com/stujones11/minetest-npcf/
https://github.com/sapier/animals_modpack
https://github.com/jojoa1997/peaceful_npc
https://github.com/cornernote/minetest-towntest
-
- Member
- Posts: 1482
- Joined: Fri Apr 19, 2013 16:19
- GitHub: twoelk
- IRC: twoelk
- In-game: twoelk
- Location: northern Germany
Re: Mob/NPC API
you might find this list useful: http://wiki.minetest.net/MobsCIB wrote:We should probably start by making a list of existing mods...
Games that include mobs are not listed yet though.
- rubenwardy
- Moderator
- Posts: 6978
- Joined: Tue Jun 12, 2012 18:11
- GitHub: rubenwardy
- IRC: rubenwardy
- In-game: rubenwardy
- Location: Bristol, United Kingdom
- Contact:
Re: Mob/NPC API
I started writing a mob mod could YAMM, it was heavily modular, very nice code structure. Different mob states were different modules, eg walk, run, attack, eat, as well as different behaviour types. Modules could modify other modules. Flying mobs could have been supported, I just had to develop it.
But I lost the code.
Here is the only thing I have left, it is a very early prototype, I uploaded it for demonstration purposes: https://gist.github.com/rubenwardy/b5cd1a01049e0c935ecf
I now upload all my indev projects to bitbucket as private repos.
But I lost the code.
Here is the only thing I have left, it is a very early prototype, I uploaded it for demonstration purposes: https://gist.github.com/rubenwardy/b5cd1a01049e0c935ecf
I now upload all my indev projects to bitbucket as private repos.
Re: Mob/NPC API
Thanks, that's helpful.twoelk wrote:you might find this list useful: http://wiki.minetest.net/MobsCIB wrote:We should probably start by making a list of existing mods...
Games that include mobs are not listed yet though.
Too bad you lost it. :(rubenwardy wrote:I started writing a mob mod could YAMM, it was heavily modular, very nice code structure. Different mob states were different modules, eg walk, run, attack, eat, as well as different behaviour types. Modules could modify other modules. Flying mobs could have be
-
- Member
- Posts: 4290
- Joined: Sun Sep 09, 2012 17:31
- GitHub: Sokomine
- IRC: Sokomine
- In-game: Sokomine
Re: Mob/NPC API
Don't forget to take a look at npcf. That was basicly the same - a mob api for player-like mobs. My own traders focus on the trading aspect. They don't move around at all.
A list of my mods can be found here.
Who is online
Users browsing this forum: No registered users and 9 guests