Poikilos / EnlivenMinetest

Minetest engine server management tools and ENLIVEN game installer/updater
Other
3 stars 0 forks source link

Automatic seamless continuation of stairs #195

Open Poikilos opened 5 years ago

Poikilos commented 5 years ago

from me to OldCoder "RE: New MT snapshot" Apr 26, 2019:

It is a popular wontfix issue:

  1. https://forum.minetest.net/viewtopic.php?f=6&t=19673
  2. Here is the frown-face and thumbsdown on paramat's partial implementation (which merely allows facedir to determine orientation, but you still must first craft a corner block): https://github.com/minetest/minetest_game/issues/1443#issuecomment-301868754 which he promptly committed as a close 3 months later :(

I tried the latest "stable" minetest.net release (5.0.1), I can't even craft stairs, only corner stairs! . . . Since the auto corner cannot be implemented using the engine's connect feature, I am looking into using an abm. You've both indirectly confirmed that you don't know of any way to utilize the engine to do this in some automatic way. A new drawtype would be needed, but an abm can accomplish the same visual by instead just replacing stairs with the correct corner stair. After I have a proof of concept we could always optimize it later, as a C++ feature if you decide that's necessary.

I don't understand how an lbm (as opposed to abm) could do this. I'm working on a lua_api.txt pull based on your latest included version. Is an lbm triggered when a block is placed? The documentation only directly says when "loaded." Thats all the info I'm missing I think.

-Poikilos

Poikilos commented 5 years ago

@HenryNautilus, can you check on this? OldCoder made additions to Bucket_Game/mods/coderbuild/moreblocks/stairsplus/conversion.lua downloaded today

Poikilos commented 5 years ago

@OldCoder also added Bucket_Game/mods/coderbuild/stairsio today (version 190325 aka 2019-03-25)

HenryNautilus commented 5 years ago

Are you asking whether or not these stairs connect? They do not, if that's the case.

Poikilos commented 5 years ago

It is still a work in progress. I misunderstood the stairs abm, which currently only is to assist in placing upside-down stairs.

Poikilos commented 3 years ago

Information from e-mail 4/24/19 12:06 AM ET:

I am on the "Node boxes" section, and I am reading that a different node box can be specified (connect_ = ...) along with "connect_to" to specify what will connect and that those settings are built into the engine. No one over there ever implemented automatic corners for stairs even though the feature is in the engine...

Poikilos commented 3 years ago

More clarifications in 4/27/19, 1:18 PM ET email:

/commented parts are rotation angle, where the front part of the node with the actual step faces that way/ stairs:stair_wood /north/ stairs:stair_wood /north or east/ stairs:stair_wood /east/ -- should become): stairs:stair_wood /north/ stairsio:stairo_wood stairs:stair_wood /east/

stairs:stair_wood /south/ stairs:stair_wood stairs:stair_wood /west/ -- should become: stairs:stair_wood /south/ stairsio:stairi_wood stairs:stair_wood /west/

["should become" indicates what should occur on place, or abm/lbm]

Poikilos commented 3 years ago

More from 5/5/19 9:26 AM ET e-mail: image

Poikilos commented 3 years ago

6/20/2019 3:12 AM ET OldCoder says:

. . . You can use a picture if it is like this:

0123 4567 89AB CDEF

Tell me what is each hex-numbered node and what you wish to have happen. Perhaps send 3 examples.

This seems like a simple and fair request. If possible, do not send any picture or illustration that is not like the above.

I replied 6/20/19, 9:52 AM with the diagrams:

In each group of 2 hex characters, second character is facedir (which is the param2 for stairs). This was confusing to put together, but I believe everything is correct. I've attached before and after schems for verification. This time I've covered all upside-down situations. I could improve it by making it so nothing depends on orientation, but that would make not losing my place while building the example much, much more difficult--instead I just annotate the relative coordinates ("lowest"/"highest" to denote orientation; of course, this is needed since when modeling, I was facing north, south, west, or east). I realized this time that you don't have to check the player rotation--you can just use the node's param2 (facedir in this case) since existing code already uses player rotation for that.

A is stairs:stair_wood
B is stairsio:stairo_wood
C is stairsio:stairi_wood

--but

A0 A0 -- highest z A1 -- or A0 A1 -- highest z A1 -- become A0 C1 -- highest z A1


* South (left to right starts from highest x)

A1 -- lowest z A2 A2 -- or A1 -- lowest z A2 A1 -- become A1 -- lowest z A2 B1

-- but

A2 C3 -- lowest z A3 -- or A2 A3 -- lowest z A3 -- become A2 C3 -- lowest z A3


* West (left to right starts from lowest z)

A2 -- lowest x A3 A3 -- or A2 -- lowest x A3 A2 -- become A2 -- lowest x A3 B2

-- but

A3 A3 -- lowest x A0 -- or A3 A0 -- lowest x A0 -- become A3 C0 -- lowest x A0


* East (left to right starts from highest z)

A0 -- highest x A1 A1 -- or A0 -- highest x A1 A0 -- become A0 -- highest x A1 B0

-- but

A1 A1 -- highest x A2 -- or A1 A2 -- highest x A2 -- become A1 C2 -- highest x A2


## Upside-down (these have extended notation due to larger values for param2: 17 is 23, 14 is 20, and so on as per hex)

0A is stairs:stair_wood 0B is stairsio:stairo_wood 0C is stairsio:stairi_wood


* North upside-down (left to right starts from lowest x)
 0A15  -- highest z

0A14 0A14 -- or 0A15 -- highest z 0A14 0A15 -- become 0A15 -- highest z 0A14 0B14

-- but

0A14 0A14 -- highest z 0A17 -- or 0A14 0A17 -- highest z 0A17 -- become 0A14 0C14 -- highest z 0A17


* South upside-down (left to right starts from highest x)
 0A17  -- lowest z

0A16 0A16 -- or
0A17 -- lowest z 0A16 0A17 -- become 0A17 -- lowest z 0A16 0B16

-- but

0A16 0A16 -- lowest z 0A15 -- or 0A16 0A15 -- lowest z 0A15 -- become 0A16 0C16 -- lowest z 0A15


* West upside-down (left to right starts from lowest z)
 0A16  -- lowest x

0A15 0A15 -- or 0A16 -- lowest x 0A15 0A16 -- become 0A16 -- lowest x 0A15 0B15

-- but

0A15 0A15 -- lowest x 0A14 -- or 0A15 0A14 -- lowest x 0A14 -- become 0A15 0C15 -- lowest x 0A14


* East upside-down (left to right starts from highest z)
 0A14  -- highest x

0A17 0A17 -- or 0A14 -- highest x 0A17 0A14 -- become 0A14 -- highest x 0A17 0B17

-- but

0A17 0A17 -- highest x 0A16 -- or 0A17 0A16 -- highest x 0A16 -- become 0A17 0C17 -- highest x 0A16



- [ ] I'd also like to remind you that removing the separate upside-down stair mesh was not ideal. It was added since it had different UVs to align repeating patterns such as wood and brick with those of nodes next to it. Henry Nautilus noticed the legacy misaligned texture issue that came back.
[stair-before_and_after-stairio.we.zip](https://github.com/poikilos/EnlivenMinetest/files/7116315/stair-before_and_after-stairio.we.zip)