[Mod] Creatures [git] [minetest_mods_creatures]

User avatar
MirceaKitsune
Member
Posts: 924
Joined: Sat May 21, 2011 22:31
GitHub: MirceaKitsune
IRC: Taoki
In-game: MirceaKitsune
Location: Romania, Bucharest

Re: [Mod] Creatures [minetest_mods_creatures]

by MirceaKitsune » Post

bbaez: Thanks for the feedback and glad you're interested in the mod! The main difference between this and other mob mods I've seen is that Creatures works by defining races, where species are played by either players or mobs. Unlike the classic approach, where players are the people while mobs are monsters or animals, the only differences between players and mobs here are technical... each creature is simply subject to its species's limitations and capabilities, mobs and players are the same. Also, another difference (added recently) is that this mob mod is rather intended as a platform, which anyone else can design their own mods for and even override the default AI.

As for adding new creatures, this is my current approach: You can already design your own creatures as separate mods, while it's easy to disable the existing ones. However, I still make changes to the API, and there's a chance I might break stuff. So instead, I advice people to send me the art (rigged + animated models of good mobs) as long as it's license compatible and of good quality while not breaking the theme, and the source (blend file) is available. Mention what settings you'd like for the creature and what it should do, and if it's good I add it to races_default. I haven't looked into this yet but might in the future.

prestidigitator: Not really... although that sounds rather hacky. Like I said, my primary plan here is to have mobs able to use attack items like players (sword, bow, etc). Though to be honest, an ability to customize the default punch function might be useful. For example, if I add a dragon that can breathe fire, I wouldn't necessarily want the fire breather to be an item... and of course both mob and player dragons should breathe fire. So this is worth considering, but only if it can be scripted properly.

prestidigitator
Member
Posts: 647
Joined: Thu Feb 21, 2013 23:54

Re: [Mod] Creatures [minetest_mods_creatures]

by prestidigitator » Post

MirceaKitsune wrote:prestidigitator: Not really... although that sounds rather hacky. Like I said, my primary plan here is to have mobs able to use attack items like players (sword, bow, etc). Though to be honest, an ability to customize the default punch function might be useful. For example, if I add a dragon that can breathe fire, I wouldn't necessarily want the fire breather to be an item... and of course both mob and player dragons should breathe fire. So this is worth considering, but only if it can be scripted properly.
Right. I don't think it's a hack, though. If you should be able to do something without a tool in your hand, that's defined by the default tool (":"). For example, the "default" mod of "minetest_game" defines:

Code: Select all

-- The hand
minetest.register_item(":", {
    type = "none",
    wield_image = "wieldhand.png",
    wield_scale = {x=1,y=1,z=2.5},
    tool_capabilities = {
        full_punch_interval = 0.9,
        max_drop_level = 0,
        groupcaps = {
            crumbly = {times={[2]=3.00, [3]=0.70}, uses=0, maxlevel=1},
            snappy = {times={[3]=0.40}, uses=0, maxlevel=1},
            oddly_breakable_by_hand = {times={[1]=3.50,[2]=2.00,[3]=0.70}, uses=0}
        },
        damage_groups = {fleshy=1},
    }
})
So rather than being hacky, I think it's the exact right way to do just this, designed into the engine.

User avatar
MirceaKitsune
Member
Posts: 924
Joined: Sat May 21, 2011 22:31
GitHub: MirceaKitsune
IRC: Taoki
In-game: MirceaKitsune
Location: Romania, Bucharest

Re: [Mod] Creatures [minetest_mods_creatures]

by MirceaKitsune » Post

This has been inactive for a while. I haven't done any more changes since my last post here, but am still curious to hear what people think and if this is working properly. Are you experiencing any bugs? Do you think anything important can and should be improved? Also remember that the mod is open for pull requests if you wish to add anything yourself... although you should ask me first to be sure it's a change I can accept.

User avatar
Topywo
Member
Posts: 1721
Joined: Fri May 18, 2012 20:27

Re: [Mod] Creatures [minetest_mods_creatures]

by Topywo » Post

Maybe this part:

"Important: For the mod to work properly, you must first disable the default player script. To do that, open minetest_game/mods/default/init.lua and comment out the dofile line for player.lua.:"

scares potential users off.

User avatar
MirceaKitsune
Member
Posts: 924
Joined: Sat May 21, 2011 22:31
GitHub: MirceaKitsune
IRC: Taoki
In-game: MirceaKitsune
Location: Romania, Bucharest

Re: [Mod] Creatures [minetest_mods_creatures]

by MirceaKitsune » Post

Topywo wrote:Maybe this part:

"Important: For the mod to work properly, you must first disable the default player script. To do that, open minetest_game/mods/default/init.lua and comment out the dofile line for player.lua.:"

scares potential users off.
Yes... I need to add a change to minetest_game to allow disabling the normal player script. minetest_game in its current form is not very friendly toward mods that implement their own player appearance management function. A switch was added to the bones mod however, so it shouldn't be too hard.

Mella
Member
Posts: 15
Joined: Sat Jun 21, 2014 14:58

Re: [Mod] Creatures [minetest_mods_creatures]

by Mella » Post

MirceaKitsune wrote:
Topywo wrote:Maybe this part:

"Important: For the mod to work properly, you must first disable the default player script. To do that, open minetest_game/mods/default/init.lua and comment out the dofile line for player.lua.:"

scares potential users off.
Yes... I need to add a change to minetest_game to allow disabling the normal player script. minetest_game in its current form is not very friendly toward mods that implement their own player appearance management function. A switch was added to the bones mod however, so it shouldn't be too hard.
But I guess that would be easier if you'd just create a new game ;) The mod already sounds great, I can't wait to give it a try :D

User avatar
balthazariv
Member
Posts: 214
Joined: Mon Apr 07, 2014 15:48
Contact:

Re: [Mod] Creatures [minetest_mods_creatures]

by balthazariv » Post

Hello,

It's a mod such as [Mod] Creatures [1.1.4 beta] [creatures] or it's a complement because you have the same name ?

User avatar
philipbenr
Member
Posts: 1897
Joined: Fri Jun 14, 2013 01:56
GitHub: philipbenr
IRC: philipbenr
In-game: robinspi
Location: United States

Re: [Mod] Creatures [minetest_mods_creatures]

by philipbenr » Post

Only one is supposed to be used. One or the other

User avatar
MirceaKitsune
Member
Posts: 924
Joined: Sat May 21, 2011 22:31
GitHub: MirceaKitsune
IRC: Taoki
In-game: MirceaKitsune
Location: Romania, Bucharest

Re: [Mod] Creatures [minetest_mods_creatures]

by MirceaKitsune » Post

It's a coincidence that I used the same name. I didn't know someone else made a mod named exactly the same way when I started this. Since I have the branch and everything already set up, it would be too late to rename it now. Besides... they two mods would certainly not work together, nor make sense to run at the same time.

Either way, I'm still looking for more servers to run this, so I can experience it more in multiplayer. Let me know if you find any issues or simple improvements to the basic system.

User avatar
MirceaKitsune
Member
Posts: 924
Joined: Sat May 21, 2011 22:31
GitHub: MirceaKitsune
IRC: Taoki
In-game: MirceaKitsune
Location: Romania, Bucharest

Re: [Mod] Creatures [minetest_mods_creatures]

by MirceaKitsune » Post

I'm happy to announce two major additions to the Creatures mod, which Minetest players have been eager to see in any of the existing mob mods for some time:

- Experimental pathfinding. Enable it by adding "pathfinding = true" in minetest.conf. Currently it's very buggy and barely works, so this is only for testing purposes! Testing and reporting is highly encouraged, as well as looking at the Lua function and suggesting any changes. You can see the code over here, and should also take a look at this thread if you're interested. At this stage, mobs rarely walk toward their target, since minetest.find_path fails frequently... although they sometimes succeed in following the correct pattern to some extent.

- Line of sight: minetest.line_of_sight has been added to the mix. Mobs will only attack / avoid / follow targets which aren't blocked by walls. They will however continue to pursue existing targets, until they're out of their maximum view range, even if they hid out of view while being chased. Mobs will also attack those who hit their allies regardless of visibility, since from a logical perspective a fight would still be heard behind a wall.

User avatar
MirceaKitsune
Member
Posts: 924
Joined: Sat May 21, 2011 22:31
GitHub: MirceaKitsune
IRC: Taoki
In-game: MirceaKitsune
Location: Romania, Bucharest

Re: [Mod] Creatures [minetest_mods_creatures]

by MirceaKitsune » Post

It seems pathfinding hasn't brought much excitement to this mod in the last 24 hours. So let's ramp things up a bit, with another exciting new feature for mobs:

Mobs would previously roam only when idle, by selecting a random position within their line of sight. This all changed today with the new node targeting system. You can now define a list of nodes or node groups, a minimum and maximum light level, whether to follow or avoid the node, and a target priority. Multiple entries are possible, and each uses one slot in the target list (previously used only for following / attacking / avoiding players and mobs). This also means that a high priority node can make mobs interested in walking toward that node rather than following or attacking another creature. For each entry, a random node is selected per execution, and only one node is handled at once.

The only visible change for the default creature set is that humans and sheep will only roam in areas which are lit, while some monsters will only wander around dark places. This means that during the day, people roam freely while monsters will retreat in caves or under the shades of trees... whereas during the night, monsters will walk everywhere while people will gather around areas lit by torches. This fully allows the behavior villagers have in Minecraft, where each villager goes outside during the day but in a house during the night... with the only exception that mobs can't open and close doors on their own yet.

Potential use cases include making sheep walk toward planted grass... as well as implementing a mob repellant node which makes monsters run away from it, that people can place in their homes to scare monsters away. Later on, mobs can be made to walk to chests and furnaces, and even manipulate their contents someday. For now however, the most intriguing use case is tempting people to walk into houses, or gather around specific objects.

Sokomine
Member
Posts: 4276
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine
IRC: Sokomine
In-game: Sokomine

Re: [Mod] Creatures [minetest_mods_creatures]

by Sokomine » Post

Even thouch I didn't write anything here, and hardly get around testing mods recently, this is a very intresting development, and I'll need part of that later on.
MirceaKitsune wrote: This means that during the day, people roam freely while monsters will retreat in caves or under the shades of trees... whereas during the night, monsters will walk everywhere while people will gather around areas lit by torches.
Sounds fine. I'd love it if sheep where to roam around during the day, but would try to seek other sheep during the night. Other animals might also seek a tree and gather below that. Or - more practical perhaps - animals gathering at night at a hen house or at their feeding place. Though farm animals would be diffrent insofar as they'd be far more stupid than other mobs and would not require an intelligent movement algorithm. For those farm animals, fast execution and extremly low load for a server are the most important factors. Plus beeing protected from griefers (=players who want to kill/pick them up). Guess I'll eventually have to write such a mod.
MirceaKitsune wrote: This fully allows the behavior villagers have in Minecraft, where each villager goes outside during the day but in a house during the night... with the only exception that mobs can't open and close doors on their own yet.
I don't want to duplicate MC behaviour as such. The ideal behaviour for villagers might be to walk around randomly during the day, gather in the church or pub in the evening, and then go to their respective homes. I've got the villages as such mostly ready, the data structure of the villages is stored (it is known where each house is and what type it is; the road system is known), and the trading functionality is implemented in mobf_trader. These traders so far only know how to stand around all day. I'm not sure if there's a good way to handle a larger village where the mob might get too far away from his home and beeing unloaded. Or in how far simulation of villager behaviour is beneficial to gameplay as such. Pathfinding can even be pretty easy in that case as the area is flat and the village structure known.

Any ideas or perhaps even implementations regarding villagers are highly welcomed.
A list of my mods can be found here.

User avatar
MirceaKitsune
Member
Posts: 924
Joined: Sat May 21, 2011 22:31
GitHub: MirceaKitsune
IRC: Taoki
In-game: MirceaKitsune
Location: Romania, Bucharest

Re: [Mod] Creatures [minetest_mods_creatures]

by MirceaKitsune » Post

Sokomine wrote:Sounds fine. I'd love it if sheep where to roam around during the day, but would try to seek other sheep during the night. Other animals might also seek a tree and gather below that. Or - more practical perhaps - animals gathering at night at a hen house or at their feeding place. Though farm animals would be diffrent insofar as they'd be far more stupid than other mobs and would not require an intelligent movement algorithm. For those farm animals, fast execution and extremly low load for a server are the most important factors. Plus beeing protected from griefers (=players who want to kill/pick them up). Guess I'll eventually have to write such a mod.
With yesterday's changes, sheep will also roam during the day only, and look for lit areas during the night. Mobs following other mobs at a specific daytime isn't possible yet, and not something I see a point in implementing. However, friendly mobs tend to follow each other all the time... so if one sheep walks to safety as night falls, nearby sheep should follow it.
Sokomine wrote:I don't want to duplicate MC behaviour as such. The ideal behaviour for villagers might be to walk around randomly during the day, gather in the church or pub in the evening, and then go to their respective homes. I've got the villages as such mostly ready, the data structure of the villages is stored (it is known where each house is and what type it is; the road system is known), and the trading functionality is implemented in mobf_trader. These traders so far only know how to stand around all day. I'm not sure if there's a good way to handle a larger village where the mob might get too far away from his home and beeing unloaded. Or in how far simulation of villager behaviour is beneficial to gameplay as such. Pathfinding can even be pretty easy in that case as the area is flat and the village structure known.
I don't seek to duplicate MC either, just saying the same behavior is possible now. What you described is possible too, but with two notes: First of all, each type of building (church, pub, etc) should have an unique node as the floor, since the node name / group to walk on is currently used in detection. And second, only the actual light value is currently scanned, not daytime itself... so mobs can't tell between sunlight and the light in a house. I might consider adding a daytime check as well, but I don't wish to over-complicate things so I need to think about it.

Sokomine
Member
Posts: 4276
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine
IRC: Sokomine
In-game: Sokomine

Re: [Mod] Creatures [minetest_mods_creatures]

by Sokomine » Post

MirceaKitsune wrote: However, friendly mobs tend to follow each other all the time... so if one sheep walks to safety as night falls, nearby sheep should follow it.
Sounds good. Except that I'm not sure weather animals would seek light at night.
MirceaKitsune wrote: First of all, each type of building (church, pub, etc) should have an unique node as the floor, since the node name / group to walk on is currently used in detection.
Unique floors would be a bit difficult. It's easier in this case to supply the mob with coordinates directly. It's probably a diffrent way of application of movement/pathfinding. I hope to get far enough soon so that mobs can be placed into the villages and experiments regarding their behaviour beeing conducted. The requirements may be diffrent from free-moving mobs such as these here.
A list of my mods can be found here.

User avatar
MirceaKitsune
Member
Posts: 924
Joined: Sat May 21, 2011 22:31
GitHub: MirceaKitsune
IRC: Taoki
In-game: MirceaKitsune
Location: Romania, Bucharest

Re: [Mod] Creatures [minetest_mods_creatures]

by MirceaKitsune » Post

Sokomine wrote:Unique floors would be a bit difficult. It's easier in this case to supply the mob with coordinates directly. It's probably a diffrent way of application of movement/pathfinding. I hope to get far enough soon so that mobs can be placed into the villages and experiments regarding their behaviour beeing conducted. The requirements may be diffrent from free-moving mobs such as these here.
That would complicate the mod a lot more than I'd like it to be by default, even if I could think of a possible way to begin with. Buildings can be created in realtime, so without advanced computing you can't determine the indoor perimeter nor what that building represents.

There is however an easier way, already possible with yesterday's implementation: Just place a specific node inside each building. For example, if it's a house it will have a bed, so people mobs can simply walk to beds if they don't find a bright enough node. Note however that currently, a node must have an empty space (air) above it to be considered an objective, which I might change later.

twoelk
Member
Posts: 1482
Joined: Fri Apr 19, 2013 16:19
GitHub: twoelk
IRC: twoelk
In-game: twoelk
Location: northern Germany

Re: [Mod] Creatures [minetest_mods_creatures]

by twoelk » Post

So mobs could be enabled to search for certain freely chosen nodes, be it to seek them or to avoid them? NPC/Villagers could seek for certain new custom nodes that look like shop signs or maybe even be able to parse text from the textable signs to find the next place called pub ;-) MC villagers looked for doors and then checked for a roof or ceiling iirc, that would be an example of a behaviour I wouldn't mind if we copied. That is if doors could be convinced to accept certain mobs to interact with them.

As for mobs searching each other, I think that has much potential for convincing behaviour scripting such as making animals moving in herds or predators seeking for prey or even strategic hunting and attacking.

So if the mobs examine the nodes under or near their feet they will not step into plain air anymore and fall of cliffs? They also notice when in water and can be told to search the next coast?

(This has been edited several times because each time I read in the thread I noticed something else I had missed or understood wrong)

Guess I should play with this mod a little more so that I might know all it's possabilities, ... , ..., hmm, playing with electronic sheep, ... , that reminds me of something, ... , do they dream?

Sokomine
Member
Posts: 4276
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine
IRC: Sokomine
In-game: Sokomine

Re: [Mod] Creatures [minetest_mods_creatures]

by Sokomine » Post

twoelk wrote: That is if doors could be convinced to accept certain mobs to interact with them.
Afaik the mobs based on jordan4ibanez' mobs (peaceful mobs as well?) are capable of handling doors. Those from npcf might do so as well.
twoelk wrote: So if the mobs examine the nodes under or near their feet they will not step into plain air anymore and fall of cliffs? They also notice when in water and can be told to search the next coast?
Trying to avoid falling from cliffs may be expensive. It's one of the reasons why mobf is more complex (and occasionally slower) than simple mobs.
twoelk wrote: Guess I should play with this mod a little more so that I might know all it's possabilities, ... , ..., hmm, playing with electronic sheep, ... , that reminds me of something, ... , do they dream?
Only when the server's turned off.
A list of my mods can be found here.

User avatar
MirceaKitsune
Member
Posts: 924
Joined: Sat May 21, 2011 22:31
GitHub: MirceaKitsune
IRC: Taoki
In-game: MirceaKitsune
Location: Romania, Bucharest

Re: [Mod] Creatures [minetest_mods_creatures]

by MirceaKitsune » Post

It's time for the mod to receive new updates: I improved the formspec definition system, and wrote a formspec for all the default creatures. It's now designed to handle all player -> mob interaction... including possession, which was previously automated when right-clicking a mob while being a ghost. The formspec for the default creatures lists various data about that individual... including all personality traits, in case the creature is an ally.
Spoiler
Image
Image
Image
In the meantime, I'm still looking for more people to test this mod with. Are any servers runnig it? Have other people tried it in the meantime, and did anyone find any issues I should look into?

User avatar
MirceaKitsune
Member
Posts: 924
Joined: Sat May 21, 2011 22:31
GitHub: MirceaKitsune
IRC: Taoki
In-game: MirceaKitsune
Location: Romania, Bucharest

Re: [Mod] Creatures [minetest_mods_creatures]

by MirceaKitsune » Post

Today I implemented another plan I've had for a while: Mobs now have names, which are attributed randomly per individual! They are defined as nested tables, meaning that the first name and last name will each be random. Only the human mobs use this so far. An example of how they appear in the mob's formspec menu:
Spoiler
Image
Image

Sokomine
Member
Posts: 4276
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine
IRC: Sokomine
In-game: Sokomine

Re: [Mod] Creatures [minetest_mods_creatures]

by Sokomine » Post

MirceaKitsune wrote: Today I implemented another plan I've had for a while: Mobs now have names, which are attributed randomly per individual! They are defined as nested tables, meaning that the first name and last name will each be random. Only the human mobs use this so far.
Sounds fine! They ought to have names. Mobs kept as farm animals/pets might also warrant a name.
A list of my mods can be found here.

User avatar
MirceaKitsune
Member
Posts: 924
Joined: Sat May 21, 2011 22:31
GitHub: MirceaKitsune
IRC: Taoki
In-game: MirceaKitsune
Location: Romania, Bucharest

Re: [Mod] Creatures [minetest_mods_creatures]

by MirceaKitsune » Post

I admit I'm a bit disappointed at the lack of activity this has. Was hoping to get more attention and testers by now, since I think the mod can be used for a large variety of worlds and ideas.

I'd like to hear if any servers currently use this so I can try it out online as well. If not, and anyone here runs a server where they do want mobs, please let me know why not and if / why you prefer other mob mods over this. If I'm missing any important features or improvements, I can look into it and see. I want to take this mod far and make it usable at a large scale.

TeTpaAka
Member
Posts: 141
Joined: Sat Dec 28, 2013 21:54

Re: [Mod] Creatures [minetest_mods_creatures]

by TeTpaAka » Post

First of all, this is a very interessting mod. It adds a new aspect to the gameplay.

But in the current version you cannot possess a sheep or a rat. The sheep drops wool and the rat gets picked up. I think this has to do with the change of the default behavior to possess. All other creatures show a formspec in the code, except for these two.

Also I wonder if it would be possible to change the visual abilities of the creatures, so mobs that live in the dark would see better in caves, for example? Just for curiosity.

TeTpaAka

User avatar
MirceaKitsune
Member
Posts: 924
Joined: Sat May 21, 2011 22:31
GitHub: MirceaKitsune
IRC: Taoki
In-game: MirceaKitsune
Location: Romania, Bucharest

Re: [Mod] Creatures [minetest_mods_creatures]

by MirceaKitsune » Post

TeTpaAka wrote:First of all, this is a very interessting mod. It adds a new aspect to the gameplay.

But in the current version you cannot possess a sheep or a rat. The sheep drops wool and the rat gets picked up. I think this has to do with the change of the default behavior to possess. All other creatures show a formspec in the code, except for these two.

Also I wonder if it would be possible to change the visual abilities of the creatures, so mobs that live in the dark would see better in caves, for example? Just for curiosity.

TeTpaAka
Rat and sheep possession is indeed currently broken. I wasn't sure if to try enabling them again actually... but since it's a crazier aspect that people like the mod for, I'll think of a way in which it could be done.

Mob vision currently doesn't depend on brightness. It's a detail I might consider adding later on. Thanks for the idea.

User avatar
afflatus
Member
Posts: 362
Joined: Tue Apr 01, 2014 19:47
GitHub: 0-afflatus
IRC: afflatus
In-game: afflatus
Location: Avalonia
Contact:

Re: [Mod] Creatures [minetest_mods_creatures]

by afflatus » Post

I run a server and I like the idea of this mod, however I'm wary because it will radically change gameplay and I don't want to upset my existing players. I will download it, have a play in singleplayer and see if I can come up with some clear explanation of what I perceive the potential problems to be.
Grailtest is stirring ...

User avatar
MirceaKitsune
Member
Posts: 924
Joined: Sat May 21, 2011 22:31
GitHub: MirceaKitsune
IRC: Taoki
In-game: MirceaKitsune
Location: Romania, Bucharest

Re: [Mod] Creatures [minetest_mods_creatures]

by MirceaKitsune » Post

Just fixed several bugs in GIT. Including the player being able to hold down the left mouse button to continuously punch a mob, which spammed damage / attack sounds and target calculations... they now only happen if the punch is older than a second. Do let me know if you try this on a server :)

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 21 guests