Mobkit - Entity API [mobkit][alpha]

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

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

by Termos » Post

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: 210
Joined: Thu Feb 28, 2019 23:29
GitHub: ElCeejo
In-game: ElCeejo
Location: Your Mother's house

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

by ElCeejo » Post

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: 3225
Joined: Sat Oct 27, 2018 08:32

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

by runs » Post

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: 417
Joined: Sun Dec 16, 2018 12:50

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

by Termos » Post

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: 3225
Joined: Sat Oct 27, 2018 08:32

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

by runs » Post

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: 417
Joined: Sun Dec 16, 2018 12:50

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

by Termos » Post

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
aeroc.gif (490.19 KiB) Viewed 488 times

u18398

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

by u18398 » Post

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.

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

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

by Termos » Post

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: 3225
Joined: Sat Oct 27, 2018 08:32

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

by runs » Post

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

https://github.com/minetest/minetest_ga ... -549381009

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

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

by Extex » Post

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
Creator of jelys_pizzaria and motorbike, and player of persistent kingdoms. RIP

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

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

by Termos » Post

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.

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

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

by Extex » Post

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
Creator of jelys_pizzaria and motorbike, and player of persistent kingdoms. RIP

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

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

by Termos » Post

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.

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

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

by Extex » Post

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
eaglegif.gif (728.59 KiB) Viewed 488 times
Creator of jelys_pizzaria and motorbike, and player of persistent kingdoms. RIP

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

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

by Imk » Post

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: 123
Joined: Fri May 03, 2019 16:46

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

by Eran » Post

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: 490
Joined: Mon Nov 05, 2018 19:15
In-game: Imk
Location: Crimea, Russia
Contact:

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

by Imk » Post

Eran, thank you

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

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

by Termos » Post

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? ;)

u18398

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

by u18398 » Post

Extex wrote:
Ok I got it!
Image
Looks great. Hope it will fly in the near future on my servers.

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

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

by Imk » Post

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: 417
Joined: Sun Dec 16, 2018 12:50

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

by Termos » Post

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

u18398

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

by u18398 » Post

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.

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

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

by Melkor » Post

Extex wrote:Image
This is beautiful!

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

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

by Andrey01 » Post

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: 417
Joined: Sun Dec 16, 2018 12:50

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

by Termos » Post

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.

Post Reply

Who is online

Users browsing this forum: No registered users and 18 guests