[Mod] general base for mobs [mobapi]

User avatar
Casimir
Member
 
Posts: 1154
Joined: Fri Aug 03, 2012 16:59
GitHub: CasimirKaPazi

[Mod] general base for mobs [mobapi]

by Casimir » Tue Jul 29, 2014 20:09

There are many mods that add mobs. They provide the basic functions needed, but also always come with a predefined set of mobs. So this mod is the attempt to have a base structure everyone can use and improve. A mob-mod then would just contain the mobs definitions and depend on the mobapi.

git: https://github.com/CasimirKaPazi/mobapi
download: .zip
depends: nothing
license: WTFPL

At the moment it is PilzAdams simplemobs with changes done by ElectricSolstice. I just removed the mobs and updated the documentation.
As an example I attached the simplemobs mobs definitions as a mod (as described above). Also I suggest naming mods that depend on this one with "mobs_", as this makes it easier to differ them from standalone mods.
Attachments
mobs_simple.tar.gz
(180.84 KiB) Downloaded 184 times
Last edited by Casimir on Thu Feb 26, 2015 16:14, edited 1 time in total.
 

Sokomine
Member
 
Posts: 3616
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine

Re: [Mod] general base for mobs [mobapi]

by Sokomine » Tue Jul 29, 2014 22:40

Good idea. Instead of having multiple copies of the api in all those mods that use it out there, with your mod, it'll just be a single api that can be updated independently. Perhaps the api as such (without any mobs defined!) might even be included in minetest_next?

Some of the other mob mods out there are also rather frameworks than mob collections. mobf especially comes to mind. It is a more complex framework that allows to do a lot more than simple mobs. Its animals can be kept as farm animals, which is practically impossible with simple mobs. Another example is npcf, which is also a framework that just happens to ship with some sample mobs.

The ideal way would be to have mobs on one side, a common api for all of them, and implementations in the background that can be changed depending on what the player wants (i.e. simple and fast but more stuipid than the average cobble lump vs. might have one brain cell vs. suitable for an adventure world). But I'm afraid the mob mods are too diffrent for that. At least they run well alongside each other.
A list of my mods can be found here.
 

User avatar
Wuzzy
Member
 
Posts: 3242
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

Re: [Mod] general base for mobs [mobapi]

by Wuzzy » Sun Oct 19, 2014 10:10

Great idea indeed!
More people need to know about this.
The last time I’ve counted, we have 4 mods with the basename “mobs”. I hope people adopt this, as this will reduce redundancy.


BTW: Your thread title does not match the mod’s basename. The thread title says “mobapi”, but the folder name is “mobs_simple”, also “mobs_simple” is used all over the mod. This is misleading. Pick one basename and stick to it, please. Personally, I like “mobapi” more, but it’s your choice (but please don’t create a name clash).


Edit:
Could you look into this mod?: viewtopic.php?t=9917&p=151188
This mod makes some changes to the mobs API itself, it would be nice if you could somehow merge these changes. Or at least get in touch with the mod author.

Edit 2:
I looked into the code again. Your mod actually registers some mods, therefore it is actually not a pure API.

Edit 3:
Oh, forget the BTW and Edit 2 comments. I just found the Git repository. XD But could you release mobs_simple as a seperate mod in a seperate topic?

Edit 4:
Another suggestion: Could you please put all the documentation into the mod itself rather than just linking to it? That way the documentation can be viewed offline as well.
 

User avatar
Casimir
Member
 
Posts: 1154
Joined: Fri Aug 03, 2012 16:59
GitHub: CasimirKaPazi

Re: [Mod] general base for mobs [mobapi]

by Casimir » Sun Oct 26, 2014 18:03

To make it clear: mobapi is the mod that adds the API, this is what this Thread is about. mobs_simple is an example on how the API can be used.
At the moment I have very little time so there won't be any updates soon. If anyone likes to improve that mod in a clean way I will add that.

Planed changes are:
* Use line of sight to prevent mobs attacking through walls.
* Pushback when hitting a mob. Or at least make them stand still for a fraction of a second.
* Toolwearout when hitting a mob. It would be better if that would be in the engine itself.
 

User avatar
Minetestforfun
Member
 
Posts: 936
Joined: Tue Aug 05, 2014 14:09
Location: On earth
GitHub: Darcidride
IRC: Darcidride + MinetestForFun
In-game: Darcidride + MinetestForFun

Re: [Mod] general base for mobs [mobapi]

by Minetestforfun » Mon Oct 27, 2014 17:34

Hi,

The mob API of Carbone is awesome (mobs can swim, the knockback is very little so mobs are more dangerous, etc...) il you can integrate this features in your "general API"... :)
 

User avatar
Casimir
Member
 
Posts: 1154
Joined: Fri Aug 03, 2012 16:59
GitHub: CasimirKaPazi

Re: [Mod] general base for mobs [mobapi]

by Casimir » Sat Nov 01, 2014 16:54

I didn't knew that mobs can swim in carbone. That would be an interesting feature to have.

More todo:
* Update the documentation.
* Allow mobs to swim and spawn under water.
* Make it possible for mobs to attack each other (replace player with target).

Casimir wrote:* Use line of sight to prevent mobs attacking through walls.

Done that now. They also stop chasing players when they are out of sight.
 

User avatar
Wuzzy
Member
 
Posts: 3242
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

Re: [Mod] general base for mobs [mobapi]

by Wuzzy » Thu Feb 26, 2015 11:46

I have a few suggestions:
  • Make it possible to add sounds for these events:
    • Hostile mob detects player and begins to attack
    • Mob takes damage
    • Mob dies
  • Allow to change how frequently the random sound is played for a mob
  • Distribute the documentation with the mod (don't just point to external websites) (haha, I keep repeating myself)


PS: I am planning to use this mod in the next release of my subgame Weird (no matter if the suggestions are implemented). :-)
 

User avatar
TenPlus1
Member
 
Posts: 2422
Joined: Mon Jul 29, 2013 13:38
GitHub: tenplus1

Re: [Mod] general base for mobs [mobapi]

by TenPlus1 » Thu Feb 26, 2015 14:29

Mobs Redo 1.0 has attack and death sounds enabled within the Api as well as settings to make mobs float or sink on water as well as take fall damage... viewtopic.php?f=11&t=9917
 

User avatar
Casimir
Member
 
Posts: 1154
Joined: Fri Aug 03, 2012 16:59
GitHub: CasimirKaPazi

Re: [Mod] general base for mobs [mobapi]

by Casimir » Thu Feb 26, 2015 16:17

I now have more free time at hand, so I can take on those tasks. Thank your for the feedback - I really need to update the documentation. And It's nice to see someone using that mod.

By the way. If you register a spawn I recommend doing it with the names of the settings. Because there will be a change that would make it incompatible otherwise.
Code: Select all
-- Use this.
mobapi.register_spawn {
   name = "name",
   node = "node",
   ...
}
-- Instead of this.
mobapi:register_spawn{"name", "node", ...}


TenPlus1, you wouldn't mind if I borrow some of those features?
 

User avatar
TenPlus1
Member
 
Posts: 2422
Joined: Mon Jul 29, 2013 13:38
GitHub: tenplus1

Re: [Mod] general base for mobs [mobapi]

by TenPlus1 » Thu Feb 26, 2015 16:46

Casimir: you are more than welcome to use the api :) I'm updating it regularly with speed and feature improvements...
 

User avatar
Wuzzy
Member
 
Posts: 3242
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

Re: [Mod] general base for mobs [mobapi]

by Wuzzy » Sun Mar 08, 2015 10:46

@Casimir, I made a PR on GitHub, adding new sound effects for damage and death to the API. :-)
 

User avatar
Casimir
Member
 
Posts: 1154
Joined: Fri Aug 03, 2012 16:59
GitHub: CasimirKaPazi
 

User avatar
benrob0329
Member
 
Posts: 1238
Joined: Thu Aug 06, 2015 22:39
Location: Michigan
GitHub: Benrob0329
IRC: benrob0329
In-game: benrob03

Re: [Mod] general base for mobs [mobapi]

by benrob0329 » Fri Aug 14, 2015 11:19

Wow, why is no one using this for any other mobs??? I had the same idea, but based off of BlockMen's [creatures] Mod.

Would it be possible to use that sort of texture changing for eg. on hit or when you sheer a sheep?

Oh, and for [mobs_simple], I think that the [creatures] sheep look better than those from [simple_mobs] ;-)
 

4aiman
Member
 
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

Re: [Mod] general base for mobs [mobapi]

by 4aiman » Fri Aug 14, 2015 11:48

How about one little change to this mobs base?
In 2 words: WTFPL FOREVER.

While anyone will be able to relicense copies as he/she deems necessary, it would be a good thing to have this base totally free. So any addition to this very mod and this very repo should be licensed as WTFPL too?

Any *GPL* license would require to ask every other contributor to legally change or upgrade the license.
 

User avatar
Casimir
Member
 
Posts: 1154
Joined: Fri Aug 03, 2012 16:59
GitHub: CasimirKaPazi

Re: [Mod] general base for mobs [mobapi]

by Casimir » Sat Aug 15, 2015 08:04

@benrob
It's not used because it is not actively developed. At the moment it offers little advantage over not using it. People can just include the code in their mod and make the changes they need there.
Changing texture should be possible I think, but right now I don't know the best way to do so.

@4aiman
I don't quite understand what you mean. Do you want it to be GPL or WTFPL licensed? Because it already is the later.
Personally I prefer GPL but kept the original license of PilzAdams mod.
 

4aiman
Member
 
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

Re: [Mod] general base for mobs [mobapi]

by 4aiman » Sat Aug 15, 2015 17:47

I can't dictate which license to chose, but I would like this mod to stay WTFPL.
It is WTFPL now, but anyone can take it and change the license to GPL.
Then that someone may apply changes and thus become a contributor who should be asked whether he/she allows to count his/her changes as WTFPL-licensed.

It would be OK with only 1 or 2 ppl to ask, but with more it can become a pain in one's... head.
 

User avatar
benrob0329
Member
 
Posts: 1238
Joined: Thu Aug 06, 2015 22:39
Location: Michigan
GitHub: Benrob0329
IRC: benrob0329
In-game: benrob03

Re: [Mod] general base for mobs [mobapi]

by benrob0329 » Thu Sep 03, 2015 16:40

A few ideas:

Colorise the texture of the mob red when hurt

allow dynamic texture changing (instead of having to spawn eg a sheared sheep)

Add flying, swimming, and mineing types

factions (like MobF)

And breeding, like MobF and mobs redo, so we can farm



Just a few ideas gathered from other mobs mods.

BTW you could look at the way the Creatures does texture changing, that seems to work well.
 

User avatar
ArguablySane
Member
 
Posts: 116
Joined: Sun Oct 12, 2014 21:29

Re: [Mod] general base for mobs [mobapi]

by ArguablySane » Thu Sep 03, 2015 17:02

4aiman wrote:I can't dictate which license to chose, but I would like this mod to stay WTFPL.
It is WTFPL now, but anyone can take it and change the license to GPL.
Then that someone may apply changes and thus become a contributor who should be asked whether he/she allows to count his/her changes as WTFPL-licensed.

It would be OK with only 1 or 2 ppl to ask, but with more it can become a pain in one's... head.

Unless you're planning on taking this and making it closed source, there's no reason to care whether it's WTFPL or GPL. If it's GPL, just license any derivatives as GPL and you don't have to ask anyone's permission.
The above post and any ideas expressed therein are released to the public domain under a Creative Commons CC0 license.
 

User avatar
rubenwardy
Moderator
 
Posts: 5544
Joined: Tue Jun 12, 2012 18:11
Location: United Kingdom
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

Re: [Mod] general base for mobs [mobapi]

by rubenwardy » Thu Sep 03, 2015 17:17

He is planning on making it closed source (ie: not FLOSS), see Magichet

He doesn't understand WTFPL, the license is about giving you the right to do anything, no restrictions. He's basically turning it into CC-SA (doesn't actually exist).
 

User avatar
ArguablySane
Member
 
Posts: 116
Joined: Sun Oct 12, 2014 21:29

Re: [Mod] general base for mobs [mobapi]

by ArguablySane » Thu Sep 03, 2015 17:28

rubenwardy wrote:He is planning on making it closed source (ie: not FLOSS), see Magichet.

Oh, in that case I really hope the license gets changed to GPL. Minecraft has enough problems with closed-source anti-user mods, including some which had DRM designed to actively harm players' worlds, and I don't want the same thing happening with Minetest.
The above post and any ideas expressed therein are released to the public domain under a Creative Commons CC0 license.
 

4aiman
Member
 
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

Re: [Mod] general base for mobs [mobapi]

by 4aiman » Thu Sep 03, 2015 18:27

How nice it is when some Rubenwardy knows what 4aiman is only planning! :-\
Some doctors would love to run some experiments on your telepathy/future sight! XD
Just be sure to acknowledge when your guess fails w/o pinning the idea to someone else.
Just like CC-SA (What is that anyway? Relax, that was rhetorical)


FYI, Magichet has it's own mob API/AI written from scratch. Envy all you want ;)

But I'm really impressed that some of community members are so envy that they have nothing else to do but to tell ppl that I want to usurp everyone and everything :)

Thank you, my shy fans!
I really glad you're all here to discuss me and advertise me with yet another scandal!
 

User avatar
benrob0329
Member
 
Posts: 1238
Joined: Thu Aug 06, 2015 22:39
Location: Michigan
GitHub: Benrob0329
IRC: benrob0329
In-game: benrob03

Re: [Mod] general base for mobs [mobapi]

by benrob0329 » Thu Sep 03, 2015 20:03

Can we stay on topic please? For that matter, I believe 4aiman is planning on open sourcing Magichet in a few years.

If you want to go say that someone is planning to do something that would be against what the original mod author wants, then talk to them about it. I really don't like it when people decide to throw someone under the bus and get all off topic.
 

User avatar
Casimir
Member
 
Posts: 1154
Joined: Fri Aug 03, 2012 16:59
GitHub: CasimirKaPazi

Re: [Mod] general base for mobs [mobapi]

by Casimir » Thu Sep 03, 2015 20:47

benrob0329 wrote:Can we stay on topic please?

Ok.

So I added the API documentation now and realized that it might be better to separate the entity wise definition and the mod specific definition.

By the way, I would like to see this to be a community project, but just that you know this is the way I work:
Because it proved useful in Voxelgarden I will use three column todo list to organize working on the mod. There is a column labeled "bugs" one "improvements" and one "feature". Solving bugs comes first, making improvements to the code second, and when there is nothing else to do I will go on creating features. This will cause the development to be slow, but in the long run it will pay of. It does in Voxelgarden: I have almost no bugs to fix. Because every new feature adds on top of a very stable base. Most important is that improving the code to be more modular, precipitable and generic, by it self creates new features. Those then don't have to be coded separately.

About license: I will only change it if either PilzAdam and/or ElectricSolstice agree on a new license (because they are to be given most credit), or if the code base changes enough to justify ignoring their opinion. If you fork however it you can license it whatever you want. That's what the WTFPL says.
 

User avatar
duane
Member
 
Posts: 1274
Joined: Wed Aug 19, 2015 19:11
Location: Oklahoma City
GitHub: duane-r

Re: [Mod] general base for mobs [mobapi]

by duane » Fri Sep 04, 2015 07:06

Rather than starting with the original simplemobs, I'd recommend using mobs redo, which is much improved and has most of the features mentioned. Or, better yet, fork it and put all the improvements in one place. The mob api's are already fragmented. My new favorite mobs, goblins, are using mobs redo as a base.

I don't want to discourage more variety, but at the same time, everyone is working on the same problems, so they're duplicating effort.
Believe in people and you don't need to believe anything else.
 

4aiman
Member
 
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

Re: [Mod] general base for mobs [mobapi]

by 4aiman » Fri Sep 04, 2015 07:34

Sorry for offtopic.
Benrob is right nevertheless ;)

@Casimir
Now testing Voxelgarden.
Though it can't be named the most amazing subgame, it is definitely the one of most polished.
If the new API would be that polished, it is definitely worth waiting.
Keep up the good work!

As for the license, I doubt it would be useful to fork community project.
That's one of the reasons I've asked this mod to stay WTFPL-licensed.

Any addition can be applied to the original repo if that is stable enough. If it isn't - the "forker" will obtain yet another buggy API which was written by someone else and it would be easier to rewrite than to fix for that "forker". That is what I actually did )))


@duane
Mobs redo would have been a good idea, if there were someone assigned to making those more polished.
I know from my personal experience what it takes to "stabilize" someone else's code.
IMHO it is easier to pick up a stable base and then gradually making that better (maybe even add some migration code from the mobs redo).
Nodetest/Voxelgarden proved that to work.

However, if this would really become a community project, then Debian-style back-porting may render itself quite handy.
 


Return to WIP Mods



Who is online

Users browsing this forum: No registered users and 3 guests