[Mod] [Draft] Common Mob Interface [cmi]

Byakuren
Member
 
Posts: 441
Joined: Tue Apr 14, 2015 01:59
GitHub: raymoo
IRC: Hijiri

[Mod] [Draft] Common Mob Interface [cmi]

by Byakuren » Fri Sep 02, 2016 03:52

This is a mod providing an interface like I described in viewtopic.php?f=47&t=15331.

License: Apache 2.0
Mod dependencies: none
Download: Not yet (but you can still view and download from Github)

Github: https://github.com/raymoo/cmi
API docs: https://cmi-minetest.github.io
Implementation Guide (For mob framework writers): https://github.com/raymoo/cmi/blob/mast ... MENTING.md
Code Examples: https://github.com/raymoo/cmi_examples

I would like feedback from both modders who want to use the interface, and authors of mob frameworks. For modders using the interface, what do you think needs to be added/changed/removed in the interface? For mob framework writers, do you forsee any problems in implementing the interface? After writing the interface I did a quick check through Mobs Redo and it looks like it would be easy to integrate there, but that might not cover all cases. If you want to say something, I'm fine with it being posted in this thread or as an issue on the github repository.
Last edited by Byakuren on Mon Jan 16, 2017 02:57, edited 2 times in total.
Every time a mod API is left undocumented, a koala dies.
 

Byakuren
Member
 
Posts: 441
Joined: Tue Apr 14, 2015 01:59
GitHub: raymoo
IRC: Hijiri

Re: [Mod] [Draft] Common Mob Interface [cmi]

by Byakuren » Sat Sep 03, 2016 20:20

If you think the API looks great, you can say that too.
Every time a mod API is left undocumented, a koala dies.
 

User avatar
Christian9
Member
 
Posts: 273
Joined: Fri Sep 19, 2014 20:29
In-game: Christian9

Re: [Mod] [Draft] Common Mob Interface [cmi]

by Christian9 » Sat Sep 03, 2016 22:51

Looks neat, but if this is for creating mobs is there a template for mob creation?
 

Byakuren
Member
 
Posts: 441
Joined: Tue Apr 14, 2015 01:59
GitHub: raymoo
IRC: Hijiri

Re: [Mod] [Draft] Common Mob Interface [cmi]

by Byakuren » Sun Sep 04, 2016 04:42

Christian9 wrote:Looks neat, but if this is for creating mobs is there a template for mob creation?

It's neither. It's a standard interface you can put on top of existing or new mob frameworks so that modders who want to interact with those mobs only need to know about the CMI interface, instead of writing separate code for every mob mod that exists.

Concretely, the mod provides some callback registration functions and something sort of like an attribute system for mobs. You can use these features with any mobs that implement the interface.
Every time a mod API is left undocumented, a koala dies.
 

User avatar
Krock
Member
 
Posts: 3598
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker

Re: [Mod] [Draft] Common Mob Interface [cmi]

by Krock » Sun Sep 04, 2016 06:51

The Lua code is well documented but even with the implementation helpfile I have no clue how to use this framework/interface in a mobs mod. An example file would help here a lot to see how it could look like.
Newest Win32 builds - Find a mod - All my mods
ALL YOUR DONATION ARE BELONG TO PARAMAT (Please support him and Minetest)
New DuckDuckGo !bang: !mtmod <keyword here>
 

Byakuren
Member
 
Posts: 441
Joined: Tue Apr 14, 2015 01:59
GitHub: raymoo
IRC: Hijiri

Re: [Mod] [Draft] Common Mob Interface [cmi]

by Byakuren » Sun Sep 04, 2016 07:13

Krock wrote:The Lua code is well documented but even with the implementation helpfile I have no clue how to use this framework/interface in a mobs mod. An example file would help here a lot to see how it could look like.

Alright, I'll put making an example on my todo list. I've mentioned this mod to tenplus1 in IRC, so either he'll implement it or I'll start making PRs (that's not meant to be a threat), and that will be an additional "live example".
Every time a mod API is left undocumented, a koala dies.
 

Byakuren
Member
 
Posts: 441
Joined: Tue Apr 14, 2015 01:59
GitHub: raymoo
IRC: Hijiri

Re: [Mod] [Draft] Common Mob Interface [cmi]

by Byakuren » Tue Sep 06, 2016 03:09

I've added an implementation code example (check the OP). You can do /spawnentity cmi_examples:mob to spawn the example mob. I plan on adding examples for other parts of the API later.
Every time a mod API is left undocumented, a koala dies.
 

Byakuren
Member
 
Posts: 441
Joined: Tue Apr 14, 2015 01:59
GitHub: raymoo
IRC: Hijiri

Re: [Mod] [Draft] Common Mob Interface [cmi]

by Byakuren » Mon Jan 16, 2017 02:56

It's been a while, but I think I'm about ready to release. Any comments from anyone who is interested in the project?
Every time a mod API is left undocumented, a koala dies.
 

User avatar
Christian9
Member
 
Posts: 273
Joined: Fri Sep 19, 2014 20:29
In-game: Christian9

Re: [Mod] [Draft] Common Mob Interface [cmi]

by Christian9 » Mon Jan 16, 2017 02:59

Excited to test it out
"I dreamed of becoming a scientist, in general, and a paleontologist, in particular, ever since the Tyrannosaurus skeleton awed and scared me" - Steven Jay Gould

My Deviantart Page
My Website
 

Byakuren
Member
 
Posts: 441
Joined: Tue Apr 14, 2015 01:59
GitHub: raymoo
IRC: Hijiri

Re: [Mod] [Draft] Common Mob Interface [cmi]

by Byakuren » Mon Jan 16, 2017 03:32

Christian9 wrote:Excited to test it out

Thanks

Though really I just replied so I can say something extra: I'm specifically interested in complaints about the API (both on the library-user and implementor sides).
Every time a mod API is left undocumented, a koala dies.
 

User avatar
D00Med
Member
 
Posts: 712
Joined: Sat Feb 07, 2015 22:49
GitHub: D00Med

Re: [Mod] [Draft] Common Mob Interface [cmi]

by D00Med » Tue Jan 17, 2017 07:46

This seems very interesting, especially this: "Modders can write mobs that don't use any framework, by just implementing the interface"
Now I just have to get my head around how to use the mod :]
Look! I have a signature :]
My subgame: https://forum.minetest.net/viewtopic.php?f=15&t=14051#p207242
dmobs2 is coming...
 

Byakuren
Member
 
Posts: 441
Joined: Tue Apr 14, 2015 01:59
GitHub: raymoo
IRC: Hijiri

Re: [Mod] [Draft] Common Mob Interface [cmi]

by Byakuren » Tue Jan 17, 2017 09:42

D00Med wrote:This seems very interesting, especially this: "Modders can write mobs that don't use any framework, by just implementing the interface"
Now I just have to get my head around how to use the mod :]

Just in case there's any misunderstanding, this just means CMI can be used on your mob as long as it implements the interface. CMI won't make your mob walk around or attack players by itself, that would have to be coded by the mob author.
Every time a mod API is left undocumented, a koala dies.
 


Return to WIP Mods

Who is online

Users browsing this forum: No registered users and 48 guests

cron