Mobkit - Entity API [mobkit][alpha]

Termos
Member
 
Posts: 236
Joined: Sun Dec 16, 2018 12:50

Re: Mobkit - Entity API [mobkit][alpha]

by Termos » Sun Nov 03, 2019 19:25

Extex wrote:Image

Perfect!
Now onto the most important part, wings:
can you please make sure that with the wings spread, wing span is slightly greater than body length?
 

User avatar
ElCeejo
Member
 
Posts: 47
Joined: Thu Feb 28, 2019 23:29
In-game: ElCeejo

Re: Mobkit - Entity API [mobkit][alpha]

by ElCeejo » Mon Nov 04, 2019 07:49

I've been working with making swimming mobs that can leave or enter water freely. The problem I've encountered is non aquatic mobs avoid water, and aquatic mobs avoid shallow areas/land. My suggestion is to maybe have a "toggle" (Like fears_land or fears_water) so that some mobs won't avoid going in/out of water.
 

User avatar
runs
Member
 
Posts: 897
Joined: Sat Oct 27, 2018 08:32
GitHub: runsy

Re: Mobkit - Entity API [mobkit][alpha]

by runs » Mon Nov 04, 2019 10:54

ElCeejo wrote:I've been working with making swimming mobs that can leave or enter water freely. The problem I've encountered is non aquatic mobs avoid water, and aquatic mobs avoid shallow areas/land. My suggestion is to maybe have a "toggle" (Like fears_land or fears_water) so that some mobs won't avoid going in/out of water.


Same problem here. Semiaquatic animals like frogs and beavers. I 'solved' spawning on water or land, but animals cannot abandon those zones. It could be possible to do that terrestial mobs would jump to water, but not viceversa because currently aquatic mobs do not approach to coast (only one node deep), they need 2 nodes of depth at least to swim.
 

Termos
Member
 
Posts: 236
Joined: Sun Dec 16, 2018 12:50

Re: Mobkit - Entity API [mobkit][alpha]

by Termos » Mon Nov 04, 2019 11:02

ElCeejo wrote:My suggestion is to maybe have a "toggle" (Like fears_land or fears_water) so that some mobs won't avoid going in/out of water.

Mobkit differs significantly in this regard to typical MT mob mods where you have a ready to go code and toggle switches.
This is an api that gives you infinitely more possibilities, but requires coding.

Toggles make little sense here, instead think in terms of behaviors.
There are separate land based and aquatic behaviors which are very different, what you need is something to connect them, i.e. another behavior 'go find water' or 'swim to land'. Another possibility is to detect if a mob is near water directly in brain/logic, kick off a jump towards water and switch to an aquatic behavior.
As an example see hq_liquid_recovery and hq_swimto, Wildlife animals use these behaviors to get out of water.

The built in behaviors are really examples, custom behaviors are required for mobs doing anything significantly different than that.
Anyway I'll be revising builtin land based behaviors after I have finished basic flying.
 

User avatar
runs
Member
 
Posts: 897
Joined: Sat Oct 27, 2018 08:32
GitHub: runsy

Re: Mobkit - Entity API [mobkit][alpha]

by runs » Mon Nov 04, 2019 11:19

Termos wrote:
ElCeejo wrote:My suggestion is to maybe have a "toggle" (Like fears_land or fears_water) so that some mobs won't avoid going in/out of water.

Mobkit differs significantly in this regard to typical MT mob mods where you have a ready to go code and toggle switches.
This is an api that gives you infinitely more possibilities, but requires coding.

Toggles make little sense here, instead think in terms of behaviors.
There are separate land based and aquatic behaviors which are very different, what you need is something to connect them, i.e. another behavior 'go find water' or 'swim to land'. Another possibility is to detect if a mob is near water directly in brain/logic, kick off a jump towards water and switch to an aquatic behavior.
As an example see hq_liquid_recovery and hq_swimto, Wildlife animals use these behaviors to get out of water.

The built in behaviors are really examples, custom behaviors are required for mobs doing anything significantly different than that.
Anyway I'll be revising builtin land based behaviors after I have finished basic flying.


I will try. But a flag is required to difference between pure aquatic and semiaquatic mobs, if they share the same behaviour.
 

Termos
Member
 
Posts: 236
Joined: Sun Dec 16, 2018 12:50

Re: Mobkit - Entity API [mobkit][alpha]

by Termos » Mon Nov 04, 2019 12:01

runs wrote:I will try. But a flag is required to difference between pure aquatic and semiaquatic mobs, if they share the same behaviour.

Not necessarily, if transitions are separate behaviors then pure mobs simply won't think of doing them (that is their logic never initiate these behaviors)

Of course there are no restrictions, any custom entity fields can be added and mods are free to do whatever with them, so switches are entirely possible, I just recommend doing it differently.

Gundul wrote:Yes ! I already see eagles circling around Mt St.Thomas
in Lilly in the valley.

something like this?
Image
This requires increasing active_object_send_range_blocks though, and probably decreasing spawn rates to compensate.
Attachments
aeroc.gif
(490.19 KiB) Not downloaded yet
 

Gundul
Member
 
Posts: 595
Joined: Thu Aug 27, 2015 10:55
Location: Europe/Asia
GitHub: berengma
IRC: Gundul

Re: Mobkit - Entity API [mobkit][alpha]

by Gundul » Mon Nov 04, 2019 17:50

Termos wrote:
something like this?
Image
This requires increasing active_object_send_range_blocks though, and probably decreasing spawn rates to compensate.


Exactly. :)

Is there a way to use different animation for a mob in special behaviours ?
Let's say for example eagles when they see some pray and change from
circling to attack. Which means no wing movement but shoot straight down to the earth.
My servers: Jungle, Lilly in the valley, ZombieTest
 

Termos
Member
 
Posts: 236
Joined: Sun Dec 16, 2018 12:50

Re: Mobkit - Entity API [mobkit][alpha]

by Termos » Mon Nov 04, 2019 19:22

Gundul wrote:Is there a way to use different animation for a mob in special behaviours ?
Let's say for example eagles when they see some pray and change from
circling to attack. Which means no wing movement but shoot straight down to the earth.

Yup.
I'm implementing this as a low level behavior. One of the parameters is animation, because different animations are needed when actively flying and gliding, for example.
Dive maneuver is also possible, but the real challenge is going to be hitting the prey, not the ground.
 

User avatar
runs
Member
 
Posts: 897
Joined: Sat Oct 27, 2018 08:32
GitHub: runsy
 

Extex
Member
 
Posts: 112
Joined: Wed Mar 14, 2018 23:14
GitHub: Extex101
In-game: Extex

Re: Mobkit - Entity API [mobkit][alpha]

by Extex » Mon Nov 04, 2019 22:10

Termos wrote:Perfect!
Now onto the most important part, wings:
can you please make sure that with the wings spread, wing span is slightly greater than body length?


Yeah I think the wingspan will have to be increased

P.S. How do you do you gifs?
The only way I can upload them is if I make them look horrible XD
Like this
Image
Player of PK, RIP. Creator of the light_tool mod. Working on another mod which is pretty cool so far
 

Termos
Member
 
Posts: 236
Joined: Sun Dec 16, 2018 12:50

Re: Mobkit - Entity API [mobkit][alpha]

by Termos » Tue Nov 05, 2019 11:32

runs wrote:I've proposed mobkit philosophy as a solution to the Minetest mob dead-end.

Thanks, I'm curious where that conversation is gonna go.

Extex wrote:P.S. How do you do you gifs?

The most important part is having as much still background as possible to keep the size small, so stationary camera, if there's water I swap the texture for an unanimated version, turn off clouds sometimes etc.
Gifs are no good for running and looking around type clips.
 

Extex
Member
 
Posts: 112
Joined: Wed Mar 14, 2018 23:14
GitHub: Extex101
In-game: Extex

Re: Mobkit - Entity API [mobkit][alpha]

by Extex » Tue Nov 05, 2019 21:38

I have a video of the eagle flapping and the gif is too big to upload it's about 380xSomething, about ~200 frames long, I even reduced the colour pallete down to 50 colors and it's still too big
Player of PK, RIP. Creator of the light_tool mod. Working on another mod which is pretty cool so far
 

Termos
Member
 
Posts: 236
Joined: Sun Dec 16, 2018 12:50

Re: Mobkit - Entity API [mobkit][alpha]

by Termos » Wed Nov 06, 2019 19:05

Extex wrote:I have a video of the eagle flapping and the gif is too big to upload

I'd try importing it into gimp and exporting it back, it should compress the hell out of it. Or record with something that uses compression, I'm using Gifcam.
 

Extex
Member
 
Posts: 112
Joined: Wed Mar 14, 2018 23:14
GitHub: Extex101
In-game: Extex

Re: Mobkit - Entity API [mobkit][alpha]

by Extex » Wed Nov 06, 2019 21:43

Termos wrote:
Extex wrote:I have a video of the eagle flapping and the gif is too big to upload

I'd try importing it into gimp and exporting it back, it should compress the hell out of it. Or record with something that uses compression, I'm using Gifcam.


Ok I got it!
Image
Attachments
eaglegif.gif
(728.59 KiB) Not downloaded yet
Player of PK, RIP. Creator of the light_tool mod. Working on another mod which is pretty cool so far
 

User avatar
Imk
Member
 
Posts: 214
Joined: Mon Nov 05, 2018 19:15
Location: Crimea, Russia
In-game: Imk

Re: Mobkit - Entity API [mobkit][alpha]

by Imk » Thu Nov 07, 2019 01:51

ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'default' in callback luaentity_Step(): /home/imk/minetest/bin/../mods/mobkit/init.lua:417: attempt to index field 'sounds' (a nil value)


viewtopic.php?p=361045#p361045
 

Eran
Member
 
Posts: 87
Joined: Fri May 03, 2019 16:46

Re: Mobkit - Entity API [mobkit][alpha]

by Eran » Thu Nov 07, 2019 07:11

Imk wrote:
ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'default' in callback luaentity_Step(): /home/imk/minetest/bin/../mods/mobkit/init.lua:417: attempt to index field 'sounds' (a nil value)


viewtopic.php?p=361045#p361045


I've submitted a PR that fixes this https://github.com/TheTermos/mobkit/pull/9
 

User avatar
Imk
Member
 
Posts: 214
Joined: Mon Nov 05, 2018 19:15
Location: Crimea, Russia
In-game: Imk
 

Termos
Member
 
Posts: 236
Joined: Sun Dec 16, 2018 12:50

Re: Mobkit - Entity API [mobkit][alpha]

by Termos » Thu Nov 07, 2019 12:32

Eran wrote:I've submitted a PR that fixes this https://github.com/TheTermos/mobkit/pull/9

Thanks, I'm out on the road so I just merged it blind, hope it works.

Extex wrote:Image

Looks great to me.
So, can I have it? ;)
 

Gundul
Member
 
Posts: 595
Joined: Thu Aug 27, 2015 10:55
Location: Europe/Asia
GitHub: berengma
IRC: Gundul

Re: Mobkit - Entity API [mobkit][alpha]

by Gundul » Thu Nov 07, 2019 16:30

Extex wrote:
Ok I got it!
Image


Looks great. Hope it will fly in the near future on my servers.
My servers: Jungle, Lilly in the valley, ZombieTest
 

User avatar
Imk
Member
 
Posts: 214
Joined: Mon Nov 05, 2018 19:15
Location: Crimea, Russia
In-game: Imk

Re: Mobkit - Entity API [mobkit][alpha]

by Imk » Thu Nov 07, 2019 17:24

That mistake didn't go away.
Was on the old versions and never leaves.
Changed it on advice Runs viewtopic.php?p=360385#p360385

petz-5.6 (6 ‎11 ‎2019 ‎г.) mobkit (‎2 ‎11 ‎2019 ‎г +fixes Eran)

Code: Select all
2019-11-07 18:01:22: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'petz' in callback luaentity_Step(): /home/imk/minetest/bin/../mods/mobkit/init.lua:119: Invalid float vector dimension range 'y' (expected -2.14748e+06 < y < 2.14748e+06 got nan).
2019-11-07 18:01:22: ERROR[Main]: stack traceback:
2019-11-07 18:01:22: ERROR[Main]:       [C]: in function 'set_acceleration'
2019-11-07 18:01:22: ERROR[Main]:       /home/imk/minetest/bin/../mods/mobkit/init.lua:119: in function 'set_acceleration'
2019-11-07 18:01:22: ERROR[Main]:       /home/imk/minetest/bin/../mods/mobkit/init.lua:821: in function 'physics'
2019-11-07 18:01:22: ERROR[Main]:       /home/imk/minetest/bin/../mods/mobkit/init.lua:928: in function 'stepfunc'
2019-11-07 18:01:22: ERROR[Main]:       ...inetest/bin/../mods/petz/petz/petz/pigeon_mobkit.lua:82: in function <...inetest/bin/../mods/petz/petz/petz/pigeon_mobkit.lua:81>
 

Termos
Member
 
Posts: 236
Joined: Sun Dec 16, 2018 12:50

Re: Mobkit - Entity API [mobkit][alpha]

by Termos » Thu Nov 07, 2019 20:05

Looks like I won't get away without another bugfix release before flight mechanics, so:

Update 191107

changes:

    thanks to Eran: all newly improved make_sound()
      added gain, fade and pitch control, the parameters can also be randomized within specified range. In addition to that multiple entries can be specified for every sound name - one entry will be chosen randomly at run time
      aee mobkit_api.txt for details.
    buoyancy has been simplified:
      invalid float vector range errors should be gone
    added mobkit.rot_to_dir(rot)
      basicly 3d version of minetest.yaw_to_dir, the opposite of mobkit.dir_to_rot
 

Gundul
Member
 
Posts: 595
Joined: Thu Aug 27, 2015 10:55
Location: Europe/Asia
GitHub: berengma
IRC: Gundul

Re: Mobkit - Entity API [mobkit][alpha]

by Gundul » Tue Nov 12, 2019 14:40

When reading my logs I found a few undeclared global vars:

Code: Select all
2019-11-10 15:40:49: WARNING[Server]: Assignment to undeclared global "vel" inside a function at /.minetest/mods/mobkit/init.lua:839.
2019-11-10 15:42:57: WARNING[Server]: Assignment to undeclared global "liq" inside a function at /.minetest/mods/mobkit/init.lua:541.
2019-11-10 15:51:53: WARNING[Server]: Assignment to undeclared global "timer" inside a function at /.minetest/mods/mobkit/init.lua:1280.
2019-11-10 15:51:53: WARNING[Server]: Assignment to undeclared global "tgttime" inside a function at /.minetest/mods/mobkit/init.lua:1281.
My servers: Jungle, Lilly in the valley, ZombieTest
 

User avatar
Melkor
Member
 
Posts: 307
Joined: Sat Sep 24, 2011 01:03
Location: Underground
 

User avatar
Andrey01
Member
 
Posts: 2311
Joined: Wed Oct 19, 2016 15:18
Location: Russia, Moscow
GitHub: Andrey2470T
In-game: Andrey01

Re: Mobkit - Entity API [mobkit][alpha]

by Andrey01 » Wed Nov 13, 2019 10:18

I downloaded the latest version of mobkit api and I founded out the zombies were not always damaged by a player punching (they could not be always knocked back). And also they sometimes hover instead of attacking.
 

Termos
Member
 
Posts: 236
Joined: Sun Dec 16, 2018 12:50

Re: Mobkit - Entity API [mobkit][alpha]

by Termos » Wed Nov 13, 2019 11:05

Andrey01 wrote: zombies were not always damaged by a player punching (they could not be always knocked back). And also they sometimes hover instead of attacking.

Zombies can only be killed if hit on the head with a stone tool or better. Tool range is reduced so if you have object selections boxes on it may be misleading.
Please elaborate on the hover thing.
 

PreviousNext

Return to WIP Mods



Who is online

Users browsing this forum: Bing [Bot] and 7 guests