Mobkit - Entity API [mobkit][alpha]

User avatar
Andrey01
Member
Posts: 2371
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`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

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

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

by Termos » Post

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.

User avatar
GamingAssociation39
Member
Posts: 832
Joined: Mon Apr 25, 2016 16:09
GitHub: Gerold55
IRC: Gerold55
In-game: Gerold55
Location: Maryland, USA

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

by GamingAssociation39 » Post

Is it possible to make a mob stay put but still move and bite passing players?
Jesus Is Lord and Savior!!!

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

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

by Termos » Post

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.

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

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

by Gundul » Post

Your eagle now flies with radar :)

viewtopic.php?f=9&t=23436&p=365285#p365285
My servers: Jungle, Lilly in the valley, ZombieTest

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

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

by Termos » Post

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!

User avatar
ElCeejo
Member
Posts: 65
Joined: Thu Feb 28, 2019 23:29
In-game: ElCeejo
Location: The darkest corner in your house

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

by ElCeejo » Post

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.

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

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

by runs » Post

Hi
how could I check a mob not moving?
And not jumping? self.isonground?
Day 42 of the quarantine

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

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

by Gundul » Post

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
My servers: Jungle, Lilly in the valley, ZombieTest

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

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

by Termos » Post

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.

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

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

by Gundul » Post

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
My servers: Jungle, Lilly in the valley, ZombieTest

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

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

by runs » Post

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 :-)
Day 42 of the quarantine

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

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

by Termos » Post

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.

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

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

by Gundul » Post

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
My servers: Jungle, Lilly in the valley, ZombieTest

User avatar
ElCeejo
Member
Posts: 65
Joined: Thu Feb 28, 2019 23:29
In-game: ElCeejo
Location: The darkest corner in your house

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

by ElCeejo » Post

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?

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

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

by Termos » Post

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.

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

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

by Termos » Post

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

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

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

by runs » Post

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?
Day 42 of the quarantine

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

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

by runs » Post

can 'mobkit.get_spawn_pos_abr' get a span pos into water?
Day 42 of the quarantine

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

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

by Termos » Post

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

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

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

by runs » Post

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?
Day 42 of the quarantine

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

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

by Termos » Post

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.

User avatar
ElCeejo
Member
Posts: 65
Joined: Thu Feb 28, 2019 23:29
In-game: ElCeejo
Location: The darkest corner in your house

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

by ElCeejo » Post

Is there a way of letting mobs freely roam through water as if they were on land aside from rewriting half of mobkit?

User avatar
Lone_Wolf
Member
Posts: 2326
Joined: Sun Apr 09, 2017 05:50
GitHub: LoneWolfHT
IRC: Lone_Wolf or LoneWolfHT
In-game: Lone_Wolf
Location: Not there, THERE!

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

by Lone_Wolf » Post

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?

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

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

by Gundul » Post

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 ?
My servers: Jungle, Lilly in the valley, ZombieTest

Post Reply

Who is online

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