Universal naming convention for nodes?

User avatar
sorcerykid
Member
 
Posts: 219
Joined: Fri Aug 26, 2016 15:36
In-game: Nemo

Universal naming convention for nodes?

by sorcerykid » Thu Dec 08, 2016 17:01

For some reason nodes in minetest_game do not seem to follow any universal naming convention.

  • Consider default:sandstone_block vs default:sandstonebrick.
    There is a space before block, but never before brick.

  • Consider default:steelblock vs default:stone_block.
    Except for metals and snow, then there isn't a space before block.

  • Consider default:junglewood vs default:acacia_wood.
    There is always a space before wood, leaves, tree, and sapling, unless it's jungle.

  • Consider default:obsidian_block vs default:brick.
    Blocks are always referenced as blocks, except for brick blocks.

The best I can surmise is that node names are continuously improvised due to so many different contributions and no formal specification from an early stage of development. Are there any plans at all to resolve these glaring inconsistencies?
 

User avatar
ExeterDad
Member
 
Posts: 1121
Joined: Sun Jun 01, 2014 20:00
In-game: ExeterDad

Re: Universal naming convention for nodes?

by ExeterDad » Thu Dec 08, 2016 19:43

You are correct. So confusing. Even frustrating when using /giveme and you can't seem to figure out the correct name of the node.

Submit pull request(s) on github and help to get it sorted out. Just remember when changing names of nodes that have been in use for so long, mods will breaks unless aliases are added as well.
٩(̾●̮̮̃̾•̃̾)۶

Kibbie and I have a beautiful public server now! HOMETOWN
 

User avatar
Napiophelios
Member
 
Posts: 752
Joined: Mon Jul 07, 2014 01:14
GitHub: Napiophelios
IRC: Nappi
In-game: Nappi

Re: Universal naming convention for nodes?

by Napiophelios » Thu Dec 08, 2016 19:54

All new nodes must use the naming convention,
the inconsistencies are older nodes that remain so as not to break things.
At least,I think that's why they remain.

--mods/default/nodes.lua

Node name convention:

Although many node names are in combined-word form, the required form for new
node names is words separated by underscores. If both forms are used in written
language (for example pinewood and pine wood) the underscore form should be used.

 

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

Re: Universal naming convention for nodes?

by Wuzzy » Tue Jan 03, 2017 17:12

It is not always unproblematic to change the itemstrings of items, but you can often define aliases. Still, I would be careful with changing itemstrings after they have been defined. Usually, you should stick with an itemstring as soon it is defined. I always see itemstrings as something internal and think of /give and /giveme as hacks when the subgame lacks a creative inventory. The proper way to get items is the creative inventory; the user should never be forced to use /give and /giveme for mundane items, only for special stuff like farming:wheat_5.

What I am much more concerned about are the actual item names, i.e. the “description”, the text you see in the tooltip. Because these are the texts the players will be much more often exposed to. I think these “real” item names must be perfect and to the point, modders should not be clumsy at item naming. But luckily, it is very safe to change those.

But yeah, I still think establishing a naming convention can't hurt. Both for itemstrings and for the “real” names (“description”). And it should be written right into lua_api.txt. This should not be a Minetest Game-only thing. Of course, those are just conventions and can be ignored, but at least modders then have a base to start from.

It's bad if multiple mods have different capitalization rules for the item description. Minetest Game often (not always) capitalizes each word (which I think is stupid), but other mods don't. I dislike this inconsistency. But I am guilty of this, too. Mostly because I hate the Capitalize Every Word dogma (I think it is grammatically wrong, as the “description” is usually not a proper name or a title). But there's no naming convention in place, so …

Another inconsistency I see is that some mods even add a little help text into this “real” item name. See screwdriver or cart in Minetest Game. I think this is wrong as this makes the field “description” non-atomic. It conflates an item NAME (“screwdriver”) with its EXPLANATION (“left click to rotate (…)”). This is bad because many mods use the “description” field for more than just the tooltip, in which the help text would be inappropriate, like the hotbar item name overlay used in the Unified Inventory. It should just say “Screwdriver” and not “Screwdriver (left click to (…))”.
Instead, there should be separate fields for separate data points. It would be nice if Minetest supports better support to enhance tooltips with more information (WITHOUT cramming everything into the “description” field); I think this would be very crucial feature.
I'm creating MineClone 2, a Minecraft clone for Minetest.
I made the Help modpack, adding in-game help to Minetest.
 


Return to Minetest Features

Who is online

Users browsing this forum: No registered users and 36 guests

cron