Dynamic Trees TFC

Dynamic Trees TFC

445k Downloads

Player-Planted Trees Appear Flattened and Identical

izharus opened this issue ยท 3 comments

commented

Player-Planted Trees Appear Flattened and Identical

Issue Description

  • Minecraft Version: 1.20.1
  • Dynamic Trees Version: 1.3.6
  • Dynamic Trees TFC Version: 2.0.1

Player-planted trees are not growing properly.

Observed Behavior

  • Trees generated naturally in the world look fine and retain their unique features.
  • Some trees planted by players, however, appear identical, flattened, and visually strange.

Expected Behavior

Player-planted trees should grow with the same variety and characteristics as naturally generated trees.

Steps to Reproduce

  1. Generate a new world with the above versions of the mods.
  2. Plant and grow Douglas Fir as a player.
  3. Find Douglas Fir in the world.

Additional Notes

  • This behavior does not affect all tree types, but only certain species.
  • I am willing to provide a complete list of affected tree types if the developer is ready to investigate and address this issue.

Attachments

  • Naturally generated tree and player-planted tree (Douglas Fir):
    image
commented

Thanks for the report! The issue here is the tree growth parameters in https://github.com/Gaelmare/dynamictreestfc/blob/1.20.x/resources/trees.py do not correctly build the
https://github.com/Gaelmare/dynamictreestfc/blob/1.20.x/src/main/resources/trees/dttfc/species/douglas_fir.json
file with good parameters that match the precompiled "JOCode" for worldgen trees of the same species.

In general, the tree growth parameters in DTTFC may or may not match the JOCode library. The JOCode library can be rebuilt using these DT tools as described here: https://github.com/DynamicTreesTeam/DynamicTrees/wiki/Tree-Packs:-Jocodes. If the growth parameters are wrong, that won't help.

If you would like to contribute, please consider making a PR to update the trees.py file to set the growth parameters to match the JOCodes. The https://github.com/Gaelmare/dynamictreestfc/blob/1.20.x/JOCODE_CREDITS.txt is mostly correct about where the tree shapes came from, and we should be able to track down the growth parameters from those sources.

My analysis of the JOCode files shows:
Kapok=DT Vanilla Jungle
Mangrove=DT Vanilla Mangrove without a trailing newline at EOF
Acacia=DT Vanilla Acacia
Palm=DT BYG Palm
Ash/Aspen/Birch/Hevea=DT Vanilla Birch (yes, Hevea is from IE/TFC IE Compat, does no harm to include)
Douglas Fir=DT Vanilla Mega Spruce
Maple=DT BOP Mahogany
Blackwood/Chestnut/Hickory/Rosewood=DT Vanilla Dark Oak
Oak/Willow=DT Vanilla Oak
Pine/Sequoia/Spruce/Sycamore/White Cedar=DT Vanilla Spruce

If you wanted to correct the JOCODE_CREDITS.txt file as well in your PR, feel free.

Thanks for caring enough to file this! Let me know how much you want to contribute.

commented

Thank you for the detailed response. I will try modifying trees.py, and if everything works correctly, I'll create a PR.

commented

It looks like the *rm.resource_dir argument is unnecessary here: link. In the rm.write method, self.resource_dir is already being added at the beginning of the path (at least that's the case with Python 3.10). Moreover, unpacking a string that contains a path in this context seems odd. If necessary, I can create a PR for this fix as well.