[WIP] env_damage fires too often, sheep eat landscape #3434
No reviewers
Labels
No Label
#P1 CRITICAL
#P2: HIGH
#P3: elevated
#P4 priority: medium
#P6: low
#Review
annoying
API
bug
code quality
combat
commands
compatibility
configurability
contribution inside
controls
core feature
creative mode
delayed for engine release
documentation
duplicate
enhancement
environment
feature request
gameplay
graphics
ground content conflict
GUI/HUD
help wanted
incomplete feature
invalid / won't fix
items
looking for contributor
mapgen
meta
mineclone2+
Minecraft >= 1.13
Minecraft >= 1.17
missing feature
mobile
mobs
mod support
model needed
multiplayer
Needs adoption
needs discussion
needs engine change
needs more information
needs research
nodes
non-mob entities
performance
player
possible close
redstone
release notes
schematics
Skyblock
sounds
Testing / Retest
tools
translation
unconfirmed
mcl5
mcla
Media missing
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: VoxeLibre/VoxeLibre#3434
Loading…
Reference in New Issue
No description provided.
Delete Branch "emptyshore:sheep_destroy_landscape"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
A quick look at MineClone2/MineClone2#3428
env_damage is executed every on_step without the regards to the timer.
The code assumes it executes once per second.
Add the missing timer check to make the handler execute every 1s.
Essentially, the check for eating grass runs constantly - when I dumped the log, the d20 dice roll (replace_rate=20) happens every 0.05s, which I presume is the on_step cadence, so with the sheep's replace_rate of 20, the eating rate is about one block per
20*0.05s = 1s
- one block per second. Which is about equal to what I see - I can draw a dirt line with a sheep and a piece of wheat :)This is just a sketch. Things to figure out:
346a3e75ca
to7fb98efb30
7fb98efb30
toa5f7ffd905
a5f7ffd905
toa7494584db
I've already self-assigned this and commented. Why did you pick this up?
Merge conflict issue. My mistake. Picked up on my branch.
There was a timer it seems, that was called timer, and used for attack and labelled as attack time, even thought it was used for multiple other things. It would exit out of the mob_step and everything after that would stop processing. I've noticed historically this has broken many things.
I restructured to ensure all damage dealing code was at the start and to escape if a mob died. This was to avoid a number of crashes we've had historically. It unfortunately dropped out the timer.
The timer was used in a few places, and I'm thinking of the best way to cover all those cases without having a weird and illogical structure to the code. Some things were done that wasn't explicit, so I'm thinking of the best way to make this clearer.
I appreciated the enthusiasm, analysis and investigation, but will close in favour of as there was a few more pieces to factor in and the work was already in progress:
MineClone2/MineClone2#3435
You were bang on the money though, so good work, and the initiative is appreciated.
All g to close, at least some good came of it!
Pull request closed