I'm shocked, The Samz uses a 2x2 crafter grid. And with the default one, 3x3, I never realized that the recipes were shaped with respect to the ingredients, not with respect to the grid. That is:
"item1", ""
"", ""
performs the same crafting as:
"", "item1"
"", ""
and that
"", ""
"", "item1"
etc.
I would like it to be shaped with respect to the grid itself.
Crafting Recipes
Re: Crafting Recipes
Why don't you just implement a crafting system by yourself. To me it is outrageous that the default crafting system is still hard coded in C++ and there is no standard api to register other crafting types besides normal, cooking and fuel. Instead mods do implement their own function like technic does it with grinding and alloying.
Can your read this?
Re: Crafting Recipes
I did for my old brewing mod. Maybe I will do for The Samz. Maybe for specific mechanics, maybe for default crafting system.cx384 wrote: ↑Tue Dec 06, 2022 12:48Why don't you just implement a crafting system by yourself. To me it is outrageous that the default crafting system is still hard coded in C++ and there is no standard api to register other crafting types besides normal, cooking and fuel. Instead mods do implement their own function like technic does it with grinding and alloying.
The problem is:
1) My time is limited.
2) Minetest is an engine, isn't it. So basic functions should be provided as it.
3) C is faster than lua, and search and match thru listings is time expensive.
Re: Crafting Recipes
It is not that time expensive for a fixed 3x3 grid.
For n crafting recipes a simple (not optimised) algorithms would take O(n*9). (For shapeless about O(n*45))
However with optimizations it may only take logarithmic time.
Can your read this?
- LMD
- Member
- Posts: 1397
- Joined: Sat Apr 08, 2017 08:16
- GitHub: appgurueu
- IRC: appguru[eu]
- In-game: LMD
- Location: Germany
- Contact:
Re: Crafting Recipes
As long as groups aren't involved, you can just hash the m*m grid and look for it in a table of hashed grids. This gives you O(m*m), which will in practice be very performant (as m is rather small).
As soon as groups and shapeless crafts get involved, it gets tricky though.
Re: Crafting Recipes
I've investigated further and Minecraft has the same crafting system.
Who is online
Users browsing this forum: Ahrefs [Bot] and 27 guests