Mobkit - Entity API [mobkit][alpha]
Re: Mobkit - Entity API [mobkit][wip]
They are coming
MCL2 models that is. I have to employ existing models as test subjects, cause I don't have time to make my own in required variety.
This is a stress test, 100+ mobs active at same time.
MCL2 models that is. I have to employ existing models as test subjects, cause I don't have time to make my own in required variety.
This is a stress test, 100+ mobs active at same time.
Re: Mobkit - Entity API [mobkit][wip]
just one word: "wow !!!!"
Once again, thank you for your quality work.
how are the animations handled and declared ?
Once again, thank you for your quality work.
how are the animations handled and declared ?
Re: Mobkit - Entity API [mobkit][wip]
What I came up with for now is a structure corresponding to minetest api.R-One wrote: how are the animations handled and declared ?
animation = {
walk={range={x=0,y=40},speed=25,loop=true},
...
and a function:
mobkit.animate(self,anim)
this function does nothing if:
- anim is not defined for given entity
- anim animation is currently active
That's about it, because behaviors are queued and modular, usually all you need to do is call it on a behavior function's init and you're done.
In the clip above you can see some frames skipping, but that's my bad, messing around I put one of the calls in wrong spot.
Re: Mobkit - Entity API [mobkit][wip]
I downloaded it from the contentdb. A wolve chasing two deers in my testserver looks
very convincing. Like real animals. First the deers fled together, then they parted, so
the wolve had to chose one of them and then ... the server chrashed :)
very convincing. Like real animals. First the deers fled together, then they parted, so
the wolve had to chose one of them and then ... the server chrashed :)
Code: Select all
2019-05-18 13:16:06: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'wildlife' in callback luaentity_Step(): .minetest/mods/mobkit/init.lua:250: attempt to index a nil value
2019-05-18 13:16:06: ERROR[Main]: stack traceback:
2019-05-18 13:16:06: ERROR[Main]: .minetest/mods/mobkit/init.lua:250: in function 'is_neighbor_node_reachable'
2019-05-18 13:16:06: ERROR[Main]: .minetest/mods/mobkit/init.lua:285: in function 'get_next_waypoint'
2019-05-18 13:16:06: ERROR[Main]: .minetest/mods/mobkit/init.lua:364: in function 'goto_next_waypoint'
2019-05-18 13:16:06: ERROR[Main]: .minetest/mods/mobkit/init.lua:767: in function 'func'
2019-05-18 13:16:06: ERROR[Main]: .minetest/mods/mobkit/init.lua:481: in function 'execute_queues'
2019-05-18 13:16:06: ERROR[Main]: .minetest/mods/mobkit/init.lua:1063: in function <.minetest/mods/mobkit/init.lua:955>
Re: Mobkit - Entity API [mobkit][wip]
Much appreciated.Gundul wrote:A wolve chasing two deers in my testserver looks
very convincing. Like real animals. First the deers fled together, then they parted, so
the wolve had to chose one of them and then ... the server chrashed :)
Fixed version download is available on the first page in this thread
ContentDB version pending approval.
This is how important feedback is.
This bug happened because animals ran into an unloaded area, which apparently doesn't happen on my setup.
I also somehow managed to upload the wrong file previously, there were some leftover diagnostic messages popping up on the screen. Should be quiet now.
I'll be grateful for any further feedback people.
Re: Mobkit - Entity API [mobkit][wip]
So animations still not implemented?
Re: Mobkit - Entity API [mobkit][wip]
Animation support is implemented, but not released yet.runs wrote:So animations still not implemented?
The very next release will support them, although the example mod probably won't make use of them, because my models aren't even rigged yet, and I don't consider rigging a priority (unless it turns out people use Wildlife and there's demand)
Re: Mobkit - Entity API [mobkit][wip]
I can't seem to find any documentation on it and of course that's exactly the thing I need for a mod I'm making5.x's all new set_rotation()
How do you use set_rotation()?
Creator of jelys_pizzaria and motorbike, and player of persistent kingdoms. RIP
Re: Mobkit - Entity API [mobkit][wip]
The whole documentation is this:Extex wrote: I can't seem to find any documentation on it and of course that's exactly the thing I need for a mod I'm making
How do you use set_rotation()?
"'rot' is a vector (radians). X is pitch (elevation), Y is yaw (heading)
and Z is roll (bank)."
I've been using only the Z component so far, so I might not be accurate, but from testing so far I think it works like this:
Y (yaw) - rotation around the vertical axis. Zero is facing positive world Z axis direction, pi and -pi are negative Z.
X (pitch) - rotation around the horizontal axis perpendicular to yaw direction. Zero is upright, pi/2 facing zenith, -pi/2 facing straight down
Z (roll) - rotation around the object's longitudinal axis. Zero is upright, plus is right, minus is left, pi and -pi are upside down
This also might help:
https://en.wikipedia.org/wiki/Aircraft_principal_axes
Re: Mobkit - Entity API [mobkit][wip]
This time I call it an alpha
The first post was updated with the release 0.10.0
There are many improvements like sound and animation support, but the most important is
the documentation file located at mobkit\mobkit_api.txt
I'd be grateful for any feedback: if the documentation is clear, should I elaborate on some topics, any bad English etc.
There's also included a new example minimod called:
Zombies - The Real Deal
Yet another cliche zombie mod to undeaden the still plains of Minetest games,
except these work differently than the usual MC based approach.
Normally zombies are not very perceptive, they usually just stand about wobbling and salivating, and can be easily snuck up on from behind, but it is common knowledge, that they are attracted to sounds and become suspicious if there's too much noise, so keep punching nodes and they will come swarming at you. Sounds of battle and noises made by other zombies can alert them as well.
To defeat a zombie one has to go for the head, everybody knows that, so equip something harder than wood and hit them in the cranium once - no more, no less. Hit them hard, only full punches count.
Otherwise nothing happens, except maybe more zombies are attracted.
Note: to my knowledge, the model used is licensed under CC-BY-SA and the attribution goes to one BlockMen, if that's incorrect please let me know.
- Lone_Wolf
- Member
- Posts: 2578
- Joined: Sun Apr 09, 2017 05:50
- GitHub: LoneWolfHT
- IRC: LandarVargan
- In-game: LandarVargan
Re: Mobkit - Entity API [mobkit][alpha]
This is interesting...
Can you please provide more info: MT version, game being used, any other mods running?
Is it reproducible?
Can you please provide more info: MT version, game being used, any other mods running?
Is it reproducible?
Re: Mobkit - Entity API [mobkit][alpha]
I get the following error:
It raises when I insert an 'on_activate' custom event (even empty).
Another question:
animation = {
[name]={range={x=[num],y=[num]},speed=[num],loop=[bool]},
...
}
The range are the start and end frame?
Code: Select all
2019-06-02 00:31:00: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'petz' in callback luaentity_Step(): /opt/minetest/bin/../games/bogart/mods/mobkit/init.lua:1047: attempt to index field 'lastvelocity' (a nil value)
2019-06-02 00:31:00: ERROR[Main]: stack traceback:
2019-06-02 00:31:00: ERROR[Main]: /opt/minetest/bin/../games/bogart/mods/mobkit/init.lua:1047: in function </opt/minetest/bin/../games/bogart/mods/mobkit/init.lua:1040>
Code: Select all
on_activate = function(self, staticdata)
end,
animation = {
[name]={range={x=[num],y=[num]},speed=[num],loop=[bool]},
...
}
The range are the start and end frame?
Re: Mobkit - Entity API [mobkit][alpha]
Currently on_activate has to be = mobkit.actfunc, anything else will failruns wrote: It raises when I insert an 'on_activate' custom event (even empty).
What kind of tasks do you want to perform in on_activate?
If it's preserving some information, this is what mobkit.remember() is for
Exactly, the table layout corresponds to minetest api set_animation().runs wrote: Another question:
animation = {
[name]={range={x=[num],y=[num]},speed=[num],loop=[bool]},
...
}
The range are the start and end frame?
- Lone_Wolf
- Member
- Posts: 2578
- Joined: Sun Apr 09, 2017 05:50
- GitHub: LoneWolfHT
- IRC: LandarVargan
- In-game: LandarVargan
Re: Mobkit - Entity API [mobkit][alpha]
Hmmmm. That was weird. Starting a new world fixed it. The old world had once had your wildlife mod enabled. Must have been controlling some spawned entities still.Termos wrote:This is interesting...
Can you please provide more info: MT version, game being used, any other mods running?
Is it reproducible?
I've played around with it a little. Some suggestions:
- Visual Feedback - I couldn't tell if I was damaging the zombies or not
- Slightly better attack (Zombie side) - If I circled a zombie group they would always miss me. Allowing me to kill them all pretty easily
They move in water a little slowly too. Bug or feature?
All that aside: Awesome work! This is looking VERY promising...
Re: Mobkit - Entity API [mobkit][alpha]
I want to set some vars on activate only once.Termos wrote: Currently on_activate has to be = mobkit.actfunc, anything else will fail
What kind of tasks do you want to perform in on_activate?
If it's preserving some information, this is what mobkit.remember() is for
Exactly, the table layout corresponds to minetest api set_animation().
Now I made:
Code: Select all
on_activate = set_vars, --on_activate
set_vars = function(self)
mobkit.actfunc(self)
local greeting = mobkit.recall(self, "greeting")
if (greeting== nil) then
minetest.chat_send_player("singleplayer", "Var is set") --It appears this message on screen and when reinit game
mobkit.remember(self, "greeting", "hello")
end
end
Mobkit - little Testserver
I like that mobkit api very much already :) wildlife and zombies do show
very good what already is possible.
i set up a little server for testing in multi player enviroment:
gundul.ddnss.de Port 39155
kill as many zombies as you can and enter the leaderboard
type /score to see it.
No rules, just go crazy and kill them all, any chrashes will be reported here.
Minetest version is 5.1.0 dev
very good what already is possible.
i set up a little server for testing in multi player enviroment:
gundul.ddnss.de Port 39155
kill as many zombies as you can and enter the leaderboard
type /score to see it.
No rules, just go crazy and kill them all, any chrashes will be reported here.
Minetest version is 5.1.0 dev
Re: Mobkit - Entity API [mobkit][alpha]
run_speed?
Re: Mobkit - Entity API [mobkit][alpha]
Yes, mobs put in creative are able to jump to ground, but not if they pushed (in an attack i.e.)Lone_Wolf wrote:Hmmmm. That was weird. Starting a new world fixed it. The old world had once had your wildlife mod enabled. Must have been controlling some spawned entities still.Termos wrote:This is interesting...
Can you please provide more info: MT version, game being used, any other mods running?
Is it reproducible?
I've played around with it a little. Some suggestions:Some of them jumped into the water (Failed attacks) and just froze once they reached the dry ground
- Visual Feedback - I couldn't tell if I was damaging the zombies or not
- Slightly better attack (Zombie side) - If I circled a zombie group they would always miss me. Allowing me to kill them all pretty easily
They move in water a little slowly too. Bug or feature?
All that aside: Awesome work! This is looking VERY promising...
Re: Mobkit - Entity API [mobkit][alpha]
Wrong parameters passed to on_activate, it should be:runs wrote: set_vars = function(self)
mobkit.actfunc(self)
set_vars = function(self,staticdata,dtime_s)
mobkit.actfunc(self,staticdata,dtime_s)
Turns out I made the code too safe, It would have been better if it crashed in this case.
That said, the memory item should be set correctly regardless, maybe check the code that displays the greeting, I'll check mine.
I'll probably rename walk_speed to max_speed, because that's what it really is.runs wrote:run_speed?
Built in behaviors just use this parameter and reduce multiplying by some number in (0,1) if needed.
Last edited by Termos on Sun Jun 02, 2019 17:44, edited 1 time in total.
Re: Mobkit - Entity API [mobkit][alpha]
Technicly you don't ever damage them, the usual hitpoint thing doesn't apply.Lone_Wolf wrote: [Visual Feedback - I couldn't tell if I was damaging the zombies or not
You either one hit kill them or do no harm at all, just like the movies ;) so if they're still kicking, you done no damage at all.
One thing I added may be confusing:
I find the default tool meele range of 4 meters to be bit ridiculous. I'm trying to keep it not dependent and didn't want to mess with mining anyway, so I reduced the range to 2 just for zombie combat, so object selection boxes appear before they can be hit.
I could factor in target velocity, but that might turn out to be too brutal. I meant it as a distraction during normal building/mining gameplay, rather than meat grinder.Lone_Wolf wrote: Slightly better attack (Zombie side) - If I circled a zombie group they would always miss me. Allowing me to kill them all pretty easily
But yeah, the final attacking behavior should lead the target I think.
Some builtin behaviors are still not too refined and mobs can get stuck sometimes.Lone_Wolf wrote: Some of them jumped into the water (Failed attacks) and just froze once they reached the dry ground
But the gist of the api is it's modular, so what needs to be done to improve it is to modify one isolated function, in this case hq_swimto. I'm gonna look into this.
This is intended, shouldn't make much difference atm, because for now all they can do while in water is swim towards the land. Water requires all new set of behaviors which are still missing.Lone_Wolf wrote: They move in water a little slowly too. Bug or feature?
Re: Mobkit - Entity API [mobkit][alpha]
I think my problem is with 'self.object:set_properties':
When I do that (set_properties), the entity clears its data.
Code: Select all
on_activate = set_vars, --on_activate
set_vars = function(self, staticdata, dtime_s)
mobkit.actfunc(self, staticdata, dtime_s)
local greeting = mobkit.recall(self, "greeting")
if (greeting== nil) then
minetest.chat_send_player("singleplayer", "Var is set") --It appears this message on screen and when reinit game
mobkit.remember(self, "greeting", "hello")
self.object:set_properties("textures", "texture.png")
end
end
Last edited by runs on Sun Jun 02, 2019 18:34, edited 4 times in total.
- Lone_Wolf
- Member
- Posts: 2578
- Joined: Sun Apr 09, 2017 05:50
- GitHub: LoneWolfHT
- IRC: LandarVargan
- In-game: LandarVargan
Re: Mobkit - Entity API [mobkit][alpha]
Ah, that would be it. A red message warning (About the range) next to the download button would be handyTermos wrote:One thing I added may be confusing:Lone_Wolf wrote: Visual Feedback - I couldn't tell if I was damaging the zombies or not
I find the default tool meele range of 4 meters to be bit ridiculous. I'm trying to keep it not dependent and didn't want to mess with mining anyway, so I reduced the range to 2 just for zombie combat, so object selection boxes appear before they can be hit.
Good to know lol
Re: Mobkit - Entity API [mobkit][alpha]
I mean that current run speed or follow is fast a lot.I'll probably rename walk_speed to max_speed, because that's what it really is.
Built in behaviors just use this parameter and reduce multiplying by some number in (0,1) if needed.
Check it:
https://streamable.com/qlu0z
Re: Mobkit - Entity API [mobkit][alpha]
I'm surprised it doesn't crash, set_properties() is supposed to take a table as parameter, not strings.runs wrote:I think my problem is with 'self.object:set_properties':Code: Select all
self.object:set_properties("textures", "texture.png") end
maybe try something like:
local props = self.object:get_properties()
props.textures = {'texture.png'}
self.object:set_properties(props)
Dat look good! ;)runs wrote: I mean that current run speed or follow is fast a lot.
Check it:
https://streamable.com/qlu0z
You mean their follow speed is too fast?
hq_follow uses maximum speed for mobs to try and keep up with the player. I you feel it's too fast, you might want to modify hq_follow, or just reduce entity walk_speed overall.
Who is online
Users browsing this forum: Bing [Bot] and 27 guests