Check overlaps of recipes in mods (using new tool: qa_block)

Post Reply
bell07
Member
Posts: 599
Joined: Sun Sep 04, 2016 15:15
GitHub: bell07

Check overlaps of recipes in mods (using new tool: qa_block)

by bell07 » Post

Hi! At the first, I am new in Minetest , new in lua, new in github to, not a developer, so forgive me if I do something wrong.

After the discovery of the greatness of minetest I installed a lot of mods. It was not long time I seen not all items are craftable because interfering of recipes for different things from different mods. So to get an overview I started a checker-mod for this. See https://github.com/bell07/minetest-qa_block

The result of the run on my installation is:

Code: Select all

QA checks started
same recipe	ts_doors:door_locked_default_aspen_wood	homedecor:door_wood_plain_left 2
same recipe	castle:hole_cobble 4	"firestone:chimney" 4
same recipe	ts_furniture:default_aspen_wood_chair	homedecor:chair 2
same recipe	ts_furniture:default_acacia_wood_chair	homedecor:chair 2
same recipe	homedecor:tatami_mat	xdecor:tatami
same recipe	default:furnace	xdecor:stone_rune 4
same recipe	homedecor:chair 2	ts_furniture:default_junglewood_chair
same recipe	ts_furniture:default_pine_wood_small_table	homedecor:table
same recipe	ts_doors:trapdoor_default_wood	xdecor:workbench
same recipe	xdecor:workbench	ts_doors:trapdoor_default_acacia_wood
same recipe	xdecor:workbench	ts_doors:trapdoor_default_junglewood
same recipe	homedecor:chair 2	ts_furniture:default_wood_chair
same recipe	xdecor:workbench	ts_doors:trapdoor_default_pine_wood
same recipe	homedecor:table	ts_furniture:default_aspen_wood_small_table
same recipe	homedecor:door_wood_plain_left 2	ts_doors:door_locked_default_wood
same recipe	homedecor:door_wood_plain_left 2	ts_doors:door_locked_default_acacia_wood
same recipe	homedecor:table	ts_furniture:default_junglewood_small_table
same recipe	default:sign_wall_steel 3	cottages:hammer
same recipe	homedecor:door_wood_plain_left 2	ts_doors:door_locked_default_pine_wood
same recipe	castle:anvil	cottages:anvil
same recipe	cottages:straw_mat 3	cottages:straw
same recipe	xdecor:workbench	ts_doors:trapdoor_default_aspen_wood
same recipe	homedecor:table	ts_furniture:default_wood_small_table
same recipe	cottages:glass_pane 4	xdecor:woodframed_glass
same recipe	ts_doors:door_default_aspen_wood	doors:door_wood
same recipe	ts_doors:door_default_pine_wood	doors:door_wood
same recipe	ts_doors:door_default_acacia_wood	doors:door_wood
same recipe	ts_doors:door_default_junglewood	doors:door_wood
same recipe	ts_doors:door_default_wood	doors:door_wood
same recipe	castle:crossbow_bolt 6	throwing:arrow 16
same recipe	homedecor:door_wood_plain_left 2	ts_doors:door_locked_default_junglewood
same recipe	ts_doors:door_default_steelblock	doors:door_steel
same recipe	xdecor:workbench	building_blocks:hardwood 2
same recipe	xdecor:workbench	building_blocks:hardwood 2
same recipe	ts_doors:trapdoor_full_default_steelblock	ts_doors:trapdoor_locked_default_steelblock
same recipe	ts_doors:trapdoor_default_steelblock	doors:trapdoor_steel
same recipe	xdecor:rope	castle:ropes
same recipe	homedecor:table	ts_furniture:default_acacia_wood_small_table
same recipe	homedecor:cobweb_corner 5	xdecor:cobweb
same recipe	jetpack:jetpack_base	default:ladder_steel 15
same recipe	homedecor:cobweb_corner 5	mobs:cobweb
same recipe	xdecor:cobweb	mobs:cobweb
same recipe	homedecor:chair 2	ts_furniture:default_pine_wood_chair
same recipe	itemframes:frame	xdecor:itemframe
QA checks finished. Have a look to the debug.txt
How I can handle them?
If a group is used I can force the using group if I use different items from the group. Sample: I can force homedecor:door_wood_plain_left instead of ts_doors:door_locked_default_???_wood using different wood in crafting.

A special contemplation needs the

Code: Select all

same recipe   homedecor:cobweb_corner 5   mobs:cobweb
same recipe   xdecor:cobweb   mobs:cobweb
same recipe	homedecor:cobweb_corner 5	xdecor:cobweb
The cobweb is provided by 3 different mods with nearly the same definition and appearance. How I can prefer one of them? Is it possible to define in minetest the it is the same? The mobs:cobweb can be used in a recipe, is it possible to take minetest the xdecor:cobweb or homedecor:cobweb_corner should be usable in the recipe of mobs:cobweb? Sorry, I do not know if I clearly explain my question.

So, the QA-Block give me the issues overview but what are the next steps?

The QA-block can be used by modpack or subgame developers to check consistency of modpack or subgame.

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

Re: Check overlaps of recipes in mods (using new tool: qa_bl

by Wuzzy » Post

Someone else was faster than you and already wrote a mod which does pretty much the same as your mod. I can't find it at the moment, however.

As for the question how to handle them: The first obvious step would be to complain to the mod authors and try to get the conflicts resolved. But it is going to be hard with so many mods around. :-(
I don't think there is any guarantee that you will have access to all registered recipes in future versions because I don't think this behaviour is really intentional.

Crafting recipe collisions are unavoidable because of the fucked-up design of the crafting system in Minetest. IMO the crafting system is broken by design because Minetest's crafting system makes the problem of recipe collisions possible in the first place. The only real fix here would be a major redesign of the existing crafting system which would make collisions impossible. While reporting recipe collisions to mod authors may work in the short run, in the long run we need a redesign IMO.
Here's my proposal: viewtopic.php?f=5&t=15353

As for redundant node definitions: Well, this is clearly an issue of poor mod collaboration. Report it to the mod authors in trying to get it resolved. While it is not directly a bug, it is still very ugly. Modders should find a way to define a “canonical” cobweb, then depend on it. Adding custom cobweb nodes may only be justified if it is very different from the existing nodes.
My creations. I gladly accept bitcoins: 17fsUywHxeMHKG41UFfu34F1rAxZcrVoqH

User avatar
rubenwardy
Moderator
Posts: 6374
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: United Kingdom
Contact:

Re: Check overlaps of recipes in mods (using new tool: qa_bl

by rubenwardy » Post

Wuzzy wrote:As for redundant node definitions: Well, this is clearly an issue of poor mod collaboration. Report it to the mod authors in trying to get it resolved. While it is not directly a bug, it is still very ugly. Modders should find a way to define a “canonical” cobweb, then depend on it. Adding custom cobweb nodes may only be justified if it is very different from the existing nodes.
See how the food mod achieves this using groups and fallbacks

bell07
Member
Posts: 599
Joined: Sun Sep 04, 2016 15:15
GitHub: bell07

Re: Check overlaps of recipes in mods (using new tool: qa_bl

by bell07 » Post

I agree the resolving of conflicts is broken by design because of lack of design at this place. It works somehow but there is no concept implemented to manage redefinitions. So each overlapping is a bug currently.
Some mods do great work to compensate them in “if mod a is installed, do x, if b is installed, do y...” but it is the wrong way, this should be managed by game core.

Back to the issue of overlapping recipes. I do not see any reason to override any receipt result only. In most cases the item/node definition should be overridden, overriding of recipe is just correspondingly to item/node override.

Sample 1: recipe overriding only, like default:sign_wall_steel overriden by cottages:hammer does not sense. So we can assume if it is an override the items are equivalent. If not (like this sample) it is a bug.

Sample 2: ts_doors:door_default_steelblock vs. doors:door_steel
The ts_doors:door needs to override doors:door. It is a legit reason. To define the overriding direction the ts_doors has the doors in depends.txt.. So the recipe redefinition works as expected. But the not used recipe and the old item definition “doors:door” is not cleaned up in runtime. The overridden doors:door is available in creative. Enhancements on the doors:door in other mods (if existing) are not directly applied on ts_doors:door and needs to be re-implemented. In short: the relation “doors:door overridden by ts_doors:door” is not known in the runtime because the relation handling of this type is not implemented. Currently there are 2 different items with just overlapping recipe.

I miss something like:

Code: Select all

minetest.enhance_item(oldnode, newnode-definition)
that does:
1: Merge oldnode attributes with given newnode definition
2: remove oldnode
3: set alias for oldnode to newnode

If this method will be present, no overriding of the recipe is needed because it should be merged from “oldnode” to the “newnode”. With “ oldnode attributes” I mean, not just node attributes but item-attributes, functions, recipe, and maybe other things related to this item/node.

Using this method the Sample 2 can proper implemented by

Code: Select all

minetest.enhance_item(“doors:door_steel”, “ ts_doors:door_default_steelblock” { newimages, newfunctions… })
A method

Code: Select all

minetest.replace_item(oldnode, newnode-definition)
will be usefull too. This method differs in step 1: no merging, whole replace. Usefull for redefinitions from scratch.

And where we're at it, a third new method will be nice:

Code: Select all

minetest.merge_loaded_items(node1, node2, node3…)
This method does not create a new node, just merges the already loaded nodes. Using this method the “Cobweb-Problem” is solvable. There is no reason to create any dependencies between the 3 projects. I need just to tell minetest the items are the same. So I can create a new mod “cobweb_compat” depending on all 3 mods with cobweb. The init.lua contains just

Code: Select all

minetest.merge_loaded_items(“homedecor:cobweb_corner”, “mobs:cobweb”, “xdecor:cobweb”)
So I priorized the cobweb’s, just xdecor:cobweb is available and both other just as alias. The defined recipe to get cotton from mobs:cobweb is merged to xdecor:cobweb and is available ingame.

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

Re: Check overlaps of recipes in mods (using new tool: qa_bl

by Wuzzy » Post

I already addressed the problem with the locked steel door of ts_doors. It cen be resolved very easily, actually.
Here, the locked ts_doors steel door is very redundant with Minetest Game's steel door, the only difference is the texture and maybe the name. There is no reason to have two totally equivalent steel doors.
Here's my solution: ts_doors needs to remove its own locked steel door and instead just overwrites the default steel door in order to rename and retexture it. The default steel door recipe must be removed/re-added because in ts_doors, crafting recipes for locked doors are different. For backwards-compability, the now removed ts_doors door gets an alias to the Minetest Game steel door and we're done. All of this is possible right now and does not require any engine change.
This is a simple and lightweight solution which solves all of the problems of the steel door duplicate, both door and recipe. This has been suggested by me in the original ts_doors mod. I think your proposed solution is WAY to complicated.

Oh, by the way: Can you please any other crafting recipes which are known to collide with other mods? Especially for those which do not look intentional.
My creations. I gladly accept bitcoins: 17fsUywHxeMHKG41UFfu34F1rAxZcrVoqH

bell07
Member
Posts: 599
Joined: Sun Sep 04, 2016 15:15
GitHub: bell07

Re: Check overlaps of recipes in mods (using new tool: qa_bl

by bell07 » Post

I try to look for a solution in general. There is a inhibition to redefine something in foreign namespaces (modname=namespace for me), especially for new modders, especially to redefine "stabilized" things from minetest_game mods. If bugs appears and in the debug.txt the buggy item is named "default:xyz" the bug-hunter search on the wrong place. Therefore the result of the redefinition should be in the namespace of the new item, not in the old (not active) one. If you take it exactly the core should contain a check for namespace of the new registered items, or automatically set them.

On the other site is the "cobweb-problem". There is no comparable definition in minetest_game that can be redefined. Just 3 developer provide the same thing. The way today is to create new project/mod "cobweb:cobweb", set them as dependency for all 3 projects and remove the cobweb from all 3 projects. That results in unification, and unification is not a goal in open source. What's happens if the 3 mod developer not agree which cobweb should be the unified "standard" thing?

The mod developer should be able to provide game content without having to examine all other projects. The modpack and subgame developer needs to be able to priorize and unify multiple provided things.

You are right, maybe there is not so many overlaps currently. But I am sure we had more mods with more content then today if the overlapping is clear defined.

Now I activated all downloaded mods and did the receipt overlapping check. But for now I see it is just a symptom of an other problem.

Code: Select all

same recipe	default:ladder 4	default:ladder_wood 3	
same recipe	mobs:cobweb	homedecor:cobweb_corner 5	
same recipe	default:sign_wall 4	default:sign_wall_wood 3	
same recipe	dye:violet 1	dye:violet 4	
same recipe	dye:black 1	dye:black 4	
same recipe	my_future_doors:door7a 1	my_misc_doors:door2a 1	
same recipe	my_future_doors:door7a 1	my_future_doors:door6a 1	
same recipe	my_misc_doors:door2a 1	my_future_doors:door6a 1	
same recipe	doors:door_steel	ts_doors:door_default_steelblock	
same recipe	dye:blue 1	dye:blue 4	
same recipe	cottages:hammer	default:sign_wall_steel 3	
same recipe	ts_doors:trapdoor_moretrees_palm_planks	xdecor:workbench	
same recipe	ts_doors:trapdoor_moretrees_apple_tree_planks	xdecor:workbench	
same recipe	ts_doors:trapdoor_moretrees_willow_planks	xdecor:workbench	
same recipe	building_blocks:hardwood 2	xdecor:workbench	
same recipe	building_blocks:hardwood 2	xdecor:workbench	
same recipe	ts_doors:trapdoor_default_wood	xdecor:workbench	
same recipe	my_future_doors:door7a 1	my_future_doors:door2a 1	
same recipe	my_misc_doors:door2a 1	my_future_doors:door2a 1	
same recipe	my_future_doors:door6a 1	my_future_doors:door2a 1	
same recipe	xdecor:workbench	ts_doors:trapdoor_default_pine_wood	
same recipe	xdecor:workbench	ts_doors:trapdoor_moretrees_oak_planks	
same recipe	cottages:straw_mat 3	cottages:straw	
same recipe	xdecor:woodframed_glass	cottages:glass_pane 4	
same recipe	moreblocks:stone_tile 4	xdecor:stone_tile 2	
same recipe	my_future_doors:door7a 1	my_future_doors:door8a 1	
same recipe	my_misc_doors:door2a 1	my_future_doors:door8a 1	
same recipe	my_future_doors:door6a 1	my_future_doors:door8a 1	
same recipe	my_future_doors:door2a 1	my_future_doors:door8a 1	
same recipe	xdecor:workbench	ts_doors:trapdoor_moretrees_spruce_planks	
same recipe	xdecor:workbench	ts_doors:trapdoor_moretrees_sequoia_planks	
same recipe	default:desert_stone 2	default:sandstone	
same recipe	xdecor:workbench	ts_doors:trapdoor_default_aspen_wood	
same recipe	dye:orange 1	dye:orange 4	
same recipe	xdecor:workbench	ts_doors:trapdoor_moretrees_beech_planks	
same recipe	ts_furniture:moretrees_rubber_tree_planks_chair	homedecor:chair 2	
same recipe	ts_furniture:moretrees_spruce_planks_chair	homedecor:chair 2	
same recipe	ts_furniture:moretrees_birch_planks_chair	homedecor:chair 2	
same recipe	ts_furniture:moretrees_oak_planks_chair	homedecor:chair 2	
same recipe	ts_furniture:moretrees_sequoia_planks_chair	homedecor:chair 2	
same recipe	ts_furniture:moretrees_beech_planks_chair	homedecor:chair 2	
same recipe	ts_furniture:moretrees_fir_planks_small_table	homedecor:table	
same recipe	ts_furniture:moretrees_sequoia_planks_small_table	homedecor:table	
same recipe	ts_furniture:default_wood_small_table	homedecor:table	
same recipe	ts_furniture:moretrees_apple_tree_planks_small_table	homedecor:table	
same recipe	ts_furniture:default_aspen_wood_small_table	homedecor:table	
same recipe	ts_furniture:moretrees_palm_planks_small_table	homedecor:table	
same recipe	ts_furniture:moretrees_spruce_planks_small_table	homedecor:table	
same recipe	ts_furniture:moretrees_beech_planks_small_table	homedecor:table	
same recipe	ts_furniture:default_acacia_wood_small_table	homedecor:table	
same recipe	ts_furniture:moretrees_birch_planks_small_table	homedecor:table	
same recipe	moreores:mithril_ingot 9	cannons:ball_mithril	
same recipe	homedecor:table	ts_furniture:moretrees_willow_planks_small_table	
same recipe	xdecor:tatami	homedecor:tatami_mat	
same recipe	ts_doors:door_locked_default_aspen_wood	homedecor:door_wood_plain_left 2	
same recipe	ts_doors:door_locked_moretrees_palm_planks	homedecor:door_wood_plain_left 2	
same recipe	ts_doors:door_locked_default_wood	homedecor:door_wood_plain_left 2	
same recipe	ts_doors:door_locked_default_pine_wood	homedecor:door_wood_plain_left 2	
same recipe	ts_doors:door_locked_default_junglewood	homedecor:door_wood_plain_left 2	
same recipe	ts_doors:door_locked_moretrees_willow_planks	homedecor:door_wood_plain_left 2	
same recipe	ts_doors:door_locked_moretrees_sequoia_planks	homedecor:door_wood_plain_left 2	
same recipe	ts_doors:door_locked_moretrees_spruce_planks	homedecor:door_wood_plain_left 2	
same recipe	ts_doors:door_locked_moretrees_birch_planks	homedecor:door_wood_plain_left 2	
same recipe	ts_doors:door_locked_default_acacia_wood	homedecor:door_wood_plain_left 2	
same recipe	ts_doors:door_locked_moretrees_oak_planks	homedecor:door_wood_plain_left 2	
same recipe	homedecor:chair 2	ts_furniture:moretrees_apple_tree_planks_chair	
same recipe	homedecor:table	ts_furniture:moretrees_oak_planks_small_table	
same recipe	homedecor:chair 2	ts_furniture:default_aspen_wood_chair	
same recipe	homedecor:table	ts_furniture:default_pine_wood_small_table	
same recipe	homedecor:door_wood_plain_left 2	ts_doors:door_locked_moretrees_rubber_tree_planks	
same recipe	boats:boat	vehicle_mash:rowboat	
same recipe	homedecor:chair 2	ts_furniture:moretrees_palm_planks_chair	
same recipe	dye:green 1	dye:green 4	
same recipe	xdecor:rope	castle:ropes	
same recipe	moreblocks:circle_stone_bricks 8	xdecor:stone_rune 4	
same recipe	default:paper 4	default:paper	
same recipe	homedecor:chair 2	ts_furniture:default_junglewood_chair	
same recipe	dye:yellow 1	dye:yellow 4	
same recipe	homedecor:chair 2	ts_furniture:moretrees_fir_planks_chair	
same recipe	homedecor:chair 2	ts_furniture:default_acacia_wood_chair	
same recipe	darkage:stone_brick 9	moreblocks:cobble_compressed	
same recipe	my_castle_doors:door4 1	my_castle_doors:door11 1	
same recipe	homedecor:chair 2	ts_furniture:default_pine_wood_chair	
same recipe	xpanes:jailbars 16	currency:safe	
same recipe	dye:red 1	dye:red 4	
same recipe	homedecor:chair 2	ts_furniture:moretrees_willow_planks_chair	
same recipe	xdecor:workbench	ts_doors:trapdoor_default_junglewood	
same recipe	castle:crossbow_bolt 6	throwing:arrow 16	
same recipe	homedecor:chair 2	ts_furniture:default_wood_chair	
same recipe	my_future_doors:door7a 1	my_future_doors:door9a 1	
same recipe	my_misc_doors:door2a 1	my_future_doors:door9a 1	
same recipe	my_future_doors:door6a 1	my_future_doors:door9a 1	
same recipe	my_future_doors:door2a 1	my_future_doors:door9a 1	
same recipe	my_future_doors:door8a 1	my_future_doors:door9a 1	
same recipe	my_future_doors:door7a 1	my_future_doors:door4a 1	
same recipe	my_misc_doors:door2a 1	my_future_doors:door4a 1	
same recipe	my_future_doors:door6a 1	my_future_doors:door4a 1	
same recipe	my_future_doors:door2a 1	my_future_doors:door4a 1	
same recipe	my_future_doors:door8a 1	my_future_doors:door4a 1	
same recipe	my_future_doors:door9a 1	my_future_doors:door4a 1	
same recipe	xdecor:workbench	ts_doors:trapdoor_moretrees_fir_planks	
same recipe	xdecor:bowl 3	trunks:twigs_roof_corner_2 8	
same recipe	homedecor:table	ts_furniture:default_junglewood_small_table	
same recipe	my_future_doors:door7a 1	my_future_doors:door3a 1	
same recipe	my_misc_doors:door2a 1	my_future_doors:door3a 1	
same recipe	my_future_doors:door6a 1	my_future_doors:door3a 1	
same recipe	my_future_doors:door2a 1	my_future_doors:door3a 1	
same recipe	my_future_doors:door8a 1	my_future_doors:door3a 1	
same recipe	my_future_doors:door9a 1	my_future_doors:door3a 1	
same recipe	my_future_doors:door4a 1	my_future_doors:door3a 1	
same recipe	cottages:anvil	castle:anvil	
same recipe	xdecor:workbench	ts_doors:trapdoor_default_acacia_wood	
same recipe	ts_doors:trapdoor_default_steelblock	doors:trapdoor_steel	
same recipe	default:stick 4	trunks:twig_1 3	
same recipe	default:stick 4	trunks:twig_1 3	
same recipe	default:stick 4	trunks:twig_1 4	
same recipe	default:stick 4	trunks:twig_1 4	
same recipe	default:stick 4	trunks:twig_1 8	
same recipe	moretrees:palm_leaves	trunks:twig_1 2	
same recipe	moresnow:autumnleaves 9	trunks:twig_1 2	
same recipe	moreblocks:circle_stone_bricks 8	default:furnace	
same recipe	xdecor:stone_rune 4	default:furnace	
same recipe	mobs:cobweb	xdecor:cobweb	
same recipe	homedecor:cobweb_corner 5	xdecor:cobweb	
same recipe	xdecor:workbench	ts_doors:trapdoor_moretrees_birch_planks	
same recipe	ts_doors:trapdoor_locked_default_steelblock	ts_doors:trapdoor_full_default_steelblock	
same recipe	xdecor:workbench	ts_doors:trapdoor_moretrees_rubber_tree_planks	
same recipe	xdecor:itemframe	itemframes:frame	
same recipe	homedecor:door_wood_plain_left 2	ts_doors:door_locked_moretrees_fir_planks	
same recipe	default:wood	default:junglewood	
same recipe	mesecons_luacontroller:luacontroller0000 2	craft "mesecons_microcontroller:microcontroller0000" 2	
same recipe	ts_doors:door_default_pine_wood	doors:door_wood	
same recipe	ts_doors:door_moretrees_spruce_planks	doors:door_wood	
same recipe	ts_doors:door_default_wood	doors:door_wood	
same recipe	ts_doors:door_moretrees_oak_planks	doors:door_wood	
same recipe	ts_doors:door_moretrees_birch_planks	doors:door_wood	
same recipe	ts_doors:door_default_aspen_wood	doors:door_wood	
same recipe	ts_doors:door_moretrees_beech_planks	doors:door_wood	
same recipe	ts_doors:door_moretrees_apple_tree_planks	doors:door_wood	
same recipe	ts_doors:door_moretrees_sequoia_planks	doors:door_wood	
same recipe	ts_doors:door_moretrees_palm_planks	doors:door_wood	
same recipe	ts_doors:door_default_junglewood	doors:door_wood	
same recipe	ts_doors:door_moretrees_fir_planks	doors:door_wood	
same recipe	ts_doors:door_moretrees_willow_planks	doors:door_wood	
same recipe	ts_doors:door_default_acacia_wood	doors:door_wood	
same recipe	castle:hole_cobble 4	"firestone:chimney" 4	
same recipe	homedecor:door_wood_plain_left 2	ts_doors:door_locked_moretrees_apple_tree_planks	
same recipe	default:ladder_steel 15	jetpack:jetpack_base	
same recipe	homedecor:table	ts_furniture:moretrees_rubber_tree_planks_small_table	
same recipe	cottages:reet	dryplants:wetreed 2	
same recipe	homedecor:door_wood_plain_left 2	ts_doors:door_locked_moretrees_beech_planks	
same recipe	doors:door_wood	ts_doors:door_moretrees_rubber_tree_planks	
same recipe	dye:white 1	dye:white 4	
A new good example is the first one in the list: default:ladder vs. default:ladder_wood. Both in "default" namespace. You need to grep the game directory to find out the default:ladder is defined in moreblocks/redefinitions.lua. The ladder_wood is the one from default. The right way for me is the moreblocks-project defines moreblocks:ladder, maybe as "enhance_item" from the default one. Maybe as is and the game/modpack developer set the dependency using merge_loaded_items. Maybe the best way is to search for the same recipes (as uniqie key) and merge the found items by default. Of course with a big warning in the debug-log.

User avatar
rubenwardy
Moderator
Posts: 6374
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: United Kingdom
Contact:

Re: Check overlaps of recipes in mods (using new tool: qa_bl

by rubenwardy » Post

The food mod's way solves the cobweb problem

bell07
Member
Posts: 599
Joined: Sun Sep 04, 2016 15:15
GitHub: bell07

Re: Check overlaps of recipes in mods (using new tool: qa_bl

by bell07 » Post

Can you please explain how the food-mod-way can solve the cobweb problem? There is no group, for the one mod it is just a spider-product, for the other a decorative medieval thing, for the third one it is a resource to get cottons. And I need a medieval-decorative-spider-product-as-cottons-ressource if I use all 3 mods.

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

Re: Check overlaps of recipes in mods (using new tool: qa_bl

by Wuzzy » Post

same recipe ts_doors:door_default_pine_wood doors:door_wood
same recipe ts_doors:door_moretrees_spruce_planks doors:door_wood
same recipe ts_doors:door_default_wood doors:door_wood
same recipe ts_doors:door_moretrees_oak_planks doors:door_wood
same recipe ts_doors:door_moretrees_birch_planks doors:door_wood
same recipe ts_doors:door_default_aspen_wood doors:door_wood
same recipe ts_doors:door_moretrees_beech_planks doors:door_wood
same recipe ts_doors:door_moretrees_apple_tree_planks doors:door_wood
same recipe ts_doors:door_moretrees_sequoia_planks doors:door_wood
same recipe ts_doors:door_moretrees_palm_planks doors:door_wood
same recipe ts_doors:door_default_junglewood doors:door_wood
same recipe ts_doors:door_moretrees_fir_planks doors:door_wood
same recipe ts_doors:door_moretrees_willow_planks doors:door_wood
same recipe ts_doors:door_default_acacia_wood doors:door_wood
Note that this is NOT a direct collision. doors:door_wood is crafted from 6 items from group:wood, while the ts_doors are crafted from a specific type of wood. In Minetest, if there is a collision between a group craft and a specific craft, the specific craft takes precedence. So I think this kind of “collision” is actually a good thing and should be kept. We could see the default door as some kind of “falback” door. It is useful if you do not have 6 times the same wood.
A new good example is the first one in the list: default:ladder vs. default:ladder_wood. Both in "default" namespace.
Note that default:ladder is an alias to default:ladder_wood.
You need to grep the game directory to find out the default:ladder is defined in moreblocks/redefinitions.lua
This seems impossible. AFAIK Minetest does not allow you to register anything with a foreign mod name, e.g. you can not register a node called “example17:node” in the mod “example44”.
My creations. I gladly accept bitcoins: 17fsUywHxeMHKG41UFfu34F1rAxZcrVoqH

bell07
Member
Posts: 599
Joined: Sun Sep 04, 2016 15:15
GitHub: bell07

Re: Check overlaps of recipes in mods (using new tool: qa_bl

by bell07 » Post

Ok, I need to enhance my script to respect "good overlaps" as "redefinitions" and do not report them (Now I search for a programmable definition what a "good overlap" is). To be proper, is there a way to remove the overridden definition (node, item, craft...) that was previous registered in an other "original" mod? For a proper redefinition there should be a way to remove the redefined things like the doors:door_wood and his "group" recipe (useful or not, is there a way?).
Note that default:ladder is an alias to default:ladder_wood.
I did not seen them. The script does not read aliases currently. But "default:ladder_wood 4" vs. "default:ladder_wood 3" do even less sense.
AFAIK Minetest does not allow you to register anything with a foreign mod name
That is a good thing the minetest does the namespace check. But the check is incomplete. In moreblocks the item is not overridden, but a receipt is defined for a foreign item.

User avatar
rubenwardy
Moderator
Posts: 6374
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: United Kingdom
Contact:

Re: Check overlaps of recipes in mods (using new tool: qa_bl

by rubenwardy » Post

Food has a list of mods that provide ingredients. For each possible provider, it checks if it exists and if so adds a group to the item definition to be used by crafting, say "food_egg". If no providers are installed, then it registers a fallback item which has the food_egg group.

IMO, the above functionality should be made more default, more part of the engine.

With this, there is of course the issue of circular dependency. But this can be solved by having newer mods check for ingredients from older mods and using those. Issues of slightly differing functionality and attainment (craft tree to get the item) still remain, but are hard to solve (ie: easier to get cobwebs in A than B) - but at this point I think it's up to sub games to balance the recipes correctly, given that you can't expect bundling a random bunch of mods together to be balanced, that's up to game designers.

It's not currently easy for third party mods to solve this. The best way is to delete two of the items, and alias to the remaining one. This way craft recipes using each cobweb will work, but you may then end up with multiple recipes to get the cobwebs (left over from each of the mods). I'm not sure if it's been merged, but you can delete recipes using minetest.clear_craft().

----------

It is possible for example44 to register example17:node by doing:

Code: Select all

minetest.register_node(":example17:node", {
    --
})
Note the use of the override character ":"

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

Re: Check overlaps of recipes in mods (using new tool: qa_bl

by Wuzzy » Post

Note: I recently posted a pull request for ts_doors to fix integration with the default doors and to clean up the crafting recipe mess:
https://github.com/minetest-mods/ts_doors/pull/2

Note 2: The next version of Minetest after 0.4.14 will have a function called “minetest.clear_craft” which can be used to remove crafting recipes matching a given output or input. Very useful!


As for “useful overlaps”: I suggest to keep it simple for now. Simply check if the strings in the item slots are equal.
Thies means: For “group:” items, this only checks if they collide with the same “group:”, but not with the particular members of the group. Example: “group:wood” only collides with “group:wood” (exactly spelled out like this in the definition), but not with “default:wood”. Thus, a “group:wood” door does not create a warning with a “default:wood” door. Or MAYBE you could just add a “notice” instead of a warning.
My creations. I gladly accept bitcoins: 17fsUywHxeMHKG41UFfu34F1rAxZcrVoqH

bell07
Member
Posts: 599
Joined: Sun Sep 04, 2016 15:15
GitHub: bell07

Re: Check overlaps of recipes in mods (using new tool: qa_bl

by bell07 » Post

that's it why I like open source and this project! while the newcomer think about things the pro's are doing them! Thanks Wuzzy that you started immediately to fix the bug in the ts_doors. Each found bug is a good bug because of can be fixed.
I see in core upstream by coincidence the "Add minetest.unregister_item and minetest.register_alias_force" commit (https://github.com/minetest/minetest/co ... 6adfd2d97f) that allow to solve the "cobweb-problem" in the way I proposed. In parallel I see in forum [mod]Lua Entities Overrider [WIP][entity_override] (viewtopic.php?f=9&t=15518) a try to solve related problems in a better way.

I continue to stay tuned confidently, see the problems I seen should be solved in the next time

bell07
Member
Posts: 599
Joined: Sun Sep 04, 2016 15:15
GitHub: bell07

Re: Check overlaps of recipes in mods (using new tool: qa_bl

by bell07 » Post

An update: I disabled the group check by default and added a module dependency check, enabled by default. The module dependency check allow redefinitions if the mods have a dependency. As the sample the

Code: Select all

ts_doors:trapdoor_default_steelblock	doors:trapdoor_steel
is now a false-positive trough the check and not displayed. The "ts_doors" have the "doors" as dependency so the check assume it is a wanted/usefull overlap/redefinition.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest