[mod] Mob Core [alpha] [mob_core]
- ElCeejo
- Member
- Posts: 210
- Joined: Thu Feb 28, 2019 23:29
- GitHub: ElCeejo
- In-game: ElCeejo
- Location: Your Mother's house
[mod] Mob Core [alpha] [mob_core]
This mod is meant as an expansion of mobkit with new hq/lq functions and other functions similar to those used in mobs_redo that should allow for more consisent behaviors but won't force the user into using them.
Some things to note:
- This mod is in alpha, expect issues
- Because my coding skills improved a lot throughout development, a lot of the code is inconsistent
- A few things were taken from mobs_redo, so big thanks to that mod and it's contributors
To-do:
- Document HQ/LQ functions
- Re-code older function
- Optimize laggy functions
- Create a wider range of aquatic and aerial roam functions
License: GPL 3.0
Depends: mobkit
Optional Depends: default (for the mount system)
Download
Some things to note:
- This mod is in alpha, expect issues
- Because my coding skills improved a lot throughout development, a lot of the code is inconsistent
- A few things were taken from mobs_redo, so big thanks to that mod and it's contributors
To-do:
- Document HQ/LQ functions
- Re-code older function
- Optimize laggy functions
- Create a wider range of aquatic and aerial roam functions
License: GPL 3.0
Depends: mobkit
Optional Depends: default (for the mount system)
Download
Last edited by ElCeejo on Wed Jan 13, 2021 01:30, edited 1 time in total.
- MisterE
- Member
- Posts: 694
- Joined: Sun Feb 16, 2020 21:06
- GitHub: MisterE123
- IRC: MisterE
- In-game: MisterE
Re: [mod] Mob Core [alpha] [mob_core]
I hope this works out. Will we be able to easily port redo mobs to this?
- ElCeejo
- Member
- Posts: 210
- Joined: Thu Feb 28, 2019 23:29
- GitHub: ElCeejo
- In-game: ElCeejo
- Location: Your Mother's house
Re: [mod] Mob Core [alpha] [mob_core]
The original goal for this mod was to be able to easily convert mobs redo mobs to mobkit but the goal changed when I realized that it was kinda redundant. Although, in it's current form simple mobs like the cow can be very quickly converted. I was able to convert the cow and chicken in under 5 minutes each.
- ElCeejo
- Member
- Posts: 210
- Joined: Thu Feb 28, 2019 23:29
- GitHub: ElCeejo
- In-game: ElCeejo
- Location: Your Mother's house
Update 0.0.2
Small update for Aquatic and Aerial mobs:
- Improved obstacle avoidance
- Reduced lag
- Improved obstacle avoidance
- Reduced lag
- MisterE
- Member
- Posts: 694
- Joined: Sun Feb 16, 2020 21:06
- GitHub: MisterE123
- IRC: MisterE
- In-game: MisterE
Re: [mod] Mob Core [alpha] [mob_core]
so does it improve the mob to convert it? If I understand correctly, mobkit has superior mob control functions. Is it worth it to convert? Or, is the purpose of this mod to make it easier for those coming from mobs_redo to start using mobkit?
- ElCeejo
- Member
- Posts: 210
- Joined: Thu Feb 28, 2019 23:29
- GitHub: ElCeejo
- In-game: ElCeejo
- Location: Your Mother's house
Re: [mod] Mob Core [alpha] [mob_core]
Definitely. If it's converted correctly then you would see a lot less lag and much better behavior. Mobs_redo is good for very basic mobs but things fall apart when you try to implement your own movement behaviors or pathfinding. Mobkit can be used for basic mobs or advanced mobs, you just have to know what you're doing to use it.so does it improve the mob to convert it?
I'd say that making it easier to go from mobs_redo to mobkit is one the goals, but not the central one. There functions that are more or less duplicates of mobs_redo functions such as feed_tame() and protect() that could be used to convert mobs_redo mobs. But the main goal is to have functions that can be used by many different mobkit mobs without having to repeat code, so if someone needed to have a mobs_redo-like feed/tame function for their mobkit mob they could use this mods instead of making their own and wasting space in their mod.is the purpose of this mod to make it easier for those coming from mobs_redo to start using mobkit?
Re: [mod] Mob Core [alpha] [mob_core]
Can you share it to us please?I want a better functioning cow and chicken.
NfAPhpmGaVphBjK8NIr9Mit5xNW2emD2
- ElCeejo
- Member
- Posts: 210
- Joined: Thu Feb 28, 2019 23:29
- GitHub: ElCeejo
- In-game: ElCeejo
- Location: Your Mother's house
Re: [mod] Mob Core [alpha] [mob_core]
I will share it somewhat soon.
- MisterE
- Member
- Posts: 694
- Joined: Sun Feb 16, 2020 21:06
- GitHub: MisterE123
- IRC: MisterE
- In-game: MisterE
Re: [mod] Mob Core [alpha] [mob_core]
Please give some examples of this mod being used, so I can copy to other mobs
Edit: I found this: https://content.minetest.net/packages/E ... ter_fauna/
Thanks!
However, We still need better docs:
mob_core.register_spawn()
mob_core.growth()
mob_core.vitals()
And others. What do they do, how/when should they be used?
I got the above from the pig in better_fauna
I would really appreciate a simple example mob that has notes of what can go where to have different behaviors.
E.G.
What do I do to get the mob to be captured
what do I do to tame the mob
what mob properties are *required* and what others are not required, but useful
how to make baby animals
how to make an animal brain, a predator brain, how to replace nodes (eating), how to make a monster
how to call various sounds at proper times, etc...
basically, An api description like that in api.txt of mobs_redo. It doesn't cover everything, but definitely enough to get basic behaviors and no bugs in the 1st or 2nd try.
Edit: I found this: https://content.minetest.net/packages/E ... ter_fauna/
Thanks!
However, We still need better docs:
mob_core.register_spawn()
mob_core.growth()
mob_core.vitals()
And others. What do they do, how/when should they be used?
I got the above from the pig in better_fauna
I would really appreciate a simple example mob that has notes of what can go where to have different behaviors.
E.G.
What do I do to get the mob to be captured
what do I do to tame the mob
what mob properties are *required* and what others are not required, but useful
how to make baby animals
how to make an animal brain, a predator brain, how to replace nodes (eating), how to make a monster
how to call various sounds at proper times, etc...
basically, An api description like that in api.txt of mobs_redo. It doesn't cover everything, but definitely enough to get basic behaviors and no bugs in the 1st or 2nd try.
- ElCeejo
- Member
- Posts: 210
- Joined: Thu Feb 28, 2019 23:29
- GitHub: ElCeejo
- In-game: ElCeejo
- Location: Your Mother's house
Re: [mod] Mob Core [alpha] [mob_core]
Documentation is in the works. There's a lot of stuff that may be left out when I update it (hopefully soon) but there'll be more than what's there now.
- MisterE
- Member
- Posts: 694
- Joined: Sun Feb 16, 2020 21:06
- GitHub: MisterE123
- IRC: MisterE
- In-game: MisterE
Re: [mod] Mob Core [alpha] [mob_core]
BTW, I got this error:
2021-01-09 12:57:32: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'default' in callback luaentity_Step(): ...netest/games/mesecraft/mods/mobkit/example_behaviors.lua:379: attempt to index local 'rot' (a nil value)
2021-01-09 12:57:32: ERROR[Main]: stack traceback:
2021-01-09 12:57:32: ERROR[Main]: ...netest/games/mesecraft/mods/mobkit/example_behaviors.lua:379: in function 'func'
2021-01-09 12:57:32: ERROR[Main]: /app/share/minetest/games/mesecraft/mods/mobkit/init.lua:627: in function 'execute_queues'
2021-01-09 12:57:32: ERROR[Main]: /app/share/minetest/games/mesecraft/mods/mobkit/init.lua:844: in function 'stepfunc'
2021-01-09 12:57:32: ERROR[Main]: /app/share/minetest/games/mesecraft/mods/mob_core/api.lua:976: in function 'on_step'
2021-01-09 12:57:32: ERROR[Main]: ...e/minetest/games/mesecraft/mods/better_fauna/api/api.lua:511: in function <...e/minetest/games/mesecraft/mods/better_fauna/api/api.lua:510>
This happended after I punched a walrus which I ported over to mobkit. I expect
better_fauna.hq_sporadic_flee(self, 20, puncher)
was called in the walrus's on_punch callback. (walrus depends on mob_core and better_fauna)
regardless, the debug points to this code:
function better_fauna.on_step(self, dtime, moveresult)
mob_core.on_step(self, dtime, moveresult)
if mobkit.timer(self, 1) then
if self.breeding_cooldown > 0 then
self.breeding_cooldown = self.breeding_cooldown - 1
end
mobkit.remember(self, "breeding_cooldown", self.breeding_cooldown)
end
end
specifically,
mob_core.on_step(self, dtime, moveresult)
2021-01-09 12:57:32: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'default' in callback luaentity_Step(): ...netest/games/mesecraft/mods/mobkit/example_behaviors.lua:379: attempt to index local 'rot' (a nil value)
2021-01-09 12:57:32: ERROR[Main]: stack traceback:
2021-01-09 12:57:32: ERROR[Main]: ...netest/games/mesecraft/mods/mobkit/example_behaviors.lua:379: in function 'func'
2021-01-09 12:57:32: ERROR[Main]: /app/share/minetest/games/mesecraft/mods/mobkit/init.lua:627: in function 'execute_queues'
2021-01-09 12:57:32: ERROR[Main]: /app/share/minetest/games/mesecraft/mods/mobkit/init.lua:844: in function 'stepfunc'
2021-01-09 12:57:32: ERROR[Main]: /app/share/minetest/games/mesecraft/mods/mob_core/api.lua:976: in function 'on_step'
2021-01-09 12:57:32: ERROR[Main]: ...e/minetest/games/mesecraft/mods/better_fauna/api/api.lua:511: in function <...e/minetest/games/mesecraft/mods/better_fauna/api/api.lua:510>
This happended after I punched a walrus which I ported over to mobkit. I expect
better_fauna.hq_sporadic_flee(self, 20, puncher)
was called in the walrus's on_punch callback. (walrus depends on mob_core and better_fauna)
regardless, the debug points to this code:
function better_fauna.on_step(self, dtime, moveresult)
mob_core.on_step(self, dtime, moveresult)
if mobkit.timer(self, 1) then
if self.breeding_cooldown > 0 then
self.breeding_cooldown = self.breeding_cooldown - 1
end
mobkit.remember(self, "breeding_cooldown", self.breeding_cooldown)
end
end
specifically,
mob_core.on_step(self, dtime, moveresult)
- ElCeejo
- Member
- Posts: 210
- Joined: Thu Feb 28, 2019 23:29
- GitHub: ElCeejo
- In-game: ElCeejo
- Location: Your Mother's house
Patch 5
Alpha Patch 5 is here!
Changes:
- Added mob_core.walkable_nodes table
- Added mob_core.find_val function
- Added pathfinding functions
- Re-Added mob_core.swim_to_next_waypoint
- Improved mob_core.fly_to_next_waypoint
- Improved spawn egg coloration
- Fixed crash when mobs die
- Fixed mob_core.is_mobkit_mob always returning false
- Fixed sound related crash
- Fixed mobs taking fall/fire damage when set to false
- Fixed mobs not defending owners when defend_owner is set to true
Changes:
- Added mob_core.walkable_nodes table
- Added mob_core.find_val function
- Added pathfinding functions
- Re-Added mob_core.swim_to_next_waypoint
- Improved mob_core.fly_to_next_waypoint
- Improved spawn egg coloration
- Fixed crash when mobs die
- Fixed mob_core.is_mobkit_mob always returning false
- Fixed sound related crash
- Fixed mobs taking fall/fire damage when set to false
- Fixed mobs not defending owners when defend_owner is set to true
- MisterE
- Member
- Posts: 694
- Joined: Sun Feb 16, 2020 21:06
- GitHub: MisterE123
- IRC: MisterE
- In-game: MisterE
Re: [mod] Mob Core [alpha] [mob_core]
Suggestion: add optional paramaters to call another spawn function when 1 spawn function is called
This would require optional 'spawn_def_name', 'call_spawn_by_name = {name = 'spawn_def_name',chance = int} and an optional 'disable_natural_spawn' paramaters.
then, you could disable natural spawns for a registered spawn function , but, for example, whenever you spawn a herd of deer, you have a chance of calling the spawn function with spawn_def_name = 'wolf_pack_5' which would spawn a pack of wolves hunting the deer
This would require optional 'spawn_def_name', 'call_spawn_by_name = {name = 'spawn_def_name',chance = int} and an optional 'disable_natural_spawn' paramaters.
then, you could disable natural spawns for a registered spawn function , but, for example, whenever you spawn a herd of deer, you have a chance of calling the spawn function with spawn_def_name = 'wolf_pack_5' which would spawn a pack of wolves hunting the deer
- ElCeejo
- Member
- Posts: 210
- Joined: Thu Feb 28, 2019 23:29
- GitHub: ElCeejo
- In-game: ElCeejo
- Location: Your Mother's house
Patch 6
Alpha Patch 6 is here!
Changes
- Fixed group spawning crashes
- Fixed issues with wildlife mod
- Improved group spawning
- Improved pathfinding
- Renamed old pathfinding to mob_core.find_path_lite()
- Added new mob_core.register_on_spawn() function
- Added optional reliability param to register_spawn()
Note: The reliability param defaults to 3. The higher it is the more likely mobs are to successfully spawn at the minor cost of performance.
Changes
- Fixed group spawning crashes
- Fixed issues with wildlife mod
- Improved group spawning
- Improved pathfinding
- Renamed old pathfinding to mob_core.find_path_lite()
- Added new mob_core.register_on_spawn() function
- Added optional reliability param to register_spawn()
Note: The reliability param defaults to 3. The higher it is the more likely mobs are to successfully spawn at the minor cost of performance.
- ElCeejo
- Member
- Posts: 210
- Joined: Thu Feb 28, 2019 23:29
- GitHub: ElCeejo
- In-game: ElCeejo
- Location: Your Mother's house
Patch 8 (Fix for Draconis and PaleoTest crashes)
Alpha Patch 8 is here!
Changes
- Fixed crashes with flying PaleoTest mobs and Draconis mobs.
- Removed reliability param from register_spawn()
- Improved aerial function collision avoidance
- Improved lq_dumbwalk
- Improved spawning reliability
- Improved pathfinder reliability
- Added new dumb pathfinder for simple, quick paths.
I realize I forgot to add a changelog for Alpha Patch 7. If I were to type out an entire changelog it would take too much time, but in short: Patch 7 Improved various functions.
Changes
- Fixed crashes with flying PaleoTest mobs and Draconis mobs.
- Removed reliability param from register_spawn()
- Improved aerial function collision avoidance
- Improved lq_dumbwalk
- Improved spawning reliability
- Improved pathfinder reliability
- Added new dumb pathfinder for simple, quick paths.
I realize I forgot to add a changelog for Alpha Patch 7. If I were to type out an entire changelog it would take too much time, but in short: Patch 7 Improved various functions.
- ElCeejo
- Member
- Posts: 210
- Joined: Thu Feb 28, 2019 23:29
- GitHub: ElCeejo
- In-game: ElCeejo
- Location: Your Mother's house
Patch 9 (Vastly improved A* Pathfinding)
Alpha Patch 9 is finally ready!
This patch brings some small improvements to various functions, fixes crashes, and better API documentation. But the biggest improvement is the pathfinder.
The new pathfinder still uses A*, but offers up to 20x faster times over the previous A* pathfinder by burli, and offers similar performance to recent dumb pathfinders, making it the fastest and most flexible luaside A* pathfinder for Minetest. All of this works with a single function, rather than 5 unique functions that were needed previously. This pathfinder won't go unused, it will be present in updates for 2 of my mods that will be released very soon.
This patch brings some small improvements to various functions, fixes crashes, and better API documentation. But the biggest improvement is the pathfinder.
The new pathfinder still uses A*, but offers up to 20x faster times over the previous A* pathfinder by burli, and offers similar performance to recent dumb pathfinders, making it the fastest and most flexible luaside A* pathfinder for Minetest. All of this works with a single function, rather than 5 unique functions that were needed previously. This pathfinder won't go unused, it will be present in updates for 2 of my mods that will be released very soon.
- ElCeejo
- Member
- Posts: 210
- Joined: Thu Feb 28, 2019 23:29
- GitHub: ElCeejo
- In-game: ElCeejo
- Location: Your Mother's house
Important Announcement
Development and support for Mob Core is ending soon. This will make more sense on February 10th, but until then don't expect any updates on this mod or it's dependents.
Re: [mod] Mob Core [alpha] [mob_core]
What's on February 10th?
Re: [mod] Mob Core [alpha] [mob_core]
@ElCeejo, would you be open to a PR to support part of cmi? Namely the mob punching and dying (viewtopic.php?f=11&t=15448, https://github.com/raymoo/cmi, https://content.minetest.net/packages/Byakuren/cmi/)
I've recently submitted a PR to the awards mod which would enable achievements for punching or killing mobs. However, cmi is only supported by mobs_redo. Looking at the mobkit source code, it doesn't look appropriate to put it there as it only contains barebone functions. Mob_core however looks like it has the necessary plumbing for it. The only thing I couldn't quite figure out is who should be calling on_die(). I feel like vitals() should be taking care of it, but it doesn't.
Anyhow, let me know what you think.
Cheers.
I've recently submitted a PR to the awards mod which would enable achievements for punching or killing mobs. However, cmi is only supported by mobs_redo. Looking at the mobkit source code, it doesn't look appropriate to put it there as it only contains barebone functions. Mob_core however looks like it has the necessary plumbing for it. The only thing I couldn't quite figure out is who should be calling on_die(). I feel like vitals() should be taking care of it, but it doesn't.
Anyhow, let me know what you think.
Cheers.
Re: [mod] Mob Core [alpha] [mob_core]
seems illogically to support a failed spec that died 5 years ago. just my two bent pennies
j5uBLfc6NxgersvVj5D5dIsiKDkoQb0o
Re: [mod] Mob Core [alpha] [mob_core]
In my case it suits a very specific purpose: awards. For lack of a better alternative... I wouldn't call it failed so much as unfinished/incomplete (and abandoned).
The code seems of reasonably good quality to me, and the interface implemented is well documented. It has no dependencies, and isn't tightly coupled with minetest. For that reason, it's still as good as it was five years ago.
Who is online
Users browsing this forum: Bing [Bot] and 27 guests