Mobkit - Entity API [mobkit][alpha]

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`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
zombies_head_rotation.gif (921.98 KiB) Viewed 703 times
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: 417
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: 858
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: 417
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.

u18398

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

by u18398 » Post

Your eagle now flies with radar :)

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

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

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

by runs » Post

Hi
how could I check a mob not moving?
And not jumping? self.isonground?

u18398

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

by u18398 » 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

Termos
Member
Posts: 417
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.

u18398

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

by u18398 » 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

User avatar
runs
Member
Posts: 3225
Joined: Sat Oct 27, 2018 08:32

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 :-)

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 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.

u18398

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

by u18398 » 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

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

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?

User avatar
runs
Member
Posts: 3225
Joined: Sat Oct 27, 2018 08:32

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

by runs » Post

can 'mobkit.get_spawn_pos_abr' get a span pos into water?

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

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?

Termos
Member
Posts: 417
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: 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

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: 2576
Joined: Sun Apr 09, 2017 05:50
GitHub: LoneWolfHT
IRC: LandarVargan
In-game: LandarVargan

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?
My ContentDB -|- Working on CaptureTheFlag -|- Minetest Forums Dark Theme!! (You need it)

u18398

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

by u18398 » 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 ?

Post Reply

Who is online

Users browsing this forum: No registered users and 19 guests