ITEMS/mcl_farming: Move farming plant nodes 1/16 downwards #293

Merged
erlehmann merged 3 commits from move-farming-plants-lower into master 2022-05-01 00:01:31 +02:00
Owner
Problem

TRACKING ISSUE: #286

Currently, plants and stems from mcl_farming are rendered within the boundaries of a standard node. As farming soil has a node height of 15/16, this means there exists a 1/16 nodes high gap between plants and farming soil.

Solution

This patchset shifts the visual appearance of plants and stems from mcl_farming and their selection boxes so that they appear 1/16 lower.

Details

The result was achieved with nodeboxes that imitate plantlike grid (#) and plus (+) node rendering. Textures were shifted 1px downwards in the node definition by means of texture modifiers. Some plants seem rotated by 1/8 of a full circle (45 degrees) because nodeboxes can not be rotated to match the previous plantlike rendering.

Testing Steps
Verify Bug
  1. Enter a world with Minetest 5.4+ on Mineclonia commit de8ea11b3967cb5b91951db80b1b865dda07b454 (oldest commit on branch move-farming-plants-lower).
  2. Execute the command /generate_farming_plant_rows.
  3. Verify that no nodes were generated near you and you get an error about a missing privilege.
  4. Execute the command /grantme debug.
  5. Execute the command /generate_farming_plant_rows.
  6. Verify that plant and stem nodes above farming soil and glass are generated near you.
  7. Verify that all plant and stem nodes have the aforementioned 1/16 node gap under them when above farming soil and no gap on them when above glass.
Verify Patch
  1. Enter a world with Minetest 5.4+ on Mineclonia commit 0808b5419282a530bfc5a62ef0718a9f4f0e1189 (newest commit on branch move-farming-plants-lower).
  2. Execute the command /grantme debug.
  3. Execute the command /generate_farming_plant_rows.
  4. Verify that plant and stem nodes above farming soil and glass are generated near you.
  5. Verify that all plant and stem nodes that were generated have no visible gap under them when above farming soil and reach 1/16 of a node (1 pixel) into the node below them when above glass.
  6. Verify that all the selection boxes match the visual appearance of the nodes and start directly above the farming soil.
To do
Debug Command
  • Add command to spawn plants and stems from mcl_farming on farming soil and glass
Common Functions
  • Add function to generate plantlike grid (#) nodebox moved 1/16 downwards
  • Add function to generate plantlike plus (+) nodebox moved 1/16 downwards
  • Add function to create modified texture for plantlike nodebox
Beetroot
  • Apply plantlike grid (#) nodebox to beetroot nodes
  • Lower selection box of beetroot nodes by 1/16 nodes
  • Shift beetroot nodes' textures 1px downwards
Carrots
  • Apply plantlike grid (#) nodebox to carrots nodes
  • Lower selection box of carrots nodes by 1/16 nodes
  • Shift carrots nodes' textures 1px downwards
Potatoes
  • Apply plantlike grid (#) nodebox to potatoes nodes
  • Lower selection box of potatoes nodes by 1/16 nodes
  • Shift potatoes nodes' textures 1px downwards
Wheat
  • Apply plantlike grid (#) nodebox to wheat nodes
  • Lower selection box of wheat nodes by 1/16 nodes
  • Shift wheat nodes' textures 1px downwards
  • Add selection box for 1 node high wheat nodes
Melon Stems
  • Apply plantlike plus (+) nodebox to melon stem nodes
  • Lower selection boxes of melon stem nodes
Pumpkin Stems
  • Apply plantlike plus (+) nodebox to pumpkin stem nodes
  • Lower selection boxes of pumpkin stem nodes
Unconnected Gourd Stems
  • Apply plantlike plus (+) nodebox to unconnected gourd stem nodes
  • Lower selection boxes of unconnected gourd stem nodes
  • Shift textures of unconnected gourd stem nodes 1px downwards
Connected Gourd Stems
  • Shift nodeboxes of connected gourd stem nodes 1/16 nodes downwards
  • Lower selection boxes of connected gourd stem nodes
  • Shift textures of connected gourd stem nodes 1px downwards
##### Problem TRACKING ISSUE: https://git.minetest.land/Mineclonia/Mineclonia/issues/286 Currently, plants and stems from mcl_farming are rendered within the boundaries of a standard node. As farming soil has a node height of 15/16, this means there exists a 1/16 nodes high gap between plants and farming soil. ##### Solution This patchset shifts the visual appearance of plants and stems from mcl_farming and their selection boxes so that they appear 1/16 lower. ##### Details The result was achieved with nodeboxes that imitate plantlike grid (#) and plus (+) node rendering. Textures were shifted 1px downwards in the node definition by means of texture modifiers. Some plants seem rotated by 1/8 of a full circle (45 degrees) because nodeboxes can not be rotated to match the previous plantlike rendering. ##### Testing Steps ###### Verify Bug 1. Enter a world with Minetest 5.4+ on Mineclonia commit `de8ea11b3967cb5b91951db80b1b865dda07b454` (oldest commit on branch `move-farming-plants-lower`). 2. Execute the command `/generate_farming_plant_rows`. 3. Verify that no nodes were generated near you and you get an error about a missing privilege. 4. Execute the command `/grantme debug`. 5. Execute the command `/generate_farming_plant_rows`. 6. Verify that plant and stem nodes above farming soil and glass are generated near you. 7. Verify that all plant and stem nodes have the aforementioned 1/16 node gap under them when above farming soil and no gap on them when above glass. ###### Verify Patch 1. Enter a world with Minetest 5.4+ on Mineclonia commit `0808b5419282a530bfc5a62ef0718a9f4f0e1189` (newest commit on branch `move-farming-plants-lower`). 2. Execute the command `/grantme debug`. 3. Execute the command `/generate_farming_plant_rows`. 4. Verify that plant and stem nodes above farming soil and glass are generated near you. 5. Verify that all plant and stem nodes that were generated have no visible gap under them when above farming soil and reach 1/16 of a node (1 pixel) into the node below them when above glass. 6. Verify that all the selection boxes match the visual appearance of the nodes and start directly above the farming soil. ##### To do ###### Debug Command - [x] Add command to spawn plants and stems from `mcl_farming` on farming soil and glass ###### Common Functions - [x] Add function to generate plantlike grid (#) nodebox moved 1/16 downwards - [x] Add function to generate plantlike plus (+) nodebox moved 1/16 downwards - [x] Add function to create modified texture for plantlike nodebox ###### Beetroot - [x] Apply plantlike grid (#) nodebox to beetroot nodes - [x] Lower selection box of beetroot nodes by 1/16 nodes - [x] Shift beetroot nodes' textures 1px downwards ###### Carrots - [x] Apply plantlike grid (#) nodebox to carrots nodes - [x] Lower selection box of carrots nodes by 1/16 nodes - [x] Shift carrots nodes' textures 1px downwards ###### Potatoes - [x] Apply plantlike grid (#) nodebox to potatoes nodes - [x] Lower selection box of potatoes nodes by 1/16 nodes - [x] Shift potatoes nodes' textures 1px downwards ###### Wheat - [x] Apply plantlike grid (#) nodebox to wheat nodes - [x] Lower selection box of wheat nodes by 1/16 nodes - [x] Shift wheat nodes' textures 1px downwards - [x] Add selection box for 1 node high wheat nodes ###### Melon Stems - [x] Apply plantlike plus (+) nodebox to melon stem nodes - [x] Lower selection boxes of melon stem nodes ###### Pumpkin Stems - [x] Apply plantlike plus (+) nodebox to pumpkin stem nodes - [x] Lower selection boxes of pumpkin stem nodes ###### Unconnected Gourd Stems - [x] Apply plantlike plus (+) nodebox to unconnected gourd stem nodes - [x] Lower selection boxes of unconnected gourd stem nodes - [x] Shift textures of unconnected gourd stem nodes 1px downwards ###### Connected Gourd Stems - [x] Shift nodeboxes of connected gourd stem nodes 1/16 nodes downwards - [x] Lower selection boxes of connected gourd stem nodes - [x] Shift textures of connected gourd stem nodes 1px downwards
erlehmann force-pushed move-farming-plants-lower from 8ad8b73c6a to 6ab2cab46e 2022-04-18 17:47:39 +02:00 Compare
erlehmann force-pushed move-farming-plants-lower from 6ab2cab46e to d341c198be 2022-04-18 18:01:00 +02:00 Compare
erlehmann force-pushed move-farming-plants-lower from d341c198be to 93810787ce 2022-04-18 18:19:13 +02:00 Compare
erlehmann force-pushed move-farming-plants-lower from 93810787ce to 6e7589f51c 2022-04-18 18:37:41 +02:00 Compare
erlehmann force-pushed move-farming-plants-lower from 6e7589f51c to f826c8ba99 2022-04-18 18:41:02 +02:00 Compare
erlehmann force-pushed move-farming-plants-lower from f826c8ba99 to 53e8aa6aa3 2022-04-18 18:43:07 +02:00 Compare
erlehmann force-pushed move-farming-plants-lower from 53e8aa6aa3 to 61a5f13239 2022-04-18 18:48:54 +02:00 Compare
erlehmann force-pushed move-farming-plants-lower from 61a5f13239 to 56f8fa3b30 2022-04-18 19:03:26 +02:00 Compare
erlehmann force-pushed move-farming-plants-lower from 56f8fa3b30 to 37ff2515ad 2022-04-18 19:08:07 +02:00 Compare
erlehmann force-pushed move-farming-plants-lower from 37ff2515ad to 2d951a228e 2022-04-18 19:38:04 +02:00 Compare
erlehmann force-pushed move-farming-plants-lower from 2d951a228e to e3131859dd 2022-04-18 21:01:38 +02:00 Compare
erlehmann force-pushed move-farming-plants-lower from e3131859dd to dc88088fd9 2022-04-18 21:02:21 +02:00 Compare
erlehmann force-pushed move-farming-plants-lower from dc88088fd9 to b13f576000 2022-04-18 21:21:45 +02:00 Compare
erlehmann force-pushed move-farming-plants-lower from b13f576000 to cd0dfcf1c0 2022-04-18 22:33:51 +02:00 Compare
Author
Owner

IMO this PR is basically done except for testing/verification instructions/hints.

IMO this PR is basically done except for testing/verification instructions/hints.
erlehmann changed title from WIP: ITEMS/mcl_farming: Move farming plant nodes 1/16 downwards to ITEMS/mcl_farming: Move farming plant nodes 1/16 downwards 2022-04-20 01:32:03 +02:00
erlehmann requested review from Li0n_2 2022-04-20 01:32:26 +02:00
erlehmann added the
ready for review
label 2022-04-20 01:32:40 +02:00
Member

after some testing, I found the following problems:

  1. the heights of the bounding boxes are very inconsistent. someone should look up what the rules for the bounding boxes are in minecraft
  2. it seems all mineclonia farming crops have an X shape, this patch changes them all to # shape, which aligns more with the miencraft canon, but I wonder why they were X shaped in the first place. I will check the git history.
after some testing, I found the following problems: 1. the heights of the bounding boxes are very inconsistent. someone should look up what the rules for the bounding boxes are in minecraft 2. it seems all mineclonia farming crops have an X shape, this patch changes them all to # shape, which aligns more with the miencraft canon, but I wonder why they were X shaped in the first place. I will check the git history.
Author
Owner

it seems all mineclonia farming crops have an X shape, this patch changes them all to # shape, which aligns more with the miencraft canon, but I wonder why they were X shaped in the first place. I will check the git history.

It turns out that by removing the place_param2 from plants, going to an earlier version makes plants have an X shape instead of a grid (#) shap. I think I have to add the lines back!

> it seems all mineclonia farming crops have an X shape, this patch changes them all to # shape, which aligns more with the miencraft canon, but I wonder why they were X shaped in the first place. I will check the git history. It turns out that by removing the `place_param2` from plants, going to an earlier version makes plants have an X shape instead of a grid (#) shap. I think I have to add the lines back!
erlehmann changed title from ITEMS/mcl_farming: Move farming plant nodes 1/16 downwards to WIP: ITEMS/mcl_farming: Move farming plant nodes 1/16 downwards 2022-04-20 02:47:28 +02:00
erlehmann removed the
ready for review
label 2022-04-20 02:47:37 +02:00
erlehmann force-pushed move-farming-plants-lower from cd0dfcf1c0 to 0808b54192 2022-04-21 02:46:19 +02:00 Compare
erlehmann changed title from WIP: ITEMS/mcl_farming: Move farming plant nodes 1/16 downwards to ITEMS/mcl_farming: Move farming plant nodes 1/16 downwards 2022-04-25 22:54:35 +02:00
Author
Owner

place_param2 is now kept, mainly to keep the possibility of returning to an improved plantlike drawtype it some unspecified point in the future where it can render plantlike nodes lowered by 1/16 of a node. I have added a comment so that future developers keep the place_param2, even though it seems useless at first glance.

Keeping place_param2 like this also means the Mineclonia version of mcl_farming is entirely compatible with Mineclone2 version of mcl_farming and each of them can be a replacement for the other.

`place_param2` is now kept, mainly to keep the possibility of returning to an improved plantlike drawtype it some unspecified point in the future where it can render plantlike nodes lowered by 1/16 of a node. I have added a comment so that future developers keep the `place_param2`, even though it seems useless at first glance. Keeping `place_param2` like this also means the Mineclonia version of `mcl_farming` is entirely compatible with Mineclone2 version of `mcl_farming` and each of them can be a replacement for the other.
erlehmann added the
ready for review
label 2022-04-25 23:43:52 +02:00
Li0n_2 approved these changes 2022-04-30 15:09:27 +02:00
Li0n_2 left a comment
Member

I followed the testing instructions. I havent found any additional bugs related to this patch. I did find that the selection boxes do not match the textures, but I opened a separate issue about it because it is not caused by this patch #295

I followed the testing instructions. I havent found any additional bugs related to this patch. I did find that the selection boxes do not match the textures, but I opened a separate issue about it because it is not caused by this patch https://git.minetest.land/Mineclonia/Mineclonia/issues/295
erlehmann merged commit 54f72a1457 into master 2022-05-01 00:01:30 +02:00
erlehmann deleted branch move-farming-plants-lower 2022-05-01 00:02:08 +02:00
This repo is archived. You cannot comment on pull requests.
No description provided.