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.
_
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>
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.
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)
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!
This one I could reposition. How do you do that there are no keyframes just that neat diamond chart?
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.
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.
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 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
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>
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.
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.
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.
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.
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.