yeahloftar wrote:Maybe the beehives themselves could cause decay hits on nearby trees, though.
-
sabinati
- Posts: 15527
- Joined: Mon Jul 13, 2009 4:25 am
- Location: View active topics
Re: Hives should work on fruit trees
-
ImpalerWrG
- Posts: 470
- Joined: Tue Feb 02, 2010 10:17 am
Re: Hives should work on fruit trees
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.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.
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.
-
loftar
- Posts: 9096
- Joined: Fri Apr 03, 2009 7:05 am
- Location: Your character database
Re: Hives should work on fruit trees
Obviously, I meant that they would trigger the regeneration of trees in a way similar to decay hits -- not actually cause decay around themselves. :)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.
And you need not worry for my sake -- it wouldn't require any special cases. :)
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).ImpalerWrG wrote:If your looping over all objects and repeatedly incrementing or decrementing values[...]
"Object-oriented design is the roman numerals of computing." -- Rob Pike
-
g1real
- Posts: 881
- Joined: Sun Aug 09, 2009 10:30 am
- Location: You are now breathing manually.
Re: Hives should work on fruit trees
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?
jorb: It's called creative license. You know, that thing you seem to want to apply to logic, grammar and coherence?
-
sabinati
- Posts: 15527
- Joined: Mon Jul 13, 2009 4:25 am
- Location: View active topics
Re: Hives should work on fruit trees
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
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.
-
sabinati
- Posts: 15527
- Joined: Mon Jul 13, 2009 4:25 am
- Location: View active topics
Re: Hives should work on fruit trees
shouldn't be much more load than what's already happening with every beehive and crop already
-
Ferinex
- Posts: 1040
- Joined: Sun May 31, 2009 9:05 am
- Location: Miami
Re: Hives should work on fruit trees
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
-
sabinati
- Posts: 15527
- Joined: Mon Jul 13, 2009 4:25 am
- Location: View active topics
Re: Hives should work on fruit trees
and how did you arrive at that figure
-
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
On IRC
Lothaudus wrote:D) Try and get out of the boat and be told YOU NEED SWIMMING TO CROSS DEEP WATER.