-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add paramtype2s for 4 horizontal rotations and 64 colors #11431
Conversation
How about calling it |
I don't really care either way. It depends on what others think. If enough people are for it, I change it. If not, then not. |
Note: This PR should have a concept approval because #6194 is "supported by core dev". |
Bump. |
Rebase needed. |
Rebased. |
Did some further testing, including a test of round-tripping various vectors through |
@Df458: Done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me now
@Wuzzy2 please rebase |
@Zughy: Rebase complete! |
Rebase done. Testing needed. |
@Wuzzy2 please either remove the label by yourself or quit from being a triager, this is not the first time it happens |
Follow-up PR for Minetest Game: #2992 |
Fixes #6194. @VanessaE. @paramat. @C1ffisme. @Sokomine.
This PR adds 2 paramtype2s:
4dir
andcolor4dir
.4dir
is likefacedir
, but only for 4 horizontal directions: NESW. It is identical in behavior tofacedir
otherwise. The reason why game makers would want to use this overfacedir
is 1) simplicity and 2) you get 6 free bits.It can be used for things like chests and furnaces and you don't need or want them to "flip them on the side" (like you could with facedir).
color4dir
is likecolorfacedir
, but you get 64 colors instead of only 8.Also, as with all color paramtype2s, the builtin functions were updated accordingly.
For details on how this works, see the commits (
lua_api.txt
). Documentation forfacedir
andwallmounted
is also updated to distinguish those better from4dir
.To do
This PR is ready for review.
Many test cases in DevTest were added which I used for testing in depth. I tested rotation (obviously), color, falling node, and all new nodes I added to DevTest. I also tested the new and modified builtin functions (but you should, too!). It all seems to work to me.
One thing I didn't test in depth is the prediction. I am not so sure if the placement prediction code is correct, please some verify the logic. I don't know how test this part. It would also help me if you have a hint for me on how I can test predition better (I think I basically need to simulate a lag or something ...).
How to test
Use DevTest and use the many 4dir nodes and the Param2 Tool to modify them. Compare with facedir param2 values 0 to 3, it MUST look the same.
Test if the nodes still look OK when falling (use Falling Node Tool).
Use DevTest and
luacmd
mod to test all the functions I modified.Use cases