[mod][api] smallblocks [k_smallblocks]

Post Reply
Kurtzmusch
Member
Posts: 41
Joined: Sat Oct 21, 2017 18:12
In-game: Kurtzmusch

[mod][api] smallblocks [k_smallblocks]

by Kurtzmusch » Post


video: https://youtu.be/bNXEQXOBJhk

download/git: https://notabug.org/Kurtzmusch/k_smallblocks

license: lgpl2.1: see https://www.gnu.org/licenses/old-licens ... alone.html


general description

k_smallblocks divides each node into 8 'subnodes', allowing for more detailed building, aswell as using its own logic for rotation prediction to make the screwdriver obsolete

the mod is still very WIP and right now only stonebrick subnodes are registered.

to test it, pick a block called Stone Brick Smallblock and place it in the world with LEFT click. to remove a smallblock from a node use RIGHT click - yes, its inverted - this is due to, afaik, a limitation of the engine.

full scope of the project


when finished, this mod will act like an API for other mods to register their nodes if they wish to generate smallblocks for them.

22 nodes are generated and registered to cover all 255 possible 'shapes' a node of a given 'material' can have.

only 5 'base nodes' for a material will be craftable, the others will have to be crated by placing and combining these in the world the base nodes are:
  • smallblock
  • slab
  • half-slab
  • stair
  • full node
a full node by itslef will produce 8 smallblocks
2 smallblocks makes a half-slab
2 half-slabs makes a slab
3 half-slabs makes a stair

2 slabs makes a full node
4 half-slabs makes a full node
8 smallblocks makes a full node

all base nodes can be crafted back into smallblocks.

all recipes preserve the amount of material, theres never loss or excess.

a flag will allow mods to decide wheter or not the recipes are shapeless.

to make a stair corner, one would have to place a stair in the world and then place a smallblock on the desired position.

all nodes use align_style="world" so textures always align.

stairs and slabs will have a slightly diferent logic for rotation prediction then the one used by mtg.
Last edited by Kurtzmusch on Wed May 08, 2019 17:48, edited 3 times in total.
Like Puzzles? Escape The Dungeon

Sokomine
Member
Posts: 4276
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine
IRC: Sokomine
In-game: Sokomine

Re: [mod][api] smallblocks [k_smallblocks]

by Sokomine » Post

You...er...ought to put more context in your posting and not hide it all behind spoilers. I rarely activeate JavaScript anywhere. Thus, all I see are some headlines. It would be nice if you could make your posting readable.
A list of my mods can be found here.

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

Re: [mod][api] smallblocks [k_smallblocks]

by texmex » Post

This is a great solution to the old problem of having to spam the node list with all subnode combos. Kudos!

Kurtzmusch
Member
Posts: 41
Joined: Sat Oct 21, 2017 18:12
In-game: Kurtzmusch

Re: [mod][api] smallblocks [k_smallblocks]

by Kurtzmusch » Post

Sokomine wrote:You...er...ought to put more context in your posting and not hide it all behind spoilers. I rarely activeate JavaScript anywhere. Thus, all I see are some headlines. It would be nice if you could make your posting readable.
oh, im very sorry i didnt think those spoilers used JS, ill fix that...
Like Puzzles? Escape The Dungeon

User avatar
Pyrollo
Developer
Posts: 385
Joined: Mon Jan 08, 2018 15:14
GitHub: pyrollo
In-game: Naj
Location: Paris

Re: [mod][api] smallblocks [k_smallblocks]

by Pyrollo » Post

IIRC I answer the former post before the forum crash.

I was wondering about Calinou's moreblock mod integration. It could be good (and not so hard) that your mod could be integrated with his.

Anyway, I love the approach you're proposing :)
[ Display Modpack ] - [ Digiterms ] - [ Crater MG ] - [ LATE ]

Astrobe
Member
Posts: 571
Joined: Sun Apr 01, 2018 10:46

Re: [mod][api] smallblocks [k_smallblocks]

by Astrobe » Post

It seems that I'm not the only one that had this idea in mind... Thanks for doing it.

My personal wish is that it would be coupled with a kind of circular saw that consumes diamonds because I prefer things that have a cost-on-use over a big upfront one-time-cost, but I guess it would be the subject of another mod.

User avatar
Desour
Member
Posts: 1469
Joined: Thu Jun 19, 2014 19:49
GitHub: Desour
IRC: Desour
In-game: DS
Location: I'm scared that if this is too exact, I will be unable to use my keyboard.

Re: [mod][api] smallblocks [k_smallblocks]

by Desour » Post

I had written something here before the forum had it's problem. It was something like:

Great!
Kurtzmusch wrote:to test it, pick a block called Stone Brick Smallblock and place it in the world with LEFT click. to remove a smallblock from a node use RIGHT click - yes, its inverted - this is due to, afaik, a limitation of the engine.
You can use on_punch (with player:g/set_wielded_item(...)) instead of on_rightclick and on_use instead of on_place.
he/him; Codeberg; GitHub; ContentDB; public personal TODO list; "DS" is preferred (but often too short)

Kurtzmusch
Member
Posts: 41
Joined: Sat Oct 21, 2017 18:12
In-game: Kurtzmusch

Re: [mod][api] smallblocks [k_smallblocks]

by Kurtzmusch » Post

texmex wrote:This is a great solution to the old problem of having to spam the node list with all subnode combos. Kudos!
yeah, i supose it could be used for that... however the main purpose is to give the illusion of placing blocks on a smaller node grid, aswell as making a rotation prediction that facilitates building and abolishes the screwdriver - i really dont like it -
Pyrollo wrote:I was wondering about Calinou's moreblock mod integration. It could be good (and not so hard) that your mod could be integrated with his.
i dont really understand what you want here... one of the reasons i made this is because moreblocks does a bit too much for my taste... i wanted to keep the cubic style, so no ramps. if you mean integration with the saw then a mod using this api can choose to do that and not generate the recipes
Astrobe wrote:My personal wish is that it would be coupled with a kind of circular saw that consumes diamonds because I prefer things that have a cost-on-use over a big upfront one-time-cost, but I guess it would be the subject of another mod.
same as above: its beyond the scope of the api, and mods that depend the api could do that
DS-minetest wrote:You can use on_punch (with player:g/set_wielded_item(...)) instead of on_rightclick and on_use instead of on_place.
on_use is left_click so that wouldnt help (on_use is already used to place the smallblocks)... the problem i'm having is that there is no callback for rightclicking with a node: on_place is almost that, but it wont get called for some situations
i know that inverting the buttons is a bad solution, but this is something im strugling to come up with anything better...
Like Puzzles? Escape The Dungeon

User avatar
Desour
Member
Posts: 1469
Joined: Thu Jun 19, 2014 19:49
GitHub: Desour
IRC: Desour
In-game: DS
Location: I'm scared that if this is too exact, I will be unable to use my keyboard.

Re: [mod][api] smallblocks [k_smallblocks]

by Desour » Post

Kurtzmusch wrote:
DS-minetest wrote:You can use on_punch (with player:g/set_wielded_item(...)) instead of on_rightclick and on_use instead of on_place.
on_use is left_click so that wouldnt help (on_use is already used to place the smallblocks)... the problem i'm having is that there is no callback for rightclicking with a node: on_punch is almost that, but it wont get called for some situatuons
i know that inverting the buttons is a bad solution, but this is something im strugling to come up with anything better...
Oops, I meant on_place instead of on_use. Rightclicking with a node is the same as rightckicking with an item. It's on_place.
Afaik, on_place is not called if the node has a formspec in its meta or on_rightclick defined and the player doesn't hold sneak. But this shouldn't be a problem.
he/him; Codeberg; GitHub; ContentDB; public personal TODO list; "DS" is preferred (but often too short)

Kurtzmusch
Member
Posts: 41
Joined: Sat Oct 21, 2017 18:12
In-game: Kurtzmusch

Re: [mod][api] smallblocks [k_smallblocks]

by Kurtzmusch » Post

and i meant on_place instead of on_punch, i guess you quoted me before i correted myself...

the problem is that on_place wont get called if the face you clicked is inside the 'target placing position' and the 'target placing position' already contains a node
Like Puzzles? Escape The Dungeon

User avatar
Desour
Member
Posts: 1469
Joined: Thu Jun 19, 2014 19:49
GitHub: Desour
IRC: Desour
In-game: DS
Location: I'm scared that if this is too exact, I will be unable to use my keyboard.

Re: [mod][api] smallblocks [k_smallblocks]

by Desour » Post

Kurtzmusch wrote:the problem is that on_place wont get called if the face you clicked is inside the 'target placing position' and the 'target placing position' already contains a node
Do you mean something like this:

Code: Select all

/-----\
|     |←you look at this face
|     |/-----\
\-----/\-----/
or maybe like this:

Code: Select all

  ↓you look at this face
/-----\
\-----/
?
If yes, I can't reproduce that. on_place is called in both scenarios.
he/him; Codeberg; GitHub; ContentDB; public personal TODO list; "DS" is preferred (but often too short)

User avatar
Pyrollo
Developer
Posts: 385
Joined: Mon Jan 08, 2018 15:14
GitHub: pyrollo
In-game: Naj
Location: Paris

Re: [mod][api] smallblocks [k_smallblocks]

by Pyrollo » Post

Kurtzmusch wrote:i dont really understand what you want here... one of the reasons i made this is because moreblocks does a bit too much for my taste... i wanted to keep the cubic style, so no ramps. if you mean integration with the saw then a mod using this api can choose to do that and not generate the recipes
I'm just worried of server using both mods, yours and moreblocs, ending ups with duplicate similar nodes. This happens too often and is not good for players.
[ Display Modpack ] - [ Digiterms ] - [ Crater MG ] - [ LATE ]

Kurtzmusch
Member
Posts: 41
Joined: Sat Oct 21, 2017 18:12
In-game: Kurtzmusch

Re: [mod][api] smallblocks [k_smallblocks]

by Kurtzmusch » Post

DS-minetest wrote:Do you mean something like this:
like this: ( notice tha lack of message on the chat )
Image
Pyrollo wrote:I'm just worried of server using both mods, yours and moreblocs, ending ups with duplicate similar nodes. This happens too often and is not good for players.
in this case its up to the mod making use of the api to provide some compatibility... even minetest game would have duplicate stairs, so a mod like mtg_smallblocks would have to unregister those. i like modularity, so im not really adding any compatibility for any mod, not even mtg. however, i will make a mtg_smallblocks later wich will handle those things
Attachments
Screenshot from 2019-05-10 09-29-45.png
Screenshot from 2019-05-10 09-29-45.png (653.7 KiB) Viewed 885 times
Last edited by Kurtzmusch on Thu Sep 19, 2019 14:53, edited 1 time in total.
Like Puzzles? Escape The Dungeon

User avatar
Desour
Member
Posts: 1469
Joined: Thu Jun 19, 2014 19:49
GitHub: Desour
IRC: Desour
In-game: DS
Location: I'm scared that if this is too exact, I will be unable to use my keyboard.

Re: [mod][api] smallblocks [k_smallblocks]

by Desour » Post

Kurtzmusch wrote:
DS-minetest wrote:Do you mean something like this:
like this: ( notice tha lack of message on the chat )
[img]download/file.php?mode=view&id=18537
[/img]
Ah, I was able to reproduce.
It's like this:

Code: Select all

/-----\
|     |←you look at this face
|     |/-----\
\-----/\-----/
But it would work with items that are not nodes.
I'll open an issue. Edit: https://github.com/minetest/minetest/issues/8517
he/him; Codeberg; GitHub; ContentDB; public personal TODO list; "DS" is preferred (but often too short)

Kurtzmusch
Member
Posts: 41
Joined: Sat Oct 21, 2017 18:12
In-game: Kurtzmusch

Re: [mod][api] smallblocks [k_smallblocks]

by Kurtzmusch » Post

DS-minetest wrote:I'll open an issue. Edit: https://github.com/minetest/minetest/issues/8517
thank you very much for that! it gives me motivation for working on the TODO list, specially now that paramat tagged it as a bug
Like Puzzles? Escape The Dungeon

Post Reply

Who is online

Users browsing this forum: No registered users and 13 guests