Mobkit - Entity API [mobkit][alpha]

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

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

by Termos » Wed Nov 13, 2019 11:48

Gundul wrote:Assignment to undeclared global

Yup, my bad.
Update 191113 should fix it.

____________________________________________________________________

For those whom this may concern: download the flight preview:
aerotest.zip
(13.97 KiB) Downloaded 14 times

Image

usage:
    say the word 'fly' to launch a plane model in camera direction.

implementation:
    it's done using low level behaviors as opposed to plain functions, because pitch/roll changes must be gradual so there's a need to maintain states over time.

    function aerotest.lq_fly_pitch(self,lift,pitch,roll,acc,anim)
      this one tries to maintain constant pitch. Flight looks stable, but the thing can stall and fall if velocity too low. The example uses this one exclusively.

    function aerotest.lq_fly_aoa(self,lift,aoa,roll,acc,anim)
      tries to maintain constant angle of attack. makes them less prone to stalling, but they tend to oscillate after abrupt changes of flight parameters. this one's very WIP.

    params:

      lift: [number]
      multiplier for lift. faster objects need less, slower need more. typical value: 0.6 for speeds around 4 m/s

      pitch: [degrees]
      angle between the longitudinal axis and horizontal plane. typical range: <-15.15>

      aoa:
      [degrees] angle of attack - the angle between the longitudinal axis and velocity vector.

      roll: [degrees]
      bank angle. positive is right, negative is left, this is how they turn. if set too large they'll loose height rapidly

      acc: [number]
      propulsion. use with positive pitch to make them fly level or climb, set it to 0 with slight negative pitch to make
      them glide. typical value: around 1.0

      anim: [string]
      animation.
The example uses two simple high level behaviors to keep them between 18 and 24 nodes above ground, seems good already for ambient type flying creatures.
warning: never set_velocity when using these behaviors.
_
Attachments
aerotest.gif
(142.54 KiB) Not downloaded yet
 

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

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

by Gundul » Wed Nov 13, 2019 17:47

I am happy I can already try it out. It works well on my desktop at home.

When uploading it to ZombieTest I got this:

Code: Select all
2019-11-13 17:40:32: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'aerotest' in callback luaentity_Step(): //.minetest/mods/aerotest/init.lua:131: attempt to call field 'cross' (a nil value)
2019-11-13 17:40:32: ERROR[Main]: stack traceback:
2019-11-13 17:40:32: ERROR[Main]:       /.minetest/mods/aerotest/init.lua:131: in function 'func'
2019-11-13 17:40:32: ERROR[Main]:       /.minetest/mods/mobkit/init.lua:733: in function 'execute_queues'
2019-11-13 17:40:32: ERROR[Main]:       /.minetest/mods/mobkit/init.lua:941: in function 'func'
2019-11-13 17:40:32: ERROR[Main]:       .../share/minetest/builtin/profiler/instrumentation.lua:106: in function <.../share/minetest/builtin/profiler/instrumentation.lua:100>


mobkit I updated before.
My servers: Jungle, Lilly in the valley, ZombieTest
 

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

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

by Termos » Wed Nov 13, 2019 18:35

Gundul wrote:attempt to call field 'cross' (a nil value)

I forgot, vector cross product has been introduced in 5.1.0

To make it work in an older version quick, copy over vector.cross function from 5.1.0's builtin/common/vector.lua
 

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

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

by Gundul » Wed Nov 13, 2019 19:29

Termos wrote:I forgot, vector cross product has been introduced in 5.1.0


minetest 5.1.0-dev isn't counting ? :)

nevermind I will try to copy the function
My servers: Jungle, Lilly in the valley, ZombieTest
 

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

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

by Extex » Thu Nov 14, 2019 00:04

Melkor wrote:
Extex wrote:Image


This is beautiful!


Wow thanks that's a lot coming from you Melkor (Silmarillion reader! ) I'm a big fan of your models

P.S. Do you think could help me fix the rigging on my eagle?

P.P.S. Termos: here's the model
Attachments
Eagle.zip
(113.4 KiB) Downloaded 8 times
Last edited by Extex on Thu Nov 14, 2019 18:59, edited 1 time in total.
Player of PK, RIP. Creator of the light_tool mod. Working on another mod which is pretty cool so far
 

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

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

by Gundul » Thu Nov 14, 2019 18:08

Termos wrote:
To make it work in an older version quick, copy over vector.cross function from 5.1.0's builtin/common/vector.lua

Thanks, that worked. Now it is running on Zombietest.
My servers: Jungle, Lilly in the valley, ZombieTest
 

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

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

by Melkor » Thu Nov 14, 2019 19:23

Thanks!

Extex wrote:P.S. Do you think could help me fix the rigging on my eagle?


I'll see what i can do :)
 

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

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

by Extex » Thu Nov 14, 2019 20:21

Melkor wrote:Thanks!

Extex wrote:P.S. Do you think could help me fix the rigging on my eagle?


I'll see what i can do :)


Thanks the feet are the most problematic rn
Player of PK, RIP. Creator of the light_tool mod. Working on another mod which is pretty cool so far
 

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

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

by Termos » Thu Nov 14, 2019 20:29

Gundul wrote:Thanks, that worked. Now it is running on Zombietest.

That's unexpected ;), I hope you enabled timeout at least, so they don't stay forever.

Melkor wrote:
Extex wrote:P.S. Do you think could help me fix the rigging on my eagle?

I'll see what i can do :)

If you guys don't mind my opinion, I think it would be best if the pivot point was somewhere between the wings instead at the feet, and if the body was oriented horizontally in flying pose.
And of course if it faced the front with it's head.

I tried to use the model anyway, but I don't know how to reorient it after it's already been rigged and keyframed.
 

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

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

by Extex » Fri Nov 15, 2019 05:02

Termos wrote:If you guys don't mind my opinion, I think it would be best if the pivot point was somewhere between the wings instead at the feet, and if the body was oriented horizontally in flying pose.
And of course if it faced the front with it's head.

I tried to use the model anyway, but I don't know how to reorient it after it's already been rigged and keyframed.


Yeah that'd be good XD Honestly I am pretty awful at rigging

I was planning on rotating the eagle into a flying position with the feet curled up during flight
and a Landing animation with bird leaning back and feet forward but feet don't work and I have to animate several bones to move the model

P.S. Even if your fixing it breaks my animations It'l be fine (I can redo them)
Player of PK, RIP. Creator of the light_tool mod. Working on another mod which is pretty cool so far
 

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

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

by Melkor » Fri Nov 15, 2019 05:21

Well, is done!
I changed the bones position in the feet, now they can pivot correctly, the weight painting/skinning/rigging was remade too. Some bones are not parented to the main bone, i don't know if this is intentional so i left it unchanged. The rest of the armature seems fine.
I took the liberty of modify the some of the mesh, and the texture where "compressed" a bit, resulting in a smaller image, playing with the UVmap can do interesting things. you will see :)
Another thing is the bones names, like "Back Toe L.", they should be something like this: "Back_Toe.L" notice the ".L" this is useful later when you have to mirror animations.
I hope I didn't make a mistake, good luck finishing the project!
Attachments
Eagle_armature_fix.zip
(115.89 KiB) Downloaded 10 times
 

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

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

by Gundul » Fri Nov 15, 2019 05:27

Termos wrote:
Gundul wrote:Thanks, that worked. Now it is running on Zombietest.

That's unexpected ;), I hope you enabled timeout at least, so they don't stay forever.

timeout is also a good idea. I set static_save to false, so when a mapblock is unloaded they will vanish.
My servers: Jungle, Lilly in the valley, ZombieTest
 

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

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

by Termos » Fri Nov 15, 2019 11:48

Melkor wrote:Well, is done!

This one I could reposition. How do you do that there are no keyframes just that neat diamond chart?
Image
What I had to do:
rotate it 180 around Z so it's facing the right way (for b3d plugin anyway)
translate down so visual center of mass is around 0,0,0
rotate around X so the body is parallel to Y
reduce texture lightness a lot.
Attachments
eggle.gif
(337.3 KiB) Not downloaded yet
 

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

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

by Melkor » Fri Nov 15, 2019 13:31

Termos wrote:This one I could reposition. How do you do that there are no keyframes just that neat diamond chart?


I'm glad that it worked!
If is about the animation please ask to Extex, i didn't touch anything of that
 

User avatar
ElCeejo
Member
 
Posts: 49
Joined: Thu Feb 28, 2019 23:29
In-game: ElCeejo

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

by ElCeejo » Sat Nov 16, 2019 07:08

A fluidly flying mob? It's about time. Great work once again Termos! Even if it is in an early stage, it looks very impressive and I can't wait to use it in my own mods.
 

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

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

by Termos » Sat Nov 16, 2019 12:26

Gundul wrote:I set static_save to false, so when a mapblock is unloaded they will vanish.

Still they seem to be staying forever on ZT.
The demo wasn't intended to run on servers as is, I hope Extex doesn't mind if I package his model into another more server friendly demo.

ElCeejo wrote:A fluidly flying mob? It's about time. Great work once again Termos! Even if it is in an early stage, it looks very impressive and I can't wait to use it in my own mods.

Yeah, behaviors included in the demo can be used already, might be about time to start getting that pterodactyl model ready.
 

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

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

by Gundul » Sat Nov 16, 2019 17:10

Termos wrote:
Gundul wrote:I set static_save to false, so when a mapblock is unloaded they will vanish.

Still they seem to be staying forever on ZT.
The demo wasn't intended to run on servers as is, I hope Extex doesn't mind if I package his model into another more server friendly demo.

They vanish. I am doing the same with sharks and whales of water_life
My servers: Jungle, Lilly in the valley, ZombieTest
 

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

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

by Extex » Sat Nov 16, 2019 18:54

Termos wrote:I hope Extex doesn't mind if I package his model into another more server friendly demo.


Yeah I'd like to finish animating it after Melkor fixed it

Termos wrote:Image


Yeah XD that's the take off animation

Notice the head glitching up

I'm going to have a gliding animation, a flap after gliding animation, a seamless flapping animation, and a landing animation
Player of PK, RIP. Creator of the light_tool mod. Working on another mod which is pretty cool so far
 

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

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

by Imk » Sat Nov 16, 2019 20:05

again
Code: Select all
2019-11-16 14:18:01: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'petz' in callback luaentity_Step(): /home/imk/minetest/bin/../mods/mobkit/init.lua:120: Invalid float vector dimension range 'y' (expected -2.14748e+06 < y < 2.14748e+06 got nan).
2019-11-16 14:18:01: ERROR[Main]: stack traceback:
2019-11-16 14:18:01: ERROR[Main]:       [C]: in function 'set_acceleration'
2019-11-16 14:18:01: ERROR[Main]:       /home/imk/minetest/bin/../mods/mobkit/init.lua:120: in function 'set_acceleration'
2019-11-16 14:18:01: ERROR[Main]:       /home/imk/minetest/bin/../mods/mobkit/init.lua:828: in function 'physics'
2019-11-16 14:18:01: ERROR[Main]:       /home/imk/minetest/bin/../mods/mobkit/init.lua:936: in function 'stepfunc'
2019-11-16 14:18:01: ERROR[Main]:       ...inetest/bin/../mods/petz/petz/petz/pigeon_mobkit.lua:82: in function <...inetest/bin/../mods/petz/petz/petz/pigeon_mobkit.lua:81>

it's been a long time since
 

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

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

by runs » Sat Nov 16, 2019 21:13

Imk wrote:again
Code: Select all
2019-11-16 14:18:01: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'petz' in callback luaentity_Step(): /home/imk/minetest/bin/../mods/mobkit/init.lua:120: Invalid float vector dimension range 'y' (expected -2.14748e+06 < y < 2.14748e+06 got nan).
2019-11-16 14:18:01: ERROR[Main]: stack traceback:
2019-11-16 14:18:01: ERROR[Main]:       [C]: in function 'set_acceleration'
2019-11-16 14:18:01: ERROR[Main]:       /home/imk/minetest/bin/../mods/mobkit/init.lua:120: in function 'set_acceleration'
2019-11-16 14:18:01: ERROR[Main]:       /home/imk/minetest/bin/../mods/mobkit/init.lua:828: in function 'physics'
2019-11-16 14:18:01: ERROR[Main]:       /home/imk/minetest/bin/../mods/mobkit/init.lua:936: in function 'stepfunc'
2019-11-16 14:18:01: ERROR[Main]:       ...inetest/bin/../mods/petz/petz/petz/pigeon_mobkit.lua:82: in function <...inetest/bin/../mods/petz/petz/petz/pigeon_mobkit.lua:81>

it's been a long time since


A mobkit error, but can be caused by a follow or run away behaviour in flying mobs. I put on them the default terrestial behaviours but never worked well. I've checked that in some rare but possible circunstances they can fly with no top limit.

I've removed those bad implementations. Check the last version 5.10.
 

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

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

by Termos » Sat Nov 16, 2019 21:40

runs wrote:A mobkit error, but can be caused by a follow or run away behaviour in flying mobs.

The only way this could happen is if a collisionbox had height of zero. I bet that's unintended, if this is the case please make sure your mobs collsionbox y is nonzero.
 

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

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

by runs » Sat Nov 16, 2019 22:36

Termos wrote:
runs wrote:A mobkit error, but can be caused by a follow or run away behaviour in flying mobs.

The only way this could happen is if a collisionbox had height of zero. I bet that's unintended, if this is the case please make sure your mobs collsionbox y is nonzero.


Collissionbox is OK.
 

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

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

by Termos » Sun Nov 17, 2019 11:43

runs wrote:Collissionbox is OK.

Initial value might look allright, but mobkit is definitely receiving a zero height box, that's the only way division by zero can occur.
The colbox could be modified later on, also minetest set_properties() isn't bug free.

Anyway, dimension of 0 makes no sense as far as physics goes, so I put in a safety measure.

Update 191117
 

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

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

by runs » Sun Nov 17, 2019 13:26

Termos wrote:
runs wrote:Collissionbox is OK.

Initial value might look allright, but mobkit is definitely receiving a zero height box, that's the only way division by zero can occur.
The colbox could be modified later on, also minetest set_properties() isn't bug free.

Anyway, dimension of 0 makes no sense as far as physics goes, so I put in a safety measure.

Update 191117


I will check. Thanks.
 

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

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

by runs » Sun Nov 17, 2019 13:36

The code below is when a mob dies. The collisionbox is changed. I do not what it does, it was a suggestion from you.

Code: Select all
    local props = self.object:get_properties()
    props.collisionbox[2] = props.collisionbox[1]
    self.object:set_properties({collisionbox=props.collisionbox})
 

PreviousNext

Return to WIP Mods



Who is online

Users browsing this forum: No registered users and 5 guests