Saplings and Seeds - #2585
Conversation
|
Why do some of them decay instantly? |
I think it's because default tree generation creates too many leafs, and they then instantly decay because their are too far away from a branch/log |
|
Are you sure that's the case? |
oh you mean, sometimes leafs are generated before stems are generated? |
|
yes |
|
I think this is a general problem with the Blueprint.paste() function, so I think It's better to fix that in a separate PR. |
IntegratedQuantum
left a comment
There was a problem hiding this comment.
There are some flaws with your approach. Instead of unnecessarily trying to bend your code around the terrain generation system, I'd suggest to directly reference the underlying SBB.
|
One problem i have, is that It feels too laggy if you have too many trees growing at once, Maybe the way we paste Blueprint has to be optimized. (Btw does someone know why the check failed) |
You get a recursion of imports through |
Well, if you have a performance problem: Measure it. If the problem is mesh light sampling then #2405 might help improve it a bit. Other than that, there is a good chance that it's just the light updates. |
|
I think the lagg spikes are soo big, that i dont really need to meassure something:
also thanks @Wunka for the tip |
The measuring is to figure out what exactly is responsible for this. And I doubt that it's the blueprint pasting. |
| .drops = .{ | ||
| .{.items = .{.auto}, .allowedToolTags = .{.cuttable}}, | ||
| .{.chance = 0.01, .items = .{"cubyz:apple"}, .forbiddenToolTags = .{.cuttable}}, | ||
| .{.chance = 0.001, .items = .{"cubyz:sapling/oak"}, .forbiddenToolTags = .{.cuttable}}, |
There was a problem hiding this comment.
How many leaf blocks are there in a tree?
There was a problem hiding this comment.
probably less then 1000
There was a problem hiding this comment.
It would be nice to have those numbers, I think for all saplings the number of saplings per tree should be consistent.
There was a problem hiding this comment.
feel free to count them
There was a problem hiding this comment.
also the amount of leaves varies because of the generation
|
How close are we to having saplings with growth stages that have different models? |
|
Nowhere close |
|
requires: #3043 |
|
good news: no problem on client side |
it depends. but more complex stuff isn't possible with this yet. (like checking if the sugar cane isn't too big already (well technically it is possible, but it wouldn't be nice to implement), or removing a bigger SBB with a smaller SBB afterwards) |
|
do you have any clue why the server is dieing? |
even in release? |
its better in release.
|
|
There was an issue in chunk saving, it always saved it immediately instead of waiting 5 seconds in case other changes happened. |
|
yes, this is #3250, it should at least be a little better though. |
|
When I was testing this, I also noticed that the roots are replacing all ground blocks, instead of checking for decayable. |
I assume you meant degradeable? |
| pos[1] = chunk.super.pos.wy + pastePosition[1]; | ||
| pos[2] = chunk.super.pos.wz + pastePosition[2]; | ||
|
|
||
| rotated.blueprint.paste(pos, .{.replaceUndegradable = false}); |
There was a problem hiding this comment.
Should be configurable via self.placeMode, like when placed in generation.
| pub const generationMode = .floor; | ||
|
|
||
| const SbbGen = @This(); | ||
| pub const SbbGen = @This(); |
There was a problem hiding this comment.
It makes no sense to make this public
|
|
||
| /// Returns the actual block on failure | ||
| pub fn cmpxchgBlock(self: *ServerWorld, wx: i32, wy: i32, wz: i32, oldBlock: ?Block, _newBlock: Block) ?Block { | ||
| pub fn cmpxchgBlock(self: *ServerWorld, wx: i32, wy: i32, wz: i32, oldBlock: ?Block, _newBlock: Block, comptime noUpdate: bool) ?Block { |
There was a problem hiding this comment.
Please use an enum to improve reasability at the callsite
|
I think I will look into taking over this PR soon, after I'm done with #3446 |




output.mp4
Be able to to add saplings, and other structures growable structures.
.{ .. .onTick = .{ .type = .sapling, .structures = .{ .{ .id = "cubyz:sbb", .structure = "cubyz:tree/oak/white", // what structure should be grown? .placeMode = .degradable, .chance = 0.03, // chance, that tick will cause this to grow }, // other alternative structures, this sapling can grow into }, }, .. }