[mod] Minetest Systemd (API) [minetest_systemd]

User avatar
Linuxdirk
Member
Posts: 3217
Joined: Wed Sep 17, 2014 11:21
In-game: Linuxdirk
Location: Germany
Contact:

Re: [mod] Minetest Systemd (API) [minetest_systemd]

by Linuxdirk » Post

Mantar wrote:What trolling? Linuxdirk only posted a silly image,
Which is btw. absolutely correct according to one of systemd’s manpages.

This just show the complexity of systemd and that is is not a good idea to copy a system like this for Minetest.
Mantar wrote:I seriously doubt anyone's going to get mad about it.
Except Mr. No Fun Allowed.

User avatar
Piezo_
Member
Posts: 219
Joined: Fri Jul 20, 2018 21:36
GitHub: is proprietary I use NotABug
Location: (x,y,z)

Re: [mod] Minetest Systemd (API) [minetest_systemd]

by Piezo_ » Post

Linuxdirk wrote:Except Mr. No Fun Allowed.
Ok, please, stop. There's a place for fun here, and it's this board.

Any comments not about the API will be ignored by me, and possibly dealt with by the moderators.
while (true) { suffer(); }

User avatar
Piezo_
Member
Posts: 219
Joined: Fri Jul 20, 2018 21:36
GitHub: is proprietary I use NotABug
Location: (x,y,z)

Re: [mod] Minetest Systemd (API) [minetest_systemd]

by Piezo_ » Post

Update
  • minetestd.utils.check_item_match now understands minetest:node, which matches all nodes.
  • Added minetestd.register_on_teleportplayer(function(player, old_pos, new_pos)). If the function returns true (er, technically, non-nil), then the teleport fails.
  • Moved some code around in playerctl.lua. Tell me if I broke something.
Unfortunately, this update does require a full restart.
while (true) { suffer(); }

User avatar
Piezo_
Member
Posts: 219
Joined: Fri Jul 20, 2018 21:36
GitHub: is proprietary I use NotABug
Location: (x,y,z)

Re: [mod] Minetest Systemd (API) [minetest_systemd]

by Piezo_ » Post

Update
  • Added a way for services to list other services as dependencies
  • added minetestd.register_on_killplayer(function(killer, victim, item))
Last edited by Piezo_ on Tue Jan 22, 2019 20:03, edited 1 time in total.
while (true) { suffer(); }

User avatar
Piezo_
Member
Posts: 219
Joined: Fri Jul 20, 2018 21:36
GitHub: is proprietary I use NotABug
Location: (x,y,z)

Re: [mod] Minetest Systemd (API) [minetest_systemd]

by Piezo_ » Post

Update
  • GravityCTL has become deprecated in favor of PhysicsCTL, which now handles speed, jump, gravity, and more if you desire.
  • Added minetestd.utils.get_light_info(pos), which returns a table with useful info about the light at the current position.
  • Added minetestd.playerctl.register_metatable_change(name, doChange(metatable)), which can be used to queue changes to the player metatable once it's available.
  • Added chat commands to change default gravity, speed and jump server-wide (need privilege: setphysics)
  • Added nearly-complete documentation
A restart is required for this update
while (true) { suffer(); }

User avatar
Piezo_
Member
Posts: 219
Joined: Fri Jul 20, 2018 21:36
GitHub: is proprietary I use NotABug
Location: (x,y,z)

Re: [mod] Minetest Systemd (API) [minetest_systemd]

by Piezo_ » Post

Update
  • Improved dependency handling and service start/stop behavior
  • Fixed a few bugs
  • minetestd.tables.merge_tables can now be passed a third parameter, a function that will determine what to do when a key is shared by both tables.
  • Added minetestd.tables.smart_merge_values, a function designed for use with minetestd.tables.merge_tables, that will "intelligently" add two values of nearly any type.
  • Added a utility for converting position vectors to short, filename-friendly strings containing only characters [0-9_]
A restart is required for this update.
while (true) { suffer(); }

User avatar
Piezo_
Member
Posts: 219
Joined: Fri Jul 20, 2018 21:36
GitHub: is proprietary I use NotABug
Location: (x,y,z)

Re: [mod] Minetest Systemd (API) [minetest_systemd]

by Piezo_ » Post

Update
  • Added minetestd.utils.is_solid_block(pos)
  • Improved syntax/structure in a few places
  • Fixed some uses of the /minetestd command not displaying errors properly.
  • Cleaned up documentation
while (true) { suffer(); }

User avatar
Wuzzy
Member
Posts: 4786
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy
Contact:

Re: [mod] Minetest Systemd (API) [minetest_systemd]

by Wuzzy » Post

I don't really think this mod is useful. The documentation is confusing, and the selection of features even more. It has lot of wildly unrelated obscure features where I don't really understand the use case for each of them.
The mod as a whole does not know what it wants to be.
Then the name is terrible. The name “minetest_systemd” is wildly misleading!

I have to completely agree with sofar that the features should be singled-out into more logically-grouped mods. However, I have to stress that mods of the “utility” functions are obscure enough that I never really need them.

I urge all modders to refuse to use this mod as dependency, ever. If you really need one of those utility functions, it is usually better to just copy the (usually short) code in question instead of opening the 9th gate to Dependency Hell.
Also avoid optional dependency. If you are able to optionally depend on this mod, you never needed it to begin with.

Another problem I see is, even if I would find any of those functions useful and I would want to depend on this mod (in reality: hell no!), I would have to depend on everything and the kitchen sink just for a single tiny function. That's not really good design. Yeah, sofar is really spot-on with the critique.
register services to make parts of their code toggleable or even reloadable mid-game without having to restart the server.
But why?
useful functions that are missing from minetest's global object
Then why not pushing for adding them to Minetest / builtin? Did you at least try? It's better for everyone if essential features go into builtin instead of forcing everyone to depend on a weird obscure mod.

I think the whole ideology behind this mod is misguided. The real problem is a (slightly)) incomplete core API. Many modders seem to want to fix it by adding wrapper over wrapper over wrapper, etc. While what we really should do it so push for a better core API to begin with.

If the average modder almost requires additonal mods to even start working, that would be a sign that something is seriously rotten. OK, it's not really that bad, but some aspects of the core API leave a bit to be desired, but that's nothing that would be impossible to improve upon.
PhysicsCTL
Redundant with a lot of other mods which do the exact same thing. For example, [playerphysics], but I heard there are other mods, too.

Also, very very inconsistent with the other features of the mod. The term “feature creep” comes into mind.
Changing the default physics
Completely pointless, Minetest has global settings for that.
minetestd.utils.get_light_info
Just a wrapper function, basically.

Sorry for being so negative, but I just have a real hard time seeing the point of all this.

User avatar
Piezo_
Member
Posts: 219
Joined: Fri Jul 20, 2018 21:36
GitHub: is proprietary I use NotABug
Location: (x,y,z)

Re: [mod] Minetest Systemd (API) [minetest_systemd]

by Piezo_ » Post

Wuzzy wrote:Also avoid optional dependency. If you are able to optionally depend on this mod, you never needed it to begin with.
Sometimes mods can support minetest_systemd's fetures (i.e. reloadability, physicsctl integration, etc.) without depending on it. From what your main argument seems to be (that this mod should burn in Hell for all eternity), then wouldn't that be preferable (if someone wants to support the mod in the first place) rather than writing their mod such that it hard-depended on this?
Wuzzy wrote:
register services to make parts of their code toggleable or even reloadable mid-game without having to restart the server.
But why?
For a server host who is constantly fixing and improving their server's mods, it's incredibly helpful (especially if lots of players are online), to be able to restart functional mods that don't add any init-dependent content individually without having to bring down the entire server, kicking all players.
Wuzzy wrote:
useful functions that are missing from minetest's global object
Then why not pushing for adding them to Minetest / builtin? Did you at least try? It's better for everyone if essential features go into builtin instead of forcing everyone to depend on a weird obscure mod.
Maybe I'm just cynical, but I don't think trying would do much in the short-term (or even long-term), and I don't want to wait around for this, when my mods need functionality now.
If any of the extra utilities do get into builtin/minetest with all of the usefulness of their minetestd.utils counterparts, I'll happily send my versions of them to the deprecated function purgatory. Until then, I'm not waiting around for them.
Wuzzy wrote:
PhysicsCTL
Redundant with a lot of other mods which do the exact same thing. For example, [playerphysics], but I heard there are other mods, too.
A quick search of the forum's mods didn't show "playerphysics", aside from being listed in a couple mods' dependencies (uh-oh!).

The ones that came to my mind when you mentioned this were player_monoids and playereffects, but I feel like PhysicsCTL is more comfortable for my purposes.
Wuzzy wrote:
Changing the default physics
Completely pointless, Minetest has global settings for that.
Yes, but I can do it in real-time :P
Wuzzy wrote:
minetestd.utils.get_light_info
Just a wrapper function, basically.
I'll be honest, this one's kind of obscure, but a lot of nature mods use (or should use) the data this gathers, either by doing the math on their own, or, if they have some other reason to depend minetest_systemd, they get this as a bonus. I'll try to avoid adding any more "useless" extra utilities.
Wuzzy wrote:Sorry for being so negative, but I just have a real hard time seeing the point of all this.
This mod was born out of my frustration with trying to get mods that were incompatible with each other and sometimes buggy even on their own to coexist. The reloadable services bit (which was part of the inspiration for the name) was an idea I had that tied things together surprisingly well and turned out to be very powerful. Minetest_systemd is a multi-tool that I have found to be incredibly helpful in what I do, and it will remain here for myself and anyone who wants to use it. If you don't like it, don't use it. If you don't like just part of it, it's Free Software, just delete that part (this is best accomplished via removing the service in basic_services.lua). I have no problem with it sitting in obscurity, found only on my server, where I have the ability to reload/enable/disable some of my mods in real time, while the rest of the modding community does what they will without it.
while (true) { suffer(); }

User avatar
Wuzzy
Member
Posts: 4786
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy
Contact:

Re: [mod] Minetest Systemd (API) [minetest_systemd]

by Wuzzy » Post

Yes, I know, trying to contribute anything to Minetest can be extremely frustrating but that doesn't mean one shouldn't at least try. Sometimes I think the extreme conservatism holds Minetest back. On the other hand, it's what kept Minetest stable, so …

So. Your mod is basically mostly a debug helper? Yeah, then I can kind of understand the use case here. So that service thing was not really meant to depend on, OK.

Forum search is broken. viewtopic.php?f=9&t=22172
Heck, this mod shows even on page 1 (in words: ONE) of Mod Releases. :P You can't make this stuff up.

User avatar
Piezo_
Member
Posts: 219
Joined: Fri Jul 20, 2018 21:36
GitHub: is proprietary I use NotABug
Location: (x,y,z)

Re: [mod] Minetest Systemd (API) [minetest_systemd]

by Piezo_ » Post

Now that I actually see the mod, I will admit that the simplicity of it looks nice, and the concept is similar to PhysicsCTL.
PhysicsCTL's main differences, though, are why I still prefer it:
  • Effects are registered with a "check function" (which automatically applies the effect only when applicable, and stops applying it when it doesn't, instead of a mod having to add and remove its effects)
  • The "Blend function", while fully capable of emulating playerphysics, is able to modify the entire player physics table at once in whatever way it desires, and also receives the player as a parameter, allowing for a single effect to adapt to certain properties of the player and have a dynamic effect rather than a single number which is always multiplied (for example, look at how the hangglider mod implements this).
  • An "effect order" exists, which gives effects more control over what order they're applied in, since we're dealing with effects more complicated than simple multiplication.
while (true) { suffer(); }

ShadMOrdre
Member
Posts: 1118
Joined: Mon Dec 29, 2014 08:07
Location: USA

Re: [mod] Minetest Systemd (API) [minetest_systemd]

by ShadMOrdre » Post

Wuzzy,

When Piezo posted this mod, your playerphysics mod had not yet been released. You only posted that mod recently, and since both Termos and sorcerykid posted their own projects regarding player physics. Why did you not also contribute your ideas and code to the existing projects that were already working to resolve those issues? Player_monoids competes with playereffects, and while I actually have both loaded and working, playerphysics now becomes yet another new dependency. Monoids should have been put into builtin a long time ago, and all other mods should have been updated to use it, and it should have been modified and updated to add that which is lacking. You are just as guilty of writing a new mod to address issues, and thus taking us to the nth level of dependency hell, while being very critical of any other mod that attempts to do the same. Your own arguments about dependencies fall flat, there is not a single part of MCL2 that can be lifted, without rewriting significant parts. Honestly, unless a single mod creates EVERYTHING, there will always be a dependency somewhere.

Piezo,

Not coming from a Linux background, I'll have to learn what sysd even is. :) However, I've resorted to a similar methodology in cobbling all the necessary small stuff into a single object. I'll let you know if I find this as useful a debugging tool as it sounds to be. What!?! Reloading code without having to restart. YES!!!

Shad.

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

Re: [mod] Minetest Systemd (API) [minetest_systemd]

by Termos » Post

ShadMOrdre wrote:both Termos and sorcerykid posted their own projects regarding player physics.
Just a little disclaimer.
Termos' entity api doesn't deal with player physics in any way. I intend to keep it this way if possible.

User avatar
Piezo_
Member
Posts: 219
Joined: Fri Jul 20, 2018 21:36
GitHub: is proprietary I use NotABug
Location: (x,y,z)

Re: [mod] Minetest Systemd (API) [minetest_systemd]

by Piezo_ » Post

Update
  • Playerctl steps can now be deleted with minetestd.playerctl.delete_step, and doing so will clear all of the step's player data.
  • Steps registered during runtime will get new data for themselves.
  • Added minetestd.math.get_volume_in_volume, which is similar to volume_in_volume, but instead returns the minp,maxp pair of the intersecting volume.
  • Added minetestd.utils.get_artificial_light and minetestd.utils.get_natural_light, which are my temporary lua implementations of the functions proposed in https://github.com/minetest/minetest/pull/5680, they will probably be removed when it becomes part of a stable release.
This update can be applied to your server without needing to restart the whole game. Simply use /minetestd restart * to reload everything.
while (true) { suffer(); }

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 22 guests