Suggestion: custom "crafting definition types"

Post Reply
User avatar
SegFault22
Member
Posts: 870
Joined: Mon May 21, 2012 03:17
Location: NaN

Suggestion: custom "crafting definition types"

by SegFault22 » Post

Currently there are only 5 crafting definition types. One of those types can be used by a machine, and that is "cooking". However, when we want to add our own types, like "smelting" for example, we run into an issue: the 5 crafting definition types are directly defined within the Engine, and thus we can not define a machine as using, or a recipe as being, anything other than those 5 types.
This is a serious problem, and turns a simple, elegant script into horrible hackwork to tell the machine what it does, and registering recipes. I propose a solution, where crafting definition types can be created, through either of two ways:

1. Crafting Definition Types could be registered - this would require more code than the next method, but it would be possible to tell Minetest how many inputs/outputs there would be, in the registry for a type.

2. The types could be registered similarly to how Groups are. This would work nearly identical to Groups - only the recipes of a specific type, like "cooking", would work in a machine that does that type. However, there would not be any place where the type is directly registered, just like groups (whenever a new type is encountered, it is added to the table, or however groups work).

This would make it possible for modders to easily add new machines that do things that the furnace just can't/shouldn't do, without having to add several dozen lines of horrible hackwork just to accomplish the addition of a machine and its own recipes.
Thank you for your consideration.
Resources are abundant; only money is scarce. People should not have to work hard and remain poor just to pay for the needs of survival.
Society can thrive without money - but only if productive members of society are rewarded for being productive.

mauvebic
Member
Posts: 1550
Joined: Fri Jan 27, 2012 11:32

by mauvebic » Post

SegFault22 wrote:However, when we want to add our own types, like "smelting [snip] and turns a simple, elegant script into horrible hackwork to tell the machine what it does
I didn't have that problem, i simply used tables (SMELTING[input] = output), and my own craft guide works just as well checking regular and custom crafts. It may actually be more work for core devs to implement this idea.

User avatar
tinoesroho
Member
Posts: 570
Joined: Fri Feb 17, 2012 21:55
Location: Canada

by tinoesroho » Post

We are what we create.

I tinker and occasionally make (lousy) mods. Currently building an MMO subgame and updating mods. Pirate Party of Canada member. Sporadic author. 21 years old.

My github:
https://github.com/tinoesroho/

User avatar
SegFault22
Member
Posts: 870
Joined: Mon May 21, 2012 03:17
Location: NaN

by SegFault22 » Post

mauvebic wrote:
SegFault22 wrote:However, when we want to add our own types, like "smelting [snip] and turns a simple, elegant script into horrible hackwork to tell the machine what it does
I didn't have that problem, i simply used tables (SMELTING[input] = output), and my own craft guide works just as well checking regular and custom crafts. It may actually be more work for core devs to implement this idea.
It is much more efficient, for the developers to do the hard work once, than many people having to implement the functionality of their own tables and usage of said tables. It will also attract those who have creative, good ideas, but are not good at programming in LUA - who will be inclined to make their own mod adding their ideal features, rather than to go suggest it to someone who has mastered LUA, who will likely steer the ideal features in a direction that the original thinker never intended.

@"TakeThat"-Guy: Even PilzAdam suggested, to the creator of that mod, that it should be added to the engine. See This Post for more information.
Others on the Minetest IRC channel agree too, that it would be a good idea (see the logs, starting Here).
Last edited by SegFault22 on Wed Nov 13, 2013 21:35, edited 1 time in total.
Resources are abundant; only money is scarce. People should not have to work hard and remain poor just to pay for the needs of survival.
Society can thrive without money - but only if productive members of society are rewarded for being productive.

mauvebic
Member
Posts: 1550
Joined: Fri Jan 27, 2012 11:32

by mauvebic » Post

I don't really see what the big challenge is, there are already plenty of mods with a ton a custom machines that produce all sorts of things. If some people can't figure it out looking at that code or the furnace code in default, then i can't picture how new craft types make their jobs any easier.

In any case, why not just use the mod tinoesroho referenced?

User avatar
SegFault22
Member
Posts: 870
Joined: Mon May 21, 2012 03:17
Location: NaN

by SegFault22 » Post

mauvebic wrote:I don't really see what the big challenge is, there are already plenty of mods with a ton a custom machines that produce all sorts of things. If some people can't figure it out looking at that code or the furnace code in default, then i can't picture how new craft types make their jobs any easier.

In any case, why not just use the mod tinoesroho referenced?
It's not about new craft types, it's about allowing Any conceivable type to be registered. People could literally look at, or even copy, code from the furnace to make a new machine, if the change was made. Currently, that is not possible, because when you try to use a type that doesn't exist in the Engine, it causes an error that prevents the loading of Minetest and the mods.
We could use the mod that @TakeThatGuy mentioned, but that is only a temporary fix. What would be best, would be for the developers to make the necessary changes to the engine once, rather than an undefined number of modders having to substitute said necessary changes with their own horrible hackwork or some other mod, and said changes having to occur once for every mod that needs to add its own crafting definition types.
Resources are abundant; only money is scarce. People should not have to work hard and remain poor just to pay for the needs of survival.
Society can thrive without money - but only if productive members of society are rewarded for being productive.

Sokomine
Member
Posts: 4184
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine

by Sokomine » Post

SegFault22 wrote: [...]People could literally look at, or even copy, code from the furnace to make a new machine[...]
That sounds like a very bad idea. Copying the whole furnace code for a new machine would result in endless copies that vary minimally from each other. There ought to be some register_furnace function or something like that first.

I like the idea of having "machines" for more complex crafts (see my table saw or color machine for that), but the very idea behind these is that you don't have to remember the crafting receipe - instead, you put your materials in the machine and get the desired output out.
A list of my mods can be found here.

User avatar
SegFault22
Member
Posts: 870
Joined: Mon May 21, 2012 03:17
Location: NaN

by SegFault22 » Post

Sokomine wrote: That sounds like a very bad idea. Copying the whole furnace code for a new machine would result in endless copies that vary minimally from each other. There ought to be some register_furnace function or something like that first.
I meant, copying part of the code and changing the parameters to fit one's needs, just like what people do with block/item/ore registry when they don't want to learn all of LUA and the API.
Resources are abundant; only money is scarce. People should not have to work hard and remain poor just to pay for the needs of survival.
Society can thrive without money - but only if productive members of society are rewarded for being productive.

User avatar
tinoesroho
Member
Posts: 570
Joined: Fri Feb 17, 2012 21:55
Location: Canada

by tinoesroho » Post

Sokomine wrote:
SegFault22 wrote: [...]People could literally look at, or even copy, code from the furnace to make a new machine[...]
That sounds like a very bad idea. Copying the whole furnace code for a new machine would result in endless copies that vary minimally from each other. There ought to be some register_furnace function or something like that first.

I like the idea of having "machines" for more complex crafts (see my table saw or color machine for that), but the very idea behind these is that you don't have to remember the crafting receipe - instead, you put your materials in the machine and get the desired output out.
Ehh. I think there's a smelting mod, and a morefurnaces mod. In the minetest_game core, there should be a framework to register furnaces. I'm against arbitrarily adding code to the engine, but adding to minetest_game? Why not?

@SegFault:
... Um. So you're saying that the mod could work? And that it should be added to minetest_game?
We are what we create.

I tinker and occasionally make (lousy) mods. Currently building an MMO subgame and updating mods. Pirate Party of Canada member. Sporadic author. 21 years old.

My github:
https://github.com/tinoesroho/

User avatar
tinoesroho
Member
Posts: 570
Joined: Fri Feb 17, 2012 21:55
Location: Canada

by tinoesroho » Post

Sokomine wrote: That sounds like a very bad idea. Copying the whole furnace code for a new machine would result in endless copies that vary minimally from each other. There ought to be some register_furnace function or something like that first.

I like the idea of having "machines" for more complex crafts (see my table saw or color machine for that), but the very idea behind these is that you don't have to remember the crafting receipe - instead, you put your materials in the machine and get the desired output out.
Yoohoo!

I replaced normal furnaces with an "autofurnace" for carts back in the day. Horrible, horrible, horrible. I didn't understand the code, which is why I couldn't have both. :-(
We are what we create.

I tinker and occasionally make (lousy) mods. Currently building an MMO subgame and updating mods. Pirate Party of Canada member. Sporadic author. 21 years old.

My github:
https://github.com/tinoesroho/

User avatar
SegFault22
Member
Posts: 870
Joined: Mon May 21, 2012 03:17
Location: NaN

by SegFault22 » Post

tinoesroho wrote: @SegFault:
... Um. So you're saying that the mod could work? And that it should be added to minetest_game?
No, I am saying that if someone wants to make a simple, input+fuel=output machine, they could re-purpose furnace code to achieve that, but they would have to use the cooking/fuel crafting def. types. With the proposed changes, more crafting def. types would be possible, so the user could make many different machines with many different purposes.
Resources are abundant; only money is scarce. People should not have to work hard and remain poor just to pay for the needs of survival.
Society can thrive without money - but only if productive members of society are rewarded for being productive.

User avatar
Dopium
Member
Posts: 233
Joined: Sat Jun 09, 2012 15:43
Location: Australia

by Dopium » Post

I think what SegFault22 is trying to say is if someone were to make a blast freezer mod or something they would still have to use the cooking/fuel def.types. A blast freezer does not cook but rather does the opposite or the unit may not need a fuel type to function ect.
Running @1.19 MHz, 128 bytes of RAM and interchangeable 4kb ROM carts!

User avatar
SegFault22
Member
Posts: 870
Joined: Mon May 21, 2012 03:17
Location: NaN

by SegFault22 » Post

Dopium wrote:I think what SegFault22 is trying to say is if someone were to make a blast freezer mod or something they would still have to use the cooking/fuel def.types. A blast freezer does not cook but rather does the opposite or the unit may not need a fuel type to function ect.
Exactly. If we were able to register our own crafting definition types, that would be possible, but currently we can't, so it is not possible. In fact, the mod I am working on will someday require a cooling machine of sorts to cool items, without the use of coal or the ability to freeze copper lumps into ingots.
Tables might not work for this, because the parameters of some things (burntime for fuels, for example) don't fit into the standard tables like in the Crafter mod. Thus, using the crafter mod does Not work, nor will it work if it is moved straight to minetest_game.
Due to issues with the crafter mod not functioning properly, I had to disable loading of my mod's "machine" segment until further notice.
Last edited by SegFault22 on Sat Nov 16, 2013 17:24, edited 1 time in total.
Resources are abundant; only money is scarce. People should not have to work hard and remain poor just to pay for the needs of survival.
Society can thrive without money - but only if productive members of society are rewarded for being productive.

Nore
Developer
Posts: 501
Joined: Wed Nov 28, 2012 11:35
GitHub: Ekdohibs

by Nore » Post

It looks like my post has disapeared, but I made something a bit earlier that allowed custom crafting definition types: viewtopic.php?id=5739. However, I don't know if it is exactly what you want, or not...

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

by Wuzzy » Post

I just wanted to say that I like the suggestion. The idea seems general enough to justify an engine change. I think the “horrible hackwork” argument is a pretty strong argument. ;-)
My creations. I gladly accept bitcoins: 17fsUywHxeMHKG41UFfu34F1rAxZcrVoqH

User avatar
SegFault22
Member
Posts: 870
Joined: Mon May 21, 2012 03:17
Location: NaN

by SegFault22 » Post

Wuzzy wrote:I just wanted to say that I like the suggestion. The idea seems general enough to justify an engine change. I think the “horrible hackwork” argument is a pretty strong argument. ;-)
Thank you for the support, comrade.
About horrible hackwork: Even with the use of the "Crafter" mod, it is not possible to make recipes wider than 2x2, either they will cause a crash, or will not do anything, depending on either width or height being greater than 2. With the proposed change, we would be able to define the exact shape of our recipe, and machines would work with bigger recipes.
Resources are abundant; only money is scarce. People should not have to work hard and remain poor just to pay for the needs of survival.
Society can thrive without money - but only if productive members of society are rewarded for being productive.

User avatar
Enke
Member
Posts: 469
Joined: Fri Nov 15, 2013 02:56
GitHub: NANOsoldierEnke
IRC: Enke
In-game: Enke
Location: The internet

by Enke » Post

We need something like this. It could open a new world of possible mods to be made. It would also give another distinguishing feature that we could call our own.
Lush8
ExtraVars for Red Eclipse

<Anarchid> my turn was still the most awesome, yielding all the cripples, two captured paranormals, and death rate of about 30%
<ORCACommander> Anarchid: you need to work harder
<ORCACommander> I am hereby putting you under review until you can increase the casualty rate

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests