I'm going to implement your ideas. :-)acidzebra wrote: ↑Wed May 13, 2020 16:56running petz on a server, I've been trying to bring down the system load of the mod. It's fine in singleplayer.
I see two main bottlenecks, in api_spawn.lua you register_globalstep and then check for a node to spawn a mob on every step; I think this could be toned down a little by adding a timer like in the example here https://dev.minetest.net/minetest.register_globalstep
Then in api_on_step.lua for every server step you run (assuming every option is set to true)
petz.init_tamagochi_timer(self)
petz.pregnant_timer(self, dtime)
petz.growth_timer(self, dtime)
petz.gallop(self, dtime)
petz.dreamcatcher_save_metadata(self)
I'm still digging through the code, but is it crucial these things are called every server step?
Just some suggestions, I'm an absolute beginner in lua.
[Mod] Petz [DEPRECATED] [petz]
Re: [Mod] Petz [v13.2] [petz]
Re: [Mod] Petz [v14.2] [petz]
v14.3
- The on_step functions are checked every 1 second now.
- Workaround for parrot perch issue in 5.3-dev.
- The on_step functions are checked every 1 second now.
- Workaround for parrot perch issue in 5.3-dev.
Re: [Mod] Petz [v14.3] [petz]
I think that does not matter cos the mobkit function has a interval value for checking a spawn node.I see two main bottlenecks, in api_spawn.lua you register_globalstep and then check for a node to spawn a mob on every step; I think this could be toned down a little by adding a timer like in the example here https://dev.minetest.net/minetest.register_globalstep
Last edited by runs on Wed Jun 17, 2020 00:49, edited 2 times in total.
Re: [Mod] Petz [v14.3] [petz]
I will implement a death function so that the petz will not be eternal. Especially the less intelligent ones. It may be useful in servers to control overcrowding.
Re: [Mod] Petz [v14.3] [petz]
I got a squirrel crash loop on my server jungle:
It is not a true loop, but the player can't login anymore because server crashes when he logs in because of the squirrel.
Code: Select all
2020-06-18 19:37:16: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'petz' in callback luaentity_Step(): .../mods/petz/petz/mobkit/bh_arboreal.lua:74: attempt to index a nil value
2020-06-18 19:37:16: ERROR[Main]: stack traceback:
2020-06-18 19:37:16: ERROR[Main]: .../mods/petz/petz/mobkit/bh_arboreal.lua:74: in function 'func'
2020-06-18 19:37:16: ERROR[Main]: /.minetest/mods/mobkit/init.lua:741: in function 'execute_queues'
2020-06-18 19:37:16: ERROR[Main]: /.minetest/mods/mobkit/init.lua:959: in function 'stepfunc'
2020-06-18 19:37:16: ERROR[Main]: ...rs/.minetest/mods/petz/petz/petz/squirrel_mobkit.lua:79: in function 'func'
Re: [Mod] Petz [v14.3] [petz]
v14.4
- Solved crash with squirrel.
- Solved crash with squirrel.
Re: [Mod] Petz [v14.3] [petz]
Try the last version.Gundul wrote: ↑Thu Jun 18, 2020 17:49I got a squirrel crash loop on my server jungle:
It is not a true loop, but the player can't login anymore because server crashes when he logs in because of the squirrel.Code: Select all
2020-06-18 19:37:16: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'petz' in callback luaentity_Step(): .../mods/petz/petz/mobkit/bh_arboreal.lua:74: attempt to index a nil value 2020-06-18 19:37:16: ERROR[Main]: stack traceback: 2020-06-18 19:37:16: ERROR[Main]: .../mods/petz/petz/mobkit/bh_arboreal.lua:74: in function 'func' 2020-06-18 19:37:16: ERROR[Main]: /.minetest/mods/mobkit/init.lua:741: in function 'execute_queues' 2020-06-18 19:37:16: ERROR[Main]: /.minetest/mods/mobkit/init.lua:959: in function 'stepfunc' 2020-06-18 19:37:16: ERROR[Main]: ...rs/.minetest/mods/petz/petz/petz/squirrel_mobkit.lua:79: in function 'func'
Re: [Mod] Petz [v14.4] [petz]
v14.5
- Fixed regression with timers (cause of the on_step change): grow, pregnant...
Lifetime Mode
You can set the lifetime for the petz in the 'petz-conf' file:
- lifetime = -1
-- General lifetime for all the petz. Set a value in seconds.
-- Set to -1 to disable
- You can configure individual lifetime for each type of petz, simply create a "_lifetime" setting. I.e.: "kitty_lifetime = 1200".
-- This particular setting overrides the general lifetime setting.
-- This also works if general lifetime is -1.
-- If you put this setting to -1, the lifetime general setting also would be overrided. You can use this to avoid some type of petz to die when general lifetime is set.
- A dreamcatcher in a petz disables all the lifetime.
- Some fine tunings:
-- lifetime_only_non_tamed = false
-- lifetime_avoid_non_breedable = false
- Fixed regression with timers (cause of the on_step change): grow, pregnant...
Lifetime Mode
You can set the lifetime for the petz in the 'petz-conf' file:
- lifetime = -1
-- General lifetime for all the petz. Set a value in seconds.
-- Set to -1 to disable
- You can configure individual lifetime for each type of petz, simply create a "_lifetime" setting. I.e.: "kitty_lifetime = 1200".
-- This particular setting overrides the general lifetime setting.
-- This also works if general lifetime is -1.
-- If you put this setting to -1, the lifetime general setting also would be overrided. You can use this to avoid some type of petz to die when general lifetime is set.
- A dreamcatcher in a petz disables all the lifetime.
- Some fine tunings:
-- lifetime_only_non_tamed = false
-- lifetime_avoid_non_breedable = false
- Attachments
-
- kawaii_skull.png (50.71 KiB) Viewed 954 times
Last edited by runs on Fri Jun 19, 2020 16:36, edited 13 times in total.
Re: [Mod] Petz [v14.5] [petz]
v14.6
- Now the lifetime of a petz is shown in its form (tab "Other") (if applies).
- Fix to avoid a crash: Now an opened formspec is automatically closed when a petz dies.
- Now the lifetime of a petz is shown in its form (tab "Other") (if applies).
- Fix to avoid a crash: Now an opened formspec is automatically closed when a petz dies.
Re: [Mod] Petz [v14.6] [petz]
Be Cautious when you define and use the Lifetime Mode
Or you could get some or all the petz dead. I recommend you to test it in a test server.
Or you could get some or all the petz dead. I recommend you to test it in a test server.
Re: [Mod] Petz [v14.6] [petz]
v14.7
- Added the lifetime_variability (0.2 by default) to add some individual variety in the lifetime. This means that the lifetime can change +-20% for each individual entity.
- Added the lifetime_variability (0.2 by default) to add some individual variety in the lifetime. This means that the lifetime can change +-20% for each individual entity.
- LMD
- Member
- Posts: 1396
- Joined: Sat Apr 08, 2017 08:16
- GitHub: appgurueu
- IRC: appguru[eu]
- In-game: LMD
- Location: Germany
- Contact:
Re: [Mod] Petz [v14.7] [petz]
For increased intuitivity, I would rather recommend something like lifetime_min and lifetime_max.
Re: [Mod] Petz [v14.7] [petz]
A player reported there's a duplicate crafting recipe of the shears of mobs_redo and petz. Could you add a recipe that lets players exchange them, when both mods are installed? There may be other duplicate recipes that we haven't come across yet
Whatever I say is CC0
Re: [Mod] Petz [v14.7] [petz]
Maybe set the default shear as with the lasso.
You should use an advanced craft/inventory, those allow multiple same recipes (duplicates), simply you select the output you want.
Last edited by runs on Sun Jun 21, 2020 21:27, edited 4 times in total.
Re: [Mod] Petz [v14.7] [petz]
v14.8
- Now you can define the shears to use in "petz.conf".
- Now you can define the shears to use in "petz.conf".
Re: [Mod] Petz [v14.8] [petz]
17 minutes from bug report to fix. Awesome :)
You could also let the mobs_redo shears be crafted from the petz shears and vice versa. I am using unified inventory, it does not seem to have such an option you mentioned?
You could also let the mobs_redo shears be crafted from the petz shears and vice versa. I am using unified inventory, it does not seem to have such an option you mentioned?
Whatever I say is CC0
Re: [Mod] Petz [v14.8] [petz]
v14.9
- Fixed crash with the parchment in 5.3-dev
- Fixed crash with the parchment in 5.3-dev
Re: [Mod] Petz [v14.2] [petz]
I checked and I have not the issue.
Make 2 things:
- Test 1: Download the last 3D Armor (it is not the official one= outdated): https://github.com/minetest-mods/3d_armor
- Test 2: Move the 3darmor mod to another location and check without it.
Re: [Mod] Petz [v14.9] [petz]
Hi, Just found a bug with server crash and when the player reconnect that crash the server again.
Code: Select all
2020-06-28 11:27:06: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'petz' in callback luaentity_Step(): .../mobkit/init.lua:1495: attempt to index local 'node3' (a nil value)
2020-06-28 11:27:06: ERROR[Main]: stack traceback:
2020-06-28 11:27:06: ERROR[Main]: .../mobkit/init.lua:1495: in function 'is_in_deep'
2020-06-28 11:27:06: ERROR[Main]: .../petz/petz/mobkit/br_aquatic.lua:58: in function 'logic'
2020-06-28 11:27:06: ERROR[Main]: .../mobkit/init.lua:958: in function 'stepfunc'
2020-06-28 11:27:06: ERROR[Main]: .../petz/petz/petz/dolphin_mobkit.lua:81: in function <.../petz/petz/petz/dolphin_mobkit.lua:80>
Re: [Mod] Petz [v14.9] [petz]
It is a mobkit error. I will report it.shazen wrote: ↑Sun Jun 28, 2020 09:48Hi, Just found a bug with server crash and when the player reconnect that crash the server again.
Code: Select all
2020-06-28 11:27:06: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'petz' in callback luaentity_Step(): .../mobkit/init.lua:1495: attempt to index local 'node3' (a nil value) 2020-06-28 11:27:06: ERROR[Main]: stack traceback: 2020-06-28 11:27:06: ERROR[Main]: .../mobkit/init.lua:1495: in function 'is_in_deep' 2020-06-28 11:27:06: ERROR[Main]: .../petz/petz/mobkit/br_aquatic.lua:58: in function 'logic' 2020-06-28 11:27:06: ERROR[Main]: .../mobkit/init.lua:958: in function 'stepfunc' 2020-06-28 11:27:06: ERROR[Main]: .../petz/petz/petz/dolphin_mobkit.lua:81: in function <.../petz/petz/petz/dolphin_mobkit.lua:80>
Re: [Mod] Petz [v14.9] [petz]
This can be solved changing the line 1494 of the mobkit's init.lua to:
if node1 and node2 and node3 and node1.drawtype=='liquid' and (node2.drawtype=='liquid' or node3.drawtype=='liquid') then
if node1 and node2 and node3 and node1.drawtype=='liquid' and (node2.drawtype=='liquid' or node3.drawtype=='liquid') then
Who is online
Users browsing this forum: No registered users and 13 guests