[Mod] lib_node_shapes [lib_node_shapes]

ShadMOrdre
Member
 
Posts: 135
Joined: Mon Dec 29, 2014 08:07
Location: USA
In-game: shadmordre

[Mod] lib_node_shapes [lib_node_shapes]

by ShadMOrdre » Thu Feb 23, 2017 22:58

Introducing lib_node_shapes.

This mod provides a multitude of nodebox shapes that can be applied to most "material" type nodes, (stone, metal, tree, wood, and glass). Among the shapes included are columns, walls, fences, gates, doors, furniture, trees, religious symbols, lights, and various other general shapes. Shapes are broken into individual mods within the modpack, so users can easily browse and experiment with limited shapes installed. This is useful if users play with many mods.

Doors, gates, lights and chairs work as expected, with the exception that doors and gates are currently not lockable.

There are currently shapes included that are commented out in the code, to also provide a limit to the number of nodes that are or can be generated. As such, a template is provided that allows an easy to use way to quickly adding additional node box shapes.

To use a given shape, simply place the shape node in the center of the craft grid, and place the "materials" node directly below, in the center of the bottom row. Shape nodes are the nodes in inventory with the red, green, and blue dots. A materials node is any stone, metal, tree, wood, or glass node. Note that not all materials from a given mod may be present.

RECIPES:
Shapes: (These are not yet implemented, but would simply use the blueprint craftitems in various combinations)
EXAMPLE below shows how one might craft a door blueprint. Again, this does not yet work.
Code: Select all
'blueprint', 'blueprint, ''
'blueprint', 'blueprint, ''
'blueprint', 'blueprint, ''

Nodes:
Code: Select all
'', '', ''
'', shape_node, ''
'', materials_node, ''


ISSUES:
Craft Recipes are not yet implemented for the various shapes. Top Priority.
Doors do not yet lock
Slabs do not yet work like default slabs.
WARNING **
Fully enabled, this modpack can generate over 10,000 nodes with default, darkage, ethereal, moreblocks, moreores mods enabled. As such, some shapes are commented out in code for the time being.

DEPENDENCIES:
None
OPTIONAL: (can be added/subtracted at will, nothing is hardcoded)
default
darkage
ethereal
moreblocks

License on code is LGPL2.1.
License on graphics is CC-BY-SA. (May be willing to negotiate this)

SCREENSHOTS:

Image
Image
Image


DOWNLOAD: (github link might need fixed)
https://github.com/ShadMOrdre/Minetest/tree/master/mods/modpack_lib_shapes
Attachments
screenshot_20170216_210024.png
(268.73 KiB) Not downloaded yet
screenshot_20170216_205957.png
(598.12 KiB) Not downloaded yet
screenshot_20170216_210115.png
(567.78 KiB) Not downloaded yet
Last edited by ShadMOrdre on Fri Feb 24, 2017 16:47, edited 1 time in total.
My other virtual world is an Opensimulator.
 

User avatar
burli
Member
 
Posts: 1608
Joined: Fri Apr 10, 2015 13:18
 

User avatar
TumeniNodes
Member
 
Posts: 2546
Joined: Fri Feb 26, 2016 19:49
Location: in the dark recesses of the mind
GitHub: TumeniNodes
IRC: tumeninodes
In-game: TumeniNodes

Re: [Mod] lib_node_shapes [lib_node_shapes]

by TumeniNodes » Fri Feb 24, 2017 00:13

burli wrote:Interesting. Will try tomorrow

oh boy oh boy oh boy.... more cool nodes! :D
In my book, one can never have..... tumeni nodes :P
Gonna be tryin these out this weekend
I'm not your buddy, guy...
 

User avatar
azekill_DIABLO
Member
 
Posts: 7460
Joined: Wed Oct 29, 2014 20:05
Location: OMICRON
GitHub: azekillDIABLO
In-game: azekill_DIABLO
 

User avatar
burli
Member
 
Posts: 1608
Joined: Fri Apr 10, 2015 13:18

Re: [Mod] lib_node_shapes [lib_node_shapes]

by burli » Fri Feb 24, 2017 12:32

Maybe you should explain how it works because I don't know how to apply a texture to a node
 

User avatar
burli
Member
 
Posts: 1608
Joined: Fri Apr 10, 2015 13:18

Re: [Mod] lib_node_shapes [lib_node_shapes]

by burli » Fri Feb 24, 2017 12:41

And I have an issue with steps basic 01 (solid). In some positions on the first and third step I can't jump
 

ShadMOrdre
Member
 
Posts: 135
Joined: Mon Dec 29, 2014 08:07
Location: USA
In-game: shadmordre

Re: [Mod] lib_node_shapes [lib_node_shapes]

by ShadMOrdre » Fri Feb 24, 2017 17:18

burli wrote:Maybe you should explain how it works because I don't know how to apply a texture to a node


Thanks for pointing this out. How could I forget craft recipes? I edited the topic post to provide more info.

At the moment, the craft recipes for the shapes themselves are not implemented, but you can craft ALL of the shaped nodes simply by placing the shape in the center of the craft grid, and the material node below.


burli wrote:And I have an issue with steps basic 01 (solid). In some positions on the first and third step I can't jump


Are you sure you have 2 meters of clearance? Can you provide a screenshot?


TumeniNodes wrote:oh boy oh boy oh boy.... more cool nodes! :D
In my book, one can never have..... tumeni nodes :P


When I fully enabled all shapes, using default, castles, caverealms, columnia, darkage, ethereal, moreblocks, moreores, and mesecons, I quickly found the opposite (12,000 +). Culling from just the mods above gave me around 125 usable materials. So for each shape the mod generates 125 shaped nodes. With 74 shapes currently enabled, well....

While the server served them up, I found my clients would crash if the total node count exceeded 10,000. Leaving room for the mods I use, I had to trim this down to around 8500 nodes that are provided by this mod, and the 1200-1400 that are created by all my other mods.

The server is a single CPU Xeon quadcore with 8GB ram, while the clients are 2 Dell Inspiron core2duo laptops and an eMachine ??? (LOW end). The laptops have built in Intel945 graphics and 2GB ram, the eMachine has an AMD k125 with Geode graphics. Maybe this is my issue:)

I would LOVE to know if higher end machines hit this barrier, while using this mod.

azekill_DIABLO wrote:jungle objects looks very nice, good job!


I would like to be able to create these shapes for all the textures that a node provides. In the course of coding all this, I stumbled across various combinations that made me drool. Each tree provides 2 textures that can be used, giving more variability. In addition, I want to look into combining textures from different materials into frames, tiles, and such, adding yet 1000s more nodes.

Thanks for the compliments, critiques, and recommendations. Please keep them coming.
My other virtual world is an Opensimulator.
 

User avatar
burli
Member
 
Posts: 1608
Joined: Fri Apr 10, 2015 13:18

Re: [Mod] lib_node_shapes [lib_node_shapes]

by burli » Fri Feb 24, 2017 17:35

I think the jump issue is caused by the engine. It happens if the player is still in the air because of his collision box.

Tried it with normal dirt. Same issue.

Edit: but the shape + material recipe doesn't work. Don't get any output
Attachments
screenshot_20170224_183020.jpg
(213.61 KiB) Not downloaded yet
screenshot_20170224_182953.jpg
(196.64 KiB) Not downloaded yet
screenshot_20170224_182947.jpg
(184.63 KiB) Not downloaded yet
 

ShadMOrdre
Member
 
Posts: 135
Joined: Mon Dec 29, 2014 08:07
Location: USA
In-game: shadmordre

Re: [Mod] lib_node_shapes [lib_node_shapes]

by ShadMOrdre » Fri Feb 24, 2017 20:45

burli,

I confirmed your findings. There appear to be inconsistent spots. Or not so inconsistent. If you step from one collision box to another at a different height, but have not yet been subjected to the physics that should cause you to fall, you will also be unable to jump. This would appear to be physics issue, thus engine related. I'll see what the devs have to say.

I tested this with default stairs, and if you are standing on the edge of the step, you are also affected.

The red stairs are from this mod, the grey stairs are default.
Also, a couple of screenshots of inventory, and how to craft.

Image
Image
Image
Attachments
screenshot_20170224_122409.png
(556.85 KiB) Not downloaded yet
screenshot_20170224_122345.png
(481.33 KiB) Not downloaded yet
screenshot_20170224_122453.png
(528.11 KiB) Not downloaded yet
My other virtual world is an Opensimulator.
 

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

Re: [Mod] lib_node_shapes [lib_node_shapes]

by bell07 » Sat Feb 25, 2017 10:33

Pls. add the next patch to the lib_node_shapes and update the smart_inventory to the latest git ;)
I will optimize the "material outcome" view in further. PS: The crafting trash is on place now ;)
Code: Select all
diff --git a/mods/modpack_lib_shapes/lib_node_shapes/init.lua b/mods/modpack_lib_shapes/lib_node_shapes/init.lua
index 7dd4e2e..1b7eb8d 100644
--- a/mods/modpack_lib_shapes/lib_node_shapes/init.lua
+++ b/mods/modpack_lib_shapes/lib_node_shapes/init.lua
@@ -360,6 +360,8 @@ lib_node_shapes.register_shaped_nodes =  function(shape_name, shape_def)
                        walkable = true,
                        groups = new_node_groups,
                        sounds = node_def.sounds,
+                       base_material = def.name,
+                       shape_type = shape_name,
 
                        on_place = function(itemstack, placer, pointed_thing)
                                if pointed_thing.type ~= "node" then


Image
Image


EDIT: if I enable lib_node_shapes and moreblocks at the same time (in minetest_game, without smart_inventory or any other additional mods) I get filled my console by
Code: Select all
2017-02-25 12:39:23: WARNING[Server]: active block modifiers took 273ms (longer than 200ms)
2017-02-25 12:39:27: WARNING[Server]: active block modifiers took 231ms (longer than 200ms)
2017-02-25 12:39:31: WARNING[Server]: active block modifiers took 284ms (longer than 200ms)

Please check which block modifiers does impact the performance. A "New nodes" mod should not have any abm's.
But I asume it's not yours but the moreblocks/stairsplus's conversion abm's. I see your mod overrides all nodes of stairsplus. So please check if you need more adjustments to avoid this abm's torment.
Attachments
screenshot_20170225_112725.png
(664.56 KiB) Not downloaded yet
screenshot_20170225_112714.png
(774.29 KiB) Not downloaded yet
 

ShadMOrdre
Member
 
Posts: 135
Joined: Mon Dec 29, 2014 08:07
Location: USA
In-game: shadmordre

Re: [Mod] lib_node_shapes [lib_node_shapes]

by ShadMOrdre » Sat Feb 25, 2017 17:57

bell07,

I've added the patch that you requested. And yes, I need to update my smart_inventory to the latest git :D

As for the ABMs, I use none. If I create a world with just moreblocks and lib_node_shapes, I do not see the ABM messages.

I use MT v0415 stable. I can't really say which version of moreblocks, but it was one of the first mods I dl'd and don't know if I've ever updated it. That's been about 2 years ago by now.

Maybe the debug level is different, and you get messages that I may have disabled...?
My other virtual world is an Opensimulator.
 

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

Re: [Mod] lib_node_shapes [lib_node_shapes]

by bell07 » Sat Feb 25, 2017 20:50

I need to update
I dl'd and don't know if I've ever updated it.
okok, i uploaded it, maybe this is usefull for you :-) https://forum.minetest.net/viewtopic.php?f=14&t=16772

About the ABM messages, I use v0415 too. Maybe just my computer is slower, 231ms (longer than 200ms) is not a big difference. My guess was the moreblocks does something unexpected because of your redefinition, so as hint. For me it does not care since I do not use moreblocks anymore. But if you would support the moreblocks compatibility (asumption because of defined optional dependency) you need to find the reason for such site effects.
 

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

Re: [Mod] lib_node_shapes [lib_node_shapes]

by bell07 » Wed Mar 08, 2017 19:44

Oh, I see you used already shape_type in the mod before my proposal. With the same name oO. That can be used and generate beter classification. Please apply in addition the next patch to get the shape_type used ;-)
Code: Select all
diff --git a/mods/modpack_lib_shapes/lib_node_shapes/init.lua b/mods/modpack_lib_shapes/lib_node_shapes/init.lua
index 8db4547..9ad9dcf 100644
--- a/mods/modpack_lib_shapes/lib_node_shapes/init.lua
+++ b/mods/modpack_lib_shapes/lib_node_shapes/init.lua
@@ -361,7 +361,7 @@ lib_node_shapes.register_shaped_nodes =  function(shape_name, shape_def)
                        groups = new_node_groups,
                        sounds = node_def.sounds,
                        base_material = def.name,
-                       shape_type = shape_name,
+                       shape_type = shape_def.shape_type or shape_name,
 

User avatar
D00Med
Member
 
Posts: 937
Joined: Sat Feb 07, 2015 22:49
Location: Australia...somewhere
GitHub: D00Med
 

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

Re: [Mod] lib_node_shapes [lib_node_shapes]

by bell07 » Wed Mar 08, 2017 20:47

Forgotten to say, I am unhappy to shape_type = "basic". Maybe you can change it to something more specific like"bed", "stair", "wall"?

nightly EDIT: can you please have a look to my copy (fork) on github and test the changes in branch "pr_modutils" if the changes are ok for you? https://github.com/bell07/minetest-Shad ... r_modutils So I will take a pull request.

I replaced the detection of valid template nodes by my implementation from carpets mod with some adjustments. So please test if the selection is ok now for your preferred mods.

The new implementation utilize the depends.txt files, that means you need just add an other mod to the depends.txt file and the nodes will be used. The file in lib_node_shapes is valid for all shapes. The depends.txt in the shapes mod folder is valid for this shape only. As example, if I define "plastic?" in /lib_shapes_walls/depends.txt I get plastic-walls, but no other plastic shapes. If I add it to lib_node_shapes/depends.txt I get all plastic shapes.
 

User avatar
texmex
Member
 
Posts: 1063
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: texmex

Re: [Mod] lib_node_shapes [lib_node_shapes]

by texmex » Wed Jun 07, 2017 14:19

This looks interesting. I can see much value in this when building a subgame from the ground up. Not with the full set of shapes of course, but with a useful subset according to the needs of the specific game type and style. If I choose a subset of say 6 shapes I can imagine a modified crafting formspec with buttons for each shape, eliminating the need for blueprints.
 

ShadMOrdre
Member
 
Posts: 135
Joined: Mon Dec 29, 2014 08:07
Location: USA
In-game: shadmordre

Re: [Mod] lib_node_shapes [lib_node_shapes]

by ShadMOrdre » Wed Jun 07, 2017 16:39

texmex,

The real meat of this modpack is the lib_shapes mod. It does all the hard work. I've considered a formspec, just for the shapes, but have not had time to figure out the formspecs code.

After using this mod for the last few months, I've considered breaking it apart. With just the dependency on default, I generate around 2500 nodes, and only use around 20-50 of them.

I'm currently working on separating each of the shape libraries into seperate mods, simply because I really don't use most of the materials that are available to generate the various shaped nodes.

However, I still see value in this modpack, (specifically, the lib_shapes mod where the real meat of this mod lives), and what it can provide to a custom game, or even to MT game.

If you are familiar with formspecs, please, see what you can do for this mod, as it would greatly benefit future development. The mod is on git, and I'll honor pull requests for additional shapes, texture masks, and, of course, code changes. I really like the idea of a formspec, and I know the code itself could probably be more efficient. I'm also interested in using a generic container node whose tiles and nodebox properties can be changed on demand during runtime.

Thanks for your interest.
My other virtual world is an Opensimulator.
 

User avatar
texmex
Member
 
Posts: 1063
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: texmex

Re: [Mod] lib_node_shapes [lib_node_shapes]

by texmex » Wed Jun 07, 2017 18:56

ShadMOrdre wrote:I'm currently working on separating each of the shape libraries into seperate mods, simply because I really don't use most of the materials that are available to generate the various shaped nodes.

Yes, this modularization sounds great for subgame developers. I would only use a few basic shapes myself.

ShadMOrdre wrote:If you are familiar with formspecs, please, see what you can do for this mod, as it would greatly benefit future development. The mod is on git, and I'll honor pull requests for additional shapes, texture masks, and, of course, code changes. I really like the idea of a formspec, and I know the code itself could probably be more efficient.

It's hard to modify stuff in default inventory from another mod I've noticed, but I'll think about it. For a game I'm thinking of I'm considering crafting, so blueprints wouldn't necessarily be needed.

ShadMOrdre wrote:I'm also interested in using a generic container node whose tiles and nodebox properties can be changed on demand during runtime.

I believe in the player getting all nodes from the same source, but I'd be interesting to see. What would happen to the cost of crafting though?
 

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

Re: [Mod] lib_node_shapes [lib_node_shapes]

by bell07 » Thu Jan 18, 2018 17:39

@ShadMOrdre please have a look to the last change in my customnode mod. What do you think about porting the lib_shapes to customnode tasks? If I look trough the code the register_shape() needs to be enhanced for customnode.register_task() and all generation things could be moved to an custom customnode mod, with usage of depends.txt instead of hard-coded
Code: Select all
if string.find(node_mod, "default") or string.find(node_mod, "darkage") or string.find(node_mod, "ethereal") or string.find(node_mod, "moreblocks") or string.find(node_mod, "moreores") or string.find(node_mod, "columnia") or string.find(node_mod, "cottages") or string.find(node_mod, "xdecor") then
 

ShadMOrdre
Member
 
Posts: 135
Joined: Mon Dec 29, 2014 08:07
Location: USA
In-game: shadmordre

Re: [Mod] lib_node_shapes [lib_node_shapes]

by ShadMOrdre » Fri Jan 19, 2018 23:55

bell07,

I've reworked the shapes part of this mod into a standalone lib_shapes mod. lib_shapes is far more lean, and might be a better candidate for what you propose.

This, lib_node_shapes, is a beast. The logic for determining which nodes to provide shapes for was rather rudimentary, and provided so many node definitions, that it would crash my systems more often than not.

The reworking into lib_shapes is with the intention of providing a more game oriented play value, as yet to be determined. I intend to move the logic for defining materials into a different mod, lib_materials, so as to better encapsulate materials definitions. Most of the logic will be rewritten, taking advantage of my growth within Lua and the Lua API, as provided by minetest.

Please let me know if the newer mod is better suited to your suggestion, or if this mod provides better accomadation. If you still feel that this mod is a better choice, I'll need to make some major updates to it's logic, to help better define it's materials, remove the hard coded dependencies and such.

Thanks for your continued interest.

Shad
Last edited by ShadMOrdre on Sat Jan 20, 2018 23:15, edited 1 time in total.
My other virtual world is an Opensimulator.
 

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

Re: [Mod] lib_node_shapes [lib_node_shapes]

by bell07 » Sat Jan 20, 2018 09:11

That is great news! This way I can just implement lib_shapes support to customnode.
The customnode provides 2x different nodes-lists, the first is analyzing the textures files and create new nodes by texture, the second is "the beast" analyzing already registered nodes in other mods. I do not know the lib_materials but I suspect another approach so customnode and lib_materials can coexists to use the shapes
 


Return to WIP Mods



Who is online

Users browsing this forum: Bing [Bot] and 1 guest