[WF-General] SV: fruits in trees

Erik Hjortsberg erik.hjortsberg at iteam.se
Thu Mar 29 13:15:46 PST 2007

Yep, having forests and fields generated by Mercator using an dispersion algorithm is something we've discussed before and something that I really feel needs to be done.
In this case however I didn't consider the client representation at all, I was more concerned with how the server logic handled the fruits. Looking through the code I also wonder about how the energy system is designed. Is there a common mechanism for energy flows, or is it up to each entity to handle the energy flow, allowing arbitrary energy to be created if so needed?


-----Ursprungligt meddelande-----
Från: Alistair Riddoch [mailto:alriddoch at googlemail.com]
Skickat: to 2007-03-29 22:45
Till: Erik Hjortsberg
Kopia: general at mail.worldforge.org
Ämne: Re: fruits in trees
On 27/03/07, Erik Hjortsberg <erik.hjortsberg at iteam.se> wrote:
> Currently  in trees the fruits are handled as a "fruits" counter, and randomly dropped.
> Wouldn't it  make more sense to instead spawn fruit entities from the start, which start out
> with a low status. The fruits are located within the tree. Each tick  energy is transferred to
> the acorns. As their status approaches 1.0 their chance  of falling from the tree also
> increases.

I think this is a bad way to go.

Modelling so many things just cannot scale. The increased traffic to
the client, and the load of the server just cannot work. Years ago I
made a very rough start on a way to deal with this kind of problem in
Mercator in the forest class. What I would like to do is come up with
generic way to describe a random distribution of entities in a given
space, and embed the pseudo-random algorithm in Mercator. Just as the
current code can be used to generate the data required to render a
forest of tress scattered over an area, it should also be possible to
describe that a certain number of fruit entities are randomly
scattered across a volume which roughly encompasses the trees canopy.
The client can then render the exact number of fruits in know
locations on the tree, the server physics can model whether the fruit
is close enough to the ground to be picked reliably, and no more
network bandwidth is required than the scheme we have currently.
Related techniques could be used to describe a field full of
vegetables, rather than the well coded but totally unscalable way we
have handled fields of vegetables just recently.

How does that sound?

Alistair Riddoch
alriddoch at zepler.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.worldforge.org/pipermail/general/attachments/20070329/26fc0267/attachment.html

More information about the General mailing list