Page 17 of 19

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

PostPosted: Tue Dec 24, 2019 17:56
by Andrey01
I`m making a head rotation API and I don`t know how to fix those horrible rotations represented on the video below (maybe pretty of low resolution, but I couldn`t do else):
Image
zombies_head_rotation.gif
(921.98 KiB) Not downloaded yet


Why does a head become to rotate in the spiral-like direction around the one`s torso and even being changed along 'y' axis if I change only the current rotation?

Mobkit and zombiestrd github sources:
https://github.com/Andrey2470T/mobkit
https://github.com/Andrey2470T/zombiestrd

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

PostPosted: Fri Dec 27, 2019 20:25
by Termos
First guess, I'd check alignment of the head model. All rotations pivot around model's 0,0,0, so if the model is way up it would move like a hammer instead of rotating.
The zero point should be roughly around the bottom face of that cuboid.

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

PostPosted: Sat Dec 28, 2019 00:39
by GamingAssociation39
Is it possible to make a mob stay put but still move and bite passing players?

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

PostPosted: Sat Dec 28, 2019 14:42
by Termos
GamingAssociation39 wrote:Is it possible to make a mob stay put but still move and bite passing players?

Sure.
Actually such a behavior should be very simple, as it doesn't even involve moving around. Just turn towards the player, play an attack animation and punch if still in range.

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

PostPosted: Mon Jan 13, 2020 09:01
by Gundul
Your eagle now flies with radar :)

viewtopic.php?f=9&t=23436&p=365285#p365285

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

PostPosted: Mon Jan 13, 2020 19:57
by Termos
Gundul wrote:Your eagle now flies with radar :)
viewtopic.php?f=9&t=23436&p=365285#p365285

I tried releasing eagles in a sparse forest, most of them managed to slalom between trees and gain altitude. Nicely done!

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

PostPosted: Sat Feb 01, 2020 05:40
by ElCeejo
I've noticed while working on large hitbox support that mobs seem to have issues with snow. Just thought I'd tell you in case you didn't notice.

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

PostPosted: Sat Feb 01, 2020 12:21
by runs
Hi
how could I check a mob not moving?
And not jumping? self.isonground?

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

PostPosted: Sat Feb 01, 2020 12:40
by Gundul
runs wrote:Hi
how could I check a mob not moving?
And not jumping? self.isonground?

not jumping: self.isongorund
not moving: check length of velocity vector

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

PostPosted: Sat Feb 01, 2020 16:47
by Termos
ElCeejo wrote:I've noticed while working on large hitbox support that mobs seem to have issues with snow. Just thought I'd tell you in case you didn't notice.

Yes, that's an artifact from 4.17 where nodes didn't have separate collision boxes. This bug is kinda fun and harmless so I don't feel hard pressed to fix it.

As to large box support, I am working on it, but in the meantime I got bored by working around various engine issues so now I'm trying to fix some of them and that will be the priority for some time. If I succeed it will make things better for everyone.

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

PostPosted: Tue Feb 04, 2020 05:42
by Gundul
Is there a special reason why hq_goto target stops 3 nodes in front of target ?

Code: Select all
function mobkit.hq_goto(self,prty,tpos)
   [...]
         if vector.distance(pos,tpos) > 3 then
   [...]
   end
   mobkit.queue_high(self,func,prty)
end

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

PostPosted: Tue Feb 04, 2020 20:59
by runs
Termos wrote:As to large box support, I am working on it, but in the meantime I got bored by working around various engine issues so now I'm trying to fix some of them and that will be the priority for some time. If I succeed it will make things better for everyone.


Yes, engine bugs firstly :-)

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

PostPosted: Tue Feb 04, 2020 23:51
by Termos
Gundul wrote:Is there a special reason why hq_goto target stops 3 nodes in front of target ?

Haven't found any use for that one. Iirc it's just a general area, also if you send more than one mob to the same spot they won't be fighting for the exact location.

It's a simple behavior, just copy it and modify as needed.

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

PostPosted: Wed Feb 05, 2020 04:42
by Gundul
Termos wrote:
Gundul wrote:Is there a special reason why hq_goto target stops 3 nodes in front of target ?

Haven't found any use for that one. Iirc it's just a general area, also if you send more than one mob to the same spot they won't be fighting for the exact location.

It's a simple behavior, just copy it and modify as needed.

That's what I always do :)
Only, it took some time until I figured out why it was not working from the beginning, documentation says:
Code: Select all
function mobkit.hq_goto(self,prty,tpos)
   -- go to tpos position
   -- returns on arrival

I was wondering why my deers all starved. But they never reached their food, stopping 3 nodes in front of it XD

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

PostPosted: Sun Feb 09, 2020 20:51
by ElCeejo
I've come across a problem, for some reason my mobs give me an error saying "lastvelocity" is nil at line 939 in mobkits init file. Any idea what would cause this?

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

PostPosted: Sun Feb 09, 2020 22:28
by Termos
ElCeejo wrote:I've come across a problem, for some reason my mobs give me an error saying "lastvelocity" is nil at line 939 in mobkits init file. Any idea what would cause this?

The most common cause would be them not using mobkit.actfunc() in their on_activate callback.

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

PostPosted: Mon Feb 10, 2020 14:05
by Termos
Just got a request for those who want better mobs in Minetest and can be bothered to compile MT from source.

Please consider helping me test this PR: https://github.com/minetest/minetest/pull/9343

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

PostPosted: Mon Feb 10, 2020 17:06
by runs
Termos wrote:Just got a request for those who want better mobs in Minetest and can be bothered to compile MT from source.

Please consider helping me test this PR: https://github.com/minetest/minetest/pull/9343


I have 5.1.1. Can I compile that?

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

PostPosted: Tue Feb 11, 2020 17:56
by runs
can 'mobkit.get_spawn_pos_abr' get a span pos into water?

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

PostPosted: Tue Feb 11, 2020 18:45
by Termos
Yes, besides a position it returns liquidflag which indicates if the node at pos is covered in liquid.
If it's false try to spawn a land creature, if it's true an aquatic one.

runs wrote:I have 5.1.1. Can I compile that?

The PR is based on master which is currently 5.2. dev

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

PostPosted: Thu Feb 13, 2020 01:45
by runs
A user of my petz mod reported me that aquatic animals spawn so rarely, and in shallows. Can be caused by the player rarely face the oceans?

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

PostPosted: Thu Feb 13, 2020 18:30
by Termos
runs wrote:Can be caused by the player rarely face the oceans?

Technically yes, but then they have to get near water to be able to tell spawn rate is low, so I'd look elsewhere.

Try checking your spawn chances, and oh, the function only tells you if there's any water, so if you don't want them to spawn in shallows, you should check if it's deep enough.

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

PostPosted: Wed Feb 19, 2020 05:07
by ElCeejo
Is there a way of letting mobs freely roam through water as if they were on land aside from rewriting half of mobkit?

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

PostPosted: Wed Feb 19, 2020 05:34
by Lone_Wolf
ElCeejo wrote:Is there a way of letting mobs freely roam through water as if they were on land aside from rewriting half of mobkit?

Can't just make them sink 100% and remove/offset the drown checks?

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

PostPosted: Wed Feb 19, 2020 05:43
by Gundul
ElCeejo wrote:Is there a way of letting mobs freely roam through water as if they were on land aside from rewriting half of mobkit?

What kind of mobs, do you mean like fish and swimming ? Or walking underwater, or floating on the surface ?