[mod] water_life - mobs for mobkit - V212301[water_life]
-
- Member
- Posts: 1189
- Joined: Thu Aug 27, 2015 10:55
- GitHub: berengma
- IRC: Gundul
- Location: Europe/Asia
- Contact:
Re: [mod] water_life - mobs for mobkit[water_life]
update again:
I wasn't happy with spawning function so I wrote it new from scratch.
It uses much less checks now and works faster and more accurate.
All spawnpositions are calculated in every players view direction
+- 45 degrees.
Number of max spawned sharks reduced. But sharks have faster attackspeed
and are much more sensible of what is in the water. (Viewrange is 75% of
active_object_send_block_range)
Whales now dive under platforms floating on the water surface.
I wasn't happy with spawning function so I wrote it new from scratch.
It uses much less checks now and works faster and more accurate.
All spawnpositions are calculated in every players view direction
+- 45 degrees.
Number of max spawned sharks reduced. But sharks have faster attackspeed
and are much more sensible of what is in the water. (Viewrange is 75% of
active_object_send_block_range)
Whales now dive under platforms floating on the water surface.
My servers: Jungle, Lilly in the valley click for my mods
-
- Member
- Posts: 1189
- Joined: Thu Aug 27, 2015 10:55
- GitHub: berengma
- IRC: Gundul
- Location: Europe/Asia
- Contact:
Re: [mod] water_life - mobs for mobkit[water_life]
little update:
diving beneath floating platforms on water is working better now. Checking for is_gound_content is not
reliable for all nodes.
changed spawn chance of whale and shark to promille in init.lua. 10 promille = 1 percent
A big impact on cpu time was the spawning function again:
now only every 5 seconds we are iterating online players and check for spawns.
before every serverstep it was iterating all online players and threw a dice.
saved 10-20% cpu time on one core of ZombieTest.
diving beneath floating platforms on water is working better now. Checking for is_gound_content is not
reliable for all nodes.
changed spawn chance of whale and shark to promille in init.lua. 10 promille = 1 percent
A big impact on cpu time was the spawning function again:
Code: Select all
local function spawnstep(dtime)
timer = timer + dtime
if timer > 5 then
for _,plyr in ipairs(minetest.get_connected_players()) do
before every serverstep it was iterating all online players and threw a dice.
saved 10-20% cpu time on one core of ZombieTest.
My servers: Jungle, Lilly in the valley click for my mods
-
- Member
- Posts: 1189
- Joined: Thu Aug 27, 2015 10:55
- GitHub: berengma
- IRC: Gundul
- Location: Europe/Asia
- Contact:
Re: [mod] water_life - mobs for mobkit[water_life]
Riverfish:
added small fish populating the rivers.
They need river_water_source to spawn and they
drop meat if killed.
There is no animation yet, as soon as I progress on how
to use blender, bones and armatures there will be in the future.

added small fish populating the rivers.
They need river_water_source to spawn and they
drop meat if killed.
There is no animation yet, as soon as I progress on how
to use blender, bones and armatures there will be in the future.

My servers: Jungle, Lilly in the valley click for my mods
Re: [mod] water_life - mobs for mobkit[water_life]
Nice mod!
Is just a suggestion, but it can be more pixelart/lowpoly like?
nice shark btw
Is just a suggestion, but it can be more pixelart/lowpoly like?
nice shark btw
-
- Member
- Posts: 1189
- Joined: Thu Aug 27, 2015 10:55
- GitHub: berengma
- IRC: Gundul
- Location: Europe/Asia
- Contact:
Re: [mod] water_life - mobs for mobkit[water_life]
For sharks all credits go to Termos, as the model and texture were from his zombiestrd mod.Melkor wrote:Nice mod!
Is just a suggestion, but it can be more pixelart/lowpoly like?
nice shark btw
Model and texture of the whale is not from me also. Should be mentioned in the first post and
in license.txt.
I wrote the most of the code, but did little design. I am totally new to blender so that may take a while
until I will get anything useful out of there X)
That is why the riverfish is, like it is. A free to download model and texture from the internet. :D
So if you or somebody else would like to provide a better, more suiting model/texture for riverfish I
would be happy to use it.
My servers: Jungle, Lilly in the valley click for my mods
-
- Member
- Posts: 1189
- Joined: Thu Aug 27, 2015 10:55
- GitHub: berengma
- IRC: Gundul
- Location: Europe/Asia
- Contact:
Re: [mod] water_life - mobs for mobkit[water_life]
new behaviour !
added new function to the water_life api:
function water_life.hq_swimfrom(self,prty,tgtobj)
this will make a mob flee from tgtobj until it is out of it's view range.
Introduced for the new riverfish, so when you get near them, they will try to
run off.
As the api is growing, I will do some documentation shortly.
added new function to the water_life api:
function water_life.hq_swimfrom(self,prty,tgtobj)
this will make a mob flee from tgtobj until it is out of it's view range.
Introduced for the new riverfish, so when you get near them, they will try to
run off.
As the api is growing, I will do some documentation shortly.
My servers: Jungle, Lilly in the valley click for my mods
Re: [mod] water_life - mobs for mobkit[water_life]
Nice, im going to give it a try. Im gonna make a cute lowpoly pixelart fishGundul wrote:So if you or somebody else would like to provide a better, more suiting model/texture for riverfish I
would be happy to use it.
-
- Member
- Posts: 1189
- Joined: Thu Aug 27, 2015 10:55
- GitHub: berengma
- IRC: Gundul
- Location: Europe/Asia
- Contact:
Re: [mod] water_life - mobs for mobkit[water_life]
Hurray :)Melkor wrote:Nice, im going to give it a try. Im gonna make a cute lowpoly pixelart fishGundul wrote:So if you or somebody else would like to provide a better, more suiting model/texture for riverfish I
would be happy to use it.
I am already curious what it will look like :)
My servers: Jungle, Lilly in the valley click for my mods
Re: [mod] water_life - mobs for mobkit[water_life]
I made this little fish, but im not sure if is good enough, it is even animated!

Tell me what you think, i think the texture is a bit bland
Tell me what you think, i think the texture is a bit bland
- Attachments
-
- riverfish.gif
- (858.08 KiB) Not downloaded yet
-
- Member
- Posts: 1189
- Joined: Thu Aug 27, 2015 10:55
- GitHub: berengma
- IRC: Gundul
- Location: Europe/Asia
- Contact:
Re: [mod] water_life - mobs for mobkit[water_life]
That looks already very nice.Melkor wrote:I made this little fish, but im not sure if is good enough, it is even animated!
Tell me what you think, i think the texture is a bit bland
The texture is also good, I think. Must see it when the fish is
swimming in the water. But it is a riverfish, not some tropical coral inhabitant :)
Only i'ts belly is maybe a bit too flat ?
I can't really imagine what it looks like when seen
from front or behind.
My servers: Jungle, Lilly in the valley click for my mods
Re: [mod] water_life - mobs for mobkit[water_life]
Here is the 7z, it has 6 files (license, .blend, a .png and the originals gimp files in case you need to edit them)
It has a couple of animations: a swimming and a idle animation. Actually im not too confident with my ability to animate, so i left this point to you, or someone else if you think it needs a improvement.
Good luck and happy modding!
- Attachments
-
- riverfish.7z
- The 3D file
- (142.27 KiB) Downloaded 24 times
-
- riverfish001.png
- (10.19 KiB) Not downloaded yet
-
- Member
- Posts: 1189
- Joined: Thu Aug 27, 2015 10:55
- GitHub: berengma
- IRC: Gundul
- Location: Europe/Asia
- Contact:
Re: [mod] water_life - mobs for mobkit[water_life]
Thank you very much for your work.Melkor wrote:
Here is the 7z, it has 6 files (license, .blend, a .png and the originals gimp files in case you need to edit them)
It has a couple of animations: a swimming and a idle animation.
I like the new riverfish and will try to add it today to water_life.
My servers: Jungle, Lilly in the valley click for my mods
-
- Member
- Posts: 1189
- Joined: Thu Aug 27, 2015 10:55
- GitHub: berengma
- IRC: Gundul
- Location: Europe/Asia
- Contact:
Re: [mod] water_life - mobs for mobkit[water_life]
New Riverfish with animations

The riverfish has a new texture and even animations now. A big thank you
again to Melkor for painting and animating it.
riverfish needs default:river_water_source to live in and to spawn. It is a quiet small
fish giving only one piece of meat when killed. In very rare cases you can find a diamond
in his belly. When approaching riverfish, they will try to escape from you until out of their
eyesight.
The riverfish has a new texture and even animations now. A big thank you
again to Melkor for painting and animating it.
riverfish needs default:river_water_source to live in and to spawn. It is a quiet small
fish giving only one piece of meat when killed. In very rare cases you can find a diamond
in his belly. When approaching riverfish, they will try to escape from you until out of their
eyesight.
My servers: Jungle, Lilly in the valley click for my mods
-
- Member
- Posts: 1189
- Joined: Thu Aug 27, 2015 10:55
- GitHub: berengma
- IRC: Gundul
- Location: Europe/Asia
- Contact:
Re: [mod] water_life - mobs for mobkit[water_life]
Is there a way to turn the riverfish around z axis 180 degrees ?
I know how to turn around the model, by pressing r,z,180,enter but the bones
and stuff stay in place that case.
Because after exporting it to b3d it is moving backwards. It's butt is where should be it's
head :) So I am using negative speed to make it look like it is going forward :)
I know how to turn around the model, by pressing r,z,180,enter but the bones
and stuff stay in place that case.
Because after exporting it to b3d it is moving backwards. It's butt is where should be it's
head :) So I am using negative speed to make it look like it is going forward :)
My servers: Jungle, Lilly in the valley click for my mods
Re: [mod] water_life - mobs for mobkit[water_life]
Yes, instead of selecting the model you select the main bone, go to object mode and rotate it just like you would rotate the model. Since it's set as parent to everything else, the whole model should rotate. If something doesn't rotate you have selected the wrong bone.Gundul wrote: Is there a way to turn the riverfish around z axis 180 degrees ?
-
- Member
- Posts: 1189
- Joined: Thu Aug 27, 2015 10:55
- GitHub: berengma
- IRC: Gundul
- Location: Europe/Asia
- Contact:
Re: [mod] water_life - mobs for mobkit[water_life]
Thanks, that did it :)Eran wrote:Yes, instead of selecting the model you select the main bone, go to object mode and rotate it just like you would rotate the model. Since it's set as parent to everything else, the whole model should rotate. If something doesn't rotate you have selected the wrong bone.Gundul wrote: Is there a way to turn the riverfish around z axis 180 degrees ?
My servers: Jungle, Lilly in the valley click for my mods
-
- Member
- Posts: 1189
- Joined: Thu Aug 27, 2015 10:55
- GitHub: berengma
- IRC: Gundul
- Location: Europe/Asia
- Contact:
Re: [mod] water_life - mobs for mobkit[water_life]
little update.
I turned river_fish model into right position. That means it is not swimming backwards
anymore and position is centered in collisionbox.
little changes in the riverfish behavior.
started to move functions from init.lua to api.lua and make them globally available.
I hope next weekend I can start with documentation.
I turned river_fish model into right position. That means it is not swimming backwards
anymore and position is centered in collisionbox.
little changes in the riverfish behavior.
started to move functions from init.lua to api.lua and make them globally available.
I hope next weekend I can start with documentation.
My servers: Jungle, Lilly in the valley click for my mods
-
- Member
- Posts: 1189
- Joined: Thu Aug 27, 2015 10:55
- GitHub: berengma
- IRC: Gundul
- Location: Europe/Asia
- Contact:
Re: [mod] water_life - mobs for mobkit[water_life]
----- Update
Riverfish can be caught and tamed by catching it with a bugnet. rightlick on a fish with bugnet in hand.
Tamed riverfish will be statically saved, can not be harmed or caught be other than the owner.
Caught riverfish can also be eaten rawly or you can use it as shark food.
You can also just make it swim in your pond or pool. Tamed fish will not escape if you come near them.
Riverfish can be caught and tamed by catching it with a bugnet. rightlick on a fish with bugnet in hand.
Tamed riverfish will be statically saved, can not be harmed or caught be other than the owner.
Caught riverfish can also be eaten rawly or you can use it as shark food.
You can also just make it swim in your pond or pool. Tamed fish will not escape if you come near them.
My servers: Jungle, Lilly in the valley click for my mods
-
- Member
- Posts: 1189
- Joined: Thu Aug 27, 2015 10:55
- GitHub: berengma
- IRC: Gundul
- Location: Europe/Asia
- Contact:
Re: [mod] water_life - mobs for mobkit[water_life]
Update:
-------------
added api documentation in the lua_api.txt file.
api introduces new helper funczions and hq behaviors:
-------------
added api documentation in the lua_api.txt file.
api introduces new helper funczions and hq behaviors:
Code: Select all
---------------
Water_life Api:
---------------
useful constants:
------------------
water_life.abr = minetest.get_mapgen_setting('active_block_range') or 2
water_life.abo = minetest.get_mapgen_setting('active_object_send_range_blocks') or 3
water_life.maxwhales = 1
water_life.maxsharks = water_life.abo/2
water_life.maxmobs = 30
helper functions:
-----------------
water_life.leftorright()
returns true with a possibility of 50% else returns false
water_life.register_shark_food(name)
register enitiy "name" as shark food. Will be attacked by sharks if in water and in sight
water_life.count_objects(pos,radius)
counts objects around pos with radius in nodes and returns a table:
table.all - total number of all objects
table.sharks - total number of sharks
table.whales - total number of whales
table.fish - total number of fish wild/tamed
water_life.handle_drops(self)
call this on death of an entity and define drops in entity definition like this:
chances are in 100/x. So chance =1 means 100%, 2 = 50%, 3 = 33 1/3 %, ...
drops = {
{name = "default:diamond", chance = 5, min = 1, max = 5,},
{name = "water_life:meat_raw", chance = 2, min = 1, max = 5,},
},
water_life.get_yaw_to_object(self,tgtobj)
returns 2D angle in rad tgtobj seen from self
HQ Behaviors:
-----------
water_life.hq_swimfrom(self,prty,tgtobj,speed)
mob will turn 90 degrees away from target and try to escape until target is out of viewrange + 50%
water_life.big_hq_aqua_turn(self,prty,tyaw,speed)
will turn mob with large collisionbox to tyaw with speed
water_life.big_aqua_roam(self,prty,speed)
mob with large collisionbox will roam the waters with given speed.
A bit like mobkit.hq_aqua_roam with less turns
My servers: Jungle, Lilly in the valley click for my mods
-
- Member
- Posts: 1189
- Joined: Thu Aug 27, 2015 10:55
- GitHub: berengma
- IRC: Gundul
- Location: Europe/Asia
- Contact:
Re: [mod] water_life - mobs for mobkit[water_life]
Now all riverfish will avoid swim into sea water. Or if they do they will try to find back a way
to riverwater.
Also added new behaviour to water_life api:
-- swim to the next "node" which is inside viewrange or quit
function water_life.hq_swimto(self,prty,speed,node)
and helper function:
-- returns 2D angle from self to pos in radians
function water_life.get_yaw_to_pos(self,target)
to riverwater.
Also added new behaviour to water_life api:
-- swim to the next "node" which is inside viewrange or quit
function water_life.hq_swimto(self,prty,speed,node)
and helper function:
-- returns 2D angle from self to pos in radians
function water_life.get_yaw_to_pos(self,target)
My servers: Jungle, Lilly in the valley click for my mods
-
- Member
- Posts: 1189
- Joined: Thu Aug 27, 2015 10:55
- GitHub: berengma
- IRC: Gundul
- Location: Europe/Asia
- Contact:
Re: [mod] water_life - mobs for mobkit[water_life]
Update spawn function again.
Now using a custom way to find possible spawn points.
Also liquidflag is devided in "sea","river" or nil which helps
to save many unneeded checks.
Now using a custom way to find possible spawn points.
Also liquidflag is devided in "sea","river" or nil which helps
to save many unneeded checks.
My servers: Jungle, Lilly in the valley click for my mods
-
- Member
- Posts: 1189
- Joined: Thu Aug 27, 2015 10:55
- GitHub: berengma
- IRC: Gundul
- Location: Europe/Asia
- Contact:
Re: [mod] water_life - mobs for mobkit[water_life]
Update again:
New radar function which uses raycasting instead of
excessive checking for water nodes. It returns two
values for left or right depending on which side of the
mob were more obstacles found and how near they
were to its center position.
water_life.radar(pos ,yaw ,radius, water)
This will check starting from pos in direction yaw with a
distance of radius. If water is false it works as sonar.
(That means water nodes are like air nodes)
If water is true it will work as radar also in the future. I will
add two returned values for up and down.
all returned values are integer.
Using raycasting needs much less cpu than checking areas for nodes.
New radar function which uses raycasting instead of
excessive checking for water nodes. It returns two
values for left or right depending on which side of the
mob were more obstacles found and how near they
were to its center position.
water_life.radar(pos ,yaw ,radius, water)
This will check starting from pos in direction yaw with a
distance of radius. If water is false it works as sonar.
(That means water nodes are like air nodes)
If water is true it will work as radar also in the future. I will
add two returned values for up and down.
all returned values are integer.
Using raycasting needs much less cpu than checking areas for nodes.
My servers: Jungle, Lilly in the valley click for my mods
-
- Member
- Posts: 1189
- Joined: Thu Aug 27, 2015 10:55
- GitHub: berengma
- IRC: Gundul
- Location: Europe/Asia
- Contact:
Re: [mod] water_life - mobs for mobkit[water_life]
finished radar function:
it will return 6 integer values: left, right, up, down, under. above
the higher one of the values right, left, up and down the more
and the nearer an obstacle is to the entity
under tells you the distance from pos to ground below the entity
while above tells distance to the ceiling. If ground or ceiling is
deeper/higher than radius, radius will be returned
see complete documentation of calculations in lua_api.txt
added settingtypes.txt for easy changing values
api_only disables all animals and makes only api available
radar_debug prints debug of radar function in chat
I hope this function can maybe also help the eagle from
aerotest/mobkit find its way :)
my whales are using this function. Turn debug on to see
how it works
it will return 6 integer values: left, right, up, down, under. above
the higher one of the values right, left, up and down the more
and the nearer an obstacle is to the entity
under tells you the distance from pos to ground below the entity
while above tells distance to the ceiling. If ground or ceiling is
deeper/higher than radius, radius will be returned
see complete documentation of calculations in lua_api.txt
added settingtypes.txt for easy changing values
api_only disables all animals and makes only api available
radar_debug prints debug of radar function in chat
I hope this function can maybe also help the eagle from
aerotest/mobkit find its way :)
my whales are using this function. Turn debug on to see
how it works
My servers: Jungle, Lilly in the valley click for my mods
-
- Member
- Posts: 1189
- Joined: Thu Aug 27, 2015 10:55
- GitHub: berengma
- IRC: Gundul
- Location: Europe/Asia
- Contact:
Re: [mod] water_life - mobs for mobkit[water_life]
implemented the new water_life.radar function in Termos aerotest mod featering Extex Eagle model and animation
viewtopic.php?f=9&t=22112&start=300#p361413
It is not yet perfect, but the eagle is already avoiding obstacels very well.
try yourself or join ZombieTest server to try it out.
"/eagle" will spawn an eagle in front of you, flying away in player's view direction
depends on : mobkit, water_life
All credits for Code goes to Termos, excapt radar implementation
Model/Texture by Extex
viewtopic.php?f=9&t=22112&start=300#p361413
It is not yet perfect, but the eagle is already avoiding obstacels very well.
try yourself or join ZombieTest server to try it out.
"/eagle" will spawn an eagle in front of you, flying away in player's view direction
depends on : mobkit, water_life
All credits for Code goes to Termos, excapt radar implementation
Model/Texture by Extex
- Attachments
-
- aerotest.zip
- Aerotest with radar from water_life
- (76.5 KiB) Downloaded 15 times
Last edited by Gundul on Tue Jan 14, 2020 03:19, edited 1 time in total.
My servers: Jungle, Lilly in the valley click for my mods
Re: [mod] water_life - mobs for mobkit[water_life]
Cool I'll try it out. Also its Extex XDGundul wrote:implemented the new water_life.radar function in Termos aerotest mod featering ExTex Eagle model and animation
viewtopic.php?f=9&t=22112&start=300#p361413
It is not yet perfect, but the eagle is already avoiding obstacels very well.
try yourself or join ZombieTest server to try it out.
"/eagle" will spawn an eagle in front of you, flying away in player's view direction
depends on : mobkit, water_life
All credits for Code goes to Termos, excapt radar implementation
Model/Texture by ExTex
Oh also could you please use the updated model and texture here: viewtopic.php?f=9&t=22112&start=375#p363312
The old one has a broken flap animation and the texture got discoloured somehow.
For some reason Termos isn't updating it
Player of PK, RIP. Creator of the light_tool and motorbike mods. Working on another mod which should be coming soon!
Who is online
Users browsing this forum: Bing [Bot] and 8 guests