Hives should work on fruit trees

Thoughts on the further development of Haven & Hearth? Feel free to opine!
User avatar
sabinati
Posts: 15527
Joined: Mon Jul 13, 2009 4:25 am
Location: View active topics

Re: Hives should work on fruit trees

Post by sabinati »

loftar wrote:Maybe the beehives themselves could cause decay hits on nearby trees, though.
yeah
ImpalerWrG
Posts: 470
Joined: Tue Feb 02, 2010 10:17 am

Re: Hives should work on fruit trees

Post by ImpalerWrG »

loftar wrote:The real reason why trees regenerate on decay hits rather than on a timer is because it allows me to save a ton of resources on the server, so I'm not too keen about changing that. Maybe the beehives themselves could cause decay hits on nearby trees, though.
I suspected as much but it's still a poor method for controlling it, if the hives cause decay hits they would need to be special trees specific decay hits or else the hive with literally cause disintegration of walls (can you imagine breaking through a wall by putting a dozen beehives next to it), and now your code is starting to get snarled and ugly with special cases.

Perhaps you should look to improving the object-timer code. If your looping over all objects and repeatedly incrementing or decrementing values ever tick I'd suggest moving to a model in which every time an object needs to start timing something it registers itself with a central manager which sorts objects by their desired wait time and each tick calls update functions only on objects that have had reached the elapsed time. It would probably be comparable to your current implementation and would feel a lot more natural for the player.
User avatar
loftar
Posts: 9096
Joined: Fri Apr 03, 2009 7:05 am
Location: Your character database

Re: Hives should work on fruit trees

Post by loftar »

ImpalerWrG wrote:I suspected as much but it's still a poor method for controlling it, if the hives cause decay hits they would need to be special trees specific decay hits or else the hive with literally cause disintegration of walls (can you imagine breaking through a wall by putting a dozen beehives next to it), and now your code is starting to get snarled and ugly with special cases.
Obviously, I meant that they would trigger the regeneration of trees in a way similar to decay hits -- not actually cause decay around themselves. :)

And you need not worry for my sake -- it wouldn't require any special cases. :)
ImpalerWrG wrote:If your looping over all objects and repeatedly incrementing or decrementing values[...]
God no. That would, obviously, not work. It's just that a timer requires more memory if it exists than if it doesn't. And in the current implementation of trees, it doesn't exist (and the trees, because of their numbers, are implemented in such a memory-efficient way that a timer would add quite a noticeable overhead in terms of bytes allocated).
"Object-oriented design is the roman numerals of computing." -- Rob Pike
User avatar
g1real
Posts: 881
Joined: Sun Aug 09, 2009 10:30 am
Location: You are now breathing manually.

Re: Hives should work on fruit trees

Post by g1real »

What about something that ticks every 5 minutes, checks all trees in the world for a value, and adds 1 whenever it isnt something higher then 6?
loftar: The inner chaos of the Jorbian mind is hard to conceal. :)
jorb: It's called creative license. You know, that thing you seem to want to apply to logic, grammar and coherence? :)
User avatar
sabinati
Posts: 15527
Joined: Mon Jul 13, 2009 4:25 am
Location: View active topics

Re: Hives should work on fruit trees

Post by sabinati »

yeah that would totally not kill the server there's only like a billion trees
Pacho
Posts: 712
Joined: Wed Jun 10, 2009 2:21 am

Re: Hives should work on fruit trees

Post by Pacho »

yeah, that's a pretty terrible way to go about it. It would be more sensible to go through the beehives instead, even then, its not very efficient.
User avatar
sabinati
Posts: 15527
Joined: Mon Jul 13, 2009 4:25 am
Location: View active topics

Re: Hives should work on fruit trees

Post by sabinati »

shouldn't be much more load than what's already happening with every beehive and crop already
User avatar
Ferinex
Posts: 1040
Joined: Sun May 31, 2009 9:05 am
Location: Miami

Re: Hives should work on fruit trees

Post by Ferinex »

it's something like 4.3 million trees if we did the math right on irc and if I'm remembering the right number
i guess they never miss huh
User avatar
sabinati
Posts: 15527
Joined: Mon Jul 13, 2009 4:25 am
Location: View active topics

Re: Hives should work on fruit trees

Post by sabinati »

and how did you arrive at that figure
User avatar
UnrealJake
Posts: 317
Joined: Sat Feb 13, 2010 11:22 am
Location: To your left, no your OTHER left.

Re: Hives should work on fruit trees

Post by UnrealJake »

On IRC
Lothaudus wrote:D) Try and get out of the boat and be told YOU NEED SWIMMING TO CROSS DEEP WATER.

Return to “Critique & Ideas”