Page 1 of 1

[Mod] Angled walls [git][angled_walls]

PostPosted: Mon Sep 08, 2014 20:37
by VanessaE

Simple Angled Walls


Out of a fit of boredom, I used the code from the cobwebs in Homedecor, rewrote it, and created a set of angled walls for Minetest. This is accomplished by exploiting the "ceiling" and "floor" modes of the torchlike draw type.

This same method has been used in the past by Jordach to create flat panes before we had nodeboxes, but not in an automatic-find-the-right-wall-angle method.

Supports a dozen of the standard in-game blocks. Adding more wall types is as simple as adding a line to the nodes_list table in the code, and adding a texture to match.

Give yourself the wall you need or craft it and just place it. The code will make an attempt to figure out the right wall angle and place/rotate it accordingly - either to fill a corner between two adjacent blocks, or to extend a previously-placed angled wall of the same kind. Node names are of the form "angled_walls:xxxxxx_corner" where xxxxx is brick, stone, etc.

In order to get the images to align properly at the visual_scale setting used with them, I copied the original textures to new filenames, up-scaled them to 128px without filtering (so they still look like they're 16px), and then added empty space above and below the images.

Crafting: first craft some standard slabs of the material you need, e.g. wood or stone. Then place three of those slabs back in your crafting grid in a diagonal line. You can use Moreblocks' slabs also (the regular-sized ones), as long as all three are the same. Yields 12 wall panels:

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
- - X
- X -
X - -

Dependencies: default from minetest_game

Download: https://github.com/VanessaE/angled_wall ... master.zip
...or browse the code: https://github.com/VanessaE/angled_walls

License: WTFPL for the code, CC-by-SA 3.0 for the textures, which were derived from the ones in minetest_game.

Screenshot:
Image

Re: [Mod] Angled walls [git][angled_walls]

PostPosted: Mon Sep 08, 2014 22:30
by ExeterDad
This is interesting. So many possible uses are popping into my head.
Just curious, if a person were to place many blocks in a diagonal row, would the faces span all the blocks to create a long smooth diagonal wall?

Edited due to lack of brain cells.

Re: [Mod] Angled walls [git][angled_walls]

PostPosted: Mon Sep 08, 2014 22:37
by VanessaE
If there are blocks in place similar to what's seen above that will trick the code into doing so, yes (after which, you could remove those blocks). I didn't really think about "extending" the wall like that, but to do so in the code should be easy.

EDIT: the code was easy. :-)

Added the ability to extend a wall by just placing more of the same wall diagonally next to it. Only extends the same kind of wall. If you need to transition from one kind of diagonal wall to another (e.g. from stone to wood), place a few random blocks behind where the diagonal walls need to go, so that the code has something to read, then place your diagonal wall materials as needed.

Re: [Mod] Angled walls [git][angled_walls]

PostPosted: Tue Sep 09, 2014 00:20
by VanessaE
Update: fixed the incorrect flip-X of some wall angles that happened at placement time. After updating, you'll have to dig and re-place whichever walls are still errant (else they'll just remain flipped).

Note that diagonal walls that look like they're one node thick will still confuse the flip-X check (since from the map's standpoint, there would be multiple adjacent diagonal walls). I'll fix that later.

Re: [Mod] Angled walls [git][angled_walls]

PostPosted: Tue Sep 09, 2014 01:57
by VanessaE
Minor bugfix just went in. Just fixed some brain-o's: drops and groups weren't set right, some rotation glitches in that extensions code under certain circumstances. All fixed, as far as I can see.

Re: [Mod] Angled walls [git][angled_walls]

PostPosted: Tue Sep 09, 2014 03:20
by ExeterDad
It works awesome! Thanks for considering a longer diagonal wall!
Here's a screenie of nothing in particular showing it's possible.
Image

I did have a chuckle... after making these two "structures" I decided to walk between them. The gap between them is a illusion as the full node is taken. LOL

Re: [Mod] Angled walls [git][angled_walls]

PostPosted: Tue Sep 09, 2014 03:28
by ExeterDad
Is it possible, and would it be worth considering texture the top as well? So a low wall would look tidy from the top view? Not a deal breaker. Just would give the mod more polish.

Re: [Mod] Angled walls [git][angled_walls]

PostPosted: Tue Sep 09, 2014 03:44
by VanessaE
Yes, it is possible to fix both things you mentioned. For that narrow aisle, it's because of the collision boxes for the new walls - I left them as full nodes. For the tops, that's pretty simple to do.

I'll get to these sooner or later, but don't be surprised if you end up having to dig and re-place a few hundred nodes to make the narrow aisles work right. ;-) It IS an experimental mod after all.

Re: [Mod] Angled walls [git][angled_walls]

PostPosted: Tue Sep 09, 2014 04:20
by Inocudom
I didn't see this mod on you creative server as of yet.

Re: [Mod] Angled walls [git][angled_walls]

PostPosted: Tue Sep 09, 2014 04:22
by VanessaE
It has not yet been added as I don't consider it stable enough.

Re: [Mod] Angled walls [git][angled_walls]

PostPosted: Tue Sep 09, 2014 05:06
by VanessaE
Update: pushed the fix for the collision boxes, so now those narrow aisles will work. As expected, you'll have to dig some of the walls and re-place them to reset the selection/collision boxes to fit. I could have automated this but it would have resulted in rather hacky code and I doubt there are enough people using this mod yet for me to need to worry about that. :-)

This update does not add the aforementioned wall top caps, I'll do those later.

Re: [Mod] Angled walls [git][angled_walls]

PostPosted: Tue Sep 09, 2014 10:01
by ExeterDad
Holy Smokes! I was getting some shut eye, and you were chugging away at this. Now I feel bad as the collision boxes really weren't a issue. I was just surprised when my player couldn't fit.
Please don't feel I was putting this mod down or criticizing. You do great work, no one can deny that :)

Re: [Mod] Angled walls [git][angled_walls]

PostPosted: Tue Sep 09, 2014 10:20
by Minetestforfun
wow ! very good idea ! Thank you VanessaE !

Re: [Mod] Angled walls [git][angled_walls]

PostPosted: Tue Sep 09, 2014 22:02
by VanessaE
I've just added this mod to Dreambuilder.

In turn, it'll appear on my Creative and Survival servers, and also I'll add it to my FreeForAll server as well. Those changes will take effect tomorrow morning.

Re: [Mod] Angled walls [git][angled_walls]

PostPosted: Wed Sep 10, 2014 01:44
by Sokomine
Nice mod. The angled walls give house builders a new option to design their houses - without having to resort to nodebox-heavy nodes from the CNC machine.

Re: [Mod] Angled walls [git][angled_walls]

PostPosted: Wed Sep 10, 2014 01:48
by Inocudom
Sokomine wrote:Nice mod. The angled walls give house builders a new option to design their houses - without having to resort to nodebox-heavy nodes from the CNC machine.

You know, I just had an idea. If nodebox models could have hollow interiors, they would not reduce framerate as much.

Re: [Mod] Angled walls [git][angled_walls]

PostPosted: Wed Sep 10, 2014 01:58
by Sokomine
Inocudom wrote:You know, I just had an idea. If nodebox models could have hollow interiors, they would not reduce framerate as much.

Not really. It all boils down to triangles. A drawtype which would allow to create nodes out of triangles directly would sometimes be more helpful than the current method. But then, we'd end up wishing for diffrent angles for slopes.

Re: [Mod] Angled walls [git][angled_walls]

PostPosted: Wed Sep 10, 2014 02:25
by VanessaE
Update: Added crafting recipes, see first post. Also the copy of this mod that's in Dreambuilder is tweaked slightly to use the older, dark junglewood texture.

Interesting you two should mention nodeboxes... Sokomine, if you check the code you'll notice that when I fixed the collisionbox, I did so by putting your idea into use. :-) Nodeboxes create the collision box, while the torchlike draw type provides the visual part.

Anyway, enjoy.

Re: [Mod] Angled walls [git][angled_walls]

PostPosted: Wed Sep 10, 2014 17:35
by Krock
I saw the mod's screenshots in IRC and I liked it already back then.
Finally there's a release :)

+1