Mobkit - Entity API [mobkit][alpha]

User avatar
StarNinjas
Member
 
Posts: 292
Joined: Wed Mar 14, 2018 00:32
Location: aincrad
GitHub: starninjas
IRC: StarNinjas
In-game: J1
 

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

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

by runs » Sun Aug 11, 2019 23:18

A request:

- Mobs not jumping fences. To make stables/barns as in Minecraft.

It should be a group called "fence" in MTG :-(
 

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

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

by runs » Sun Aug 11, 2019 23:53

Well I've found a solution:

function mobkit.is_neighbor_node_reachable(self,neighbor) -- todo: take either number or pos
local offset = neighbors[neighbor]
local pos=mobkit.get_stand_pos(self)
local tpos = mobkit.get_node_pos(mobkit.pos_shift(pos,offset))
if minetest.get_node(tpos).name:find("fence") then return end
local height, liquidflag = mobkit.get_terrain_height(tpos)
 

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

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

by runs » Mon Aug 12, 2019 00:27

To avoid jumping gates too:
local node_name = minetest.get_node(tpos).name
if node_name:find("fence") then return
elseif node_name:find("gate") and node_name:find("closed") then return end
 

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

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

by runs » Fri Aug 16, 2019 11:05

Some warnings (global variables that should be local)

line 448
local heightl = mobkit.is_neighbor_node_reachable(self,mobkit.neighbor_shift(neighbor,-1))


line 450
local heightr = mobkit.is_neighbor_node_reachable(self,mobkit.neighbor_shift(neighbor,1))

line 465
local liq
height, pos2, liq = mobkit.is_neighbor_node_reachable(self,mobkit.neighbor_shift(neighbor,-i*self.path_dir))
 

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

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

by Termos » Sat Aug 17, 2019 19:13

runs wrote:- Mobs not jumping fences. To make stables/barns as in Minecraft.
It should be a group called "fence" in MTG :-(

I'm on the fence about this.
Ok, not really, direct support for fences is out of the question, because it'd violate some goals I set for this project, namely
- no dependencies - in the minetest api there's no concept of fences, I'd have to depend on a specific implementation, MTG probably.
- consistency - in the world where the ability to jump 1m+ is mandatory, 1m high fences make little sense.

However, I'll see if I can add a list of names/groups as a parameter to is_neighbor_node_reachable, so you can disallow any specific nodes, not just fences.

If I were to solve this problem in a mod/game, I'd try to make fences 2 nodes high, for example 1+0.3, and make default jump height like 1.25. This I believe would be consistent and in accordance with KISS and WYSIWYG.
 

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

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

by runs » Sat Aug 17, 2019 20:33

Termos wrote:
runs wrote:- Mobs not jumping fences. To make stables/barns as in Minecraft.
It should be a group called "fence" in MTG :-(

I'm on the fence about this.
Ok, not really, direct support for fences is out of the question, because it'd violate some goals I set for this project, namely
- no dependencies - in the minetest api there's no concept of fences, I'd have to depend on a specific implementation, MTG probably.
- consistency - in the world where the ability to jump 1m+ is mandatory, 1m high fences make little sense.

However, I'll see if I can add a list of names/groups as a parameter to is_neighbor_node_reachable, so you can disallow any specific nodes, not just fences.

If I were to solve this problem in a mod/game, I'd try to make fences 2 nodes high, for example 1+0.3, and make default jump height like 1.25. This I believe would be consistent and in accordance with KISS and WYSIWYG.


Yes, make fences a little high maybe is the solution.
 

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

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

by Extex » Sat Aug 17, 2019 21:58

How do I get the look direction of the mob?
Player of PK, RIP. Creator of the light_tool mod. Working on another mod which is pretty cool so far
 

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

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

by Termos » Sun Aug 18, 2019 09:11

runs wrote:Yes, make fences a little high maybe is the solution.

Normally I'm not a fan of copying MC, but it seems this is how it's done in MC as well.
As far as I remember in MC rabbits can jump fences but players can not, this seems to indicate there too, fences are physical obstacles of certain height rather than an arbitrary restriction forbidding mobs jumping certain nodes.

Extex wrote:How do I get the look direction of the mob?

The usual, get_yaw(), or get_rotation() if you want it 3d.
 

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

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

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

by Termos » Sun Aug 25, 2019 10:30

runs wrote:Request: Mobs affected by fire/lave (damage).

No dependencies rule.
Lava is a game/mod specific thing, minetest api isn't aware of that concept.

I'll think of something to make coding harmful nodes easier, but probably it's easy enough already.
In the brain function, somewhere between hp check and timer block, check if self.isinliquid, find out what node it is and apply damage accordingly, this should end up being a three liner or so.
 

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

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

by runs » Mon Aug 26, 2019 01:31

yes, I've implement the lava/fire behaviour, but is the same case of fences, it would be cool to define some nodes to avoid by the mobs.

Code: Select all
petz.env_damage = function(self)
   local stand_pos= mobkit.get_stand_pos(self)
   local stand_node_pos = mobkit.get_node_pos(stand_pos)
   local stand_node = mobkit.nodeatpos(stand_node_pos)
   if stand_node.groups.igniter then --if lava or fire
      mobkit.hurt(self, self.dtime)
   end
end
Last edited by runs on Mon Aug 26, 2019 09:43, edited 1 time in total.
 

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

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

by runs » Mon Aug 26, 2019 09:42

This error can be caused by a node of type nodebox but node_box defined?

Code: Select all
2019-08-25 17:59:03: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'petz' in callback luaentity_Step(): /home/imk/minetest/bin/../mods/petz/mobkit/init.lua:153: attempt to index field 'node_box' (a nil value)
2019-08-25 17:59:03: ERROR[Main]: stack traceback:
2019-08-25 17:59:03: ERROR[Main]:    /home/imk/minetest/bin/../mods/petz/mobkit/init.lua:153: in function 'get_node_height'
2019-08-25 17:59:03: ERROR[Main]:    /home/imk/minetest/bin/../mods/petz/mobkit/init.lua:184: in function </home/imk/minetest/bin/../mods/petz/mobkit/init.lua:180>
2019-08-25 17:59:03: ERROR[Main]:    (tail call): ?
2019-08-25 17:59:03: ERROR[Main]:    /home/imk/minetest/bin/../mods/petz/mobkit/init.lua:392: in function 'is_neighbor_node_reachable'
2019-08-25 17:59:03: ERROR[Main]:    /home/imk/minetest/bin/../mods/petz/mobkit/init.lua:446: in function 'get_next_waypoint'
2019-08-25 17:59:03: ERROR[Main]:    /home/imk/minetest/bin/../mods/petz/mobkit/init.lua:532: in function 'goto_next_waypoint'
2019-08-25 17:59:03: ERROR[Main]:    /home/imk/minetest/bin/../mods/petz/mobkit/init.lua:991: in function 'func'
2019-08-25 17:59:03: ERROR[Main]:    /home/imk/minetest/bin/../mods/petz/mobkit/init.lua:651: in function 'execute_queues'
2019-08-25 17:59:03: ERROR[Main]:    /home/imk/minetest/bin/../mods/petz/mobkit/init.lua:1325: in function 'stepfunc'
2019-08-25 17:59:03: ERROR[Main]:    ...imk/minetest/bin/../mods/petz/petz/pigeon_mobkit.lua:81: in function <...imk/minetest/bin/../mods/petz/petz/pigeon_mobkit.lua:80>
 

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

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

by Termos » Mon Aug 26, 2019 19:58

runs wrote:This error can be caused by a node of type nodebox but node_box defined?

Yup, definitely, didn't know registering such a node was even possible, it's the colbox that's supposed to be optional.
___________________________________________________________________________________

Meanwhile, coming up next:
One of the example mods is going to change name to:
Zombies - The Real Deal - Now With Sharks!

Image
 

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

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

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

by Gundul » Tue Aug 27, 2019 04:39

Termos wrote:Meanwhile, coming up next:
One of the example mods is going to change name to:
Zombies - The Real Deal - Now With Sharks!


Yes ! fishes and big ones.
Thank you, now I can't sleep anymore until it is out X)
My servers: Jungle, Lilly in the valley, ZombieTest
 

User avatar
Andrey01
Member
 
Posts: 2308
Joined: Wed Oct 19, 2016 15:18
Location: Russia, Moscow
GitHub: Andrey2470T
In-game: Andrey01

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

by Andrey01 » Tue Aug 27, 2019 06:58

Wow, really just impresses!
Hmm, why are those sharks swimming only around the island and not in random path?
 

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

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

by Termos » Tue Aug 27, 2019 10:02

Andrey01 wrote:Hmm, why are those sharks swimming only around the island and not in random path?

Because they're hungry and want to eat the guy.
Also this is what made it possible to record that looping GIF.

Gundul wrote:I can't sleep anymore until it is out X)

Now you got me worried, I barely started working on behaviors, this will take time.
 

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

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

by Extex » Fri Aug 30, 2019 16:43

Cool!
I've had my eye on this mod for a while, This mod has tons of potential!

Can't wait for the sharks!

P.S. If you ever need a texture artist or modeler I can help
Player of PK, RIP. Creator of the light_tool mod. Working on another mod which is pretty cool so far
 

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

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

by Termos » Sun Sep 01, 2019 10:48

Extex wrote:If you ever need a texture artist or modeler I can help

Great, thanks, I'll definitely need that at some point. Modelling is the hardest part for me - Blender interface is crp tbh.
____________________________________________________________________________________

Looks like a nice spot for a swim.
Image

The first primitive aquatic random roaming behavior. They stay within abr/2 radius around their activation position and try to avoid the shallows and obstacles
 

twoelk
Member
 
Posts: 1324
Joined: Fri Apr 19, 2013 16:19
Location: northern Germany
GitHub: twoelk
IRC: twoelk
In-game: twoelk

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

by twoelk » Sun Sep 01, 2019 14:15

hmm...
how about some jellyfish teaming up?
viewtopic.php?p=241321#p241321

the gifs look cool btw
 

User avatar
Andrey01
Member
 
Posts: 2308
Joined: Wed Oct 19, 2016 15:18
Location: Russia, Moscow
GitHub: Andrey2470T
In-game: Andrey01
 

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

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

by Extex » Sun Sep 01, 2019 16:11

Termos wrote:Modelling is the hardest part for me - Blender interface is crp tbh.

Not really. It just takes some getting used to.
Player of PK, RIP. Creator of the light_tool mod. Working on another mod which is pretty cool so far
 

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

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

by ElCeejo » Sun Sep 01, 2019 18:24

It's cool seeing them actively avoiding shallow water instead of constantly beaching themselves. Can't wait for proper flying and swimming!
 

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

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

by Gundul » Mon Sep 02, 2019 17:25

Termos wrote:Looks like a nice spot for a swim.
Image


Already one week without sleep and now an even better teaser ... XD

I guess a nervous breakdown is not far anymore ... :)
My servers: Jungle, Lilly in the valley, ZombieTest
 

PreviousNext

Return to WIP Mods



Who is online

Users browsing this forum: Bing [Bot], Google [Bot], Majestic-12 [Bot], MSN [Bot] and 3 guests

cron