RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Lumber Harvesting Overhaul

Praxiiz

Sorceror
This is going to be a new lumber harvesting system that builds on UltimaLive. Please add your ideas and feedback.

The idea is simple. I would like a system where players actually chop down the trees and they disappear. A map has countless trees in it. To add them all as dynamic items or as dynamic statics would waste a lot of memory considering RunUO already stores that information in the statics file. So to avoid tracking millions of tree objects, I am thinking that the system would just use information stored in the statics files and use UltimaLive to update it.

A sequence could go something like this:


A tree progresses from stage 1 to stage 3 exactly as shown. Stages 4 to 6 can be done in any order, and results in a bundle of logs on the ground, which is a dynamic item that can be picked up.
Once a tree reaches stage 6, it is gone permanently.

That's the basic idea, now the next part is where things get a bit interesting. Once the tree is gone, how do new trees get introduced into the world? The server could keep a simple count of destroyed trees and replenish them every day or every world save. That would ensure there is always a good amount of trees in the world.

Another idea is to have players plant trees, or have some kind of other event that introduces new saplings into the world. I think it's important to avoid having the server track tons of tree states or iterating over the entire map file to update the trees as they grow.
 

_Epila_

Sorceror
When the tree is gone, store the tree id and location in a simple struct in a list or in a file, and from time to time (save/periodic/timer) the server spawn the firsts elements of the list in the same location as the old tree. No needs to track every item, when the player uses the axe on some tree, by now this tree is part of the new lumber system, otherwise the tree will not be tracked

I don't feel safe with the dynamic tree placing, just imagine you chop every tree in southern Minoc, it is a small amount of tree and they can spawn everywhere, leving Minoc out of trees. Unless the system contains a bunch of well elaborated rules (region based/heat map/etc) of tree placement, I still prefer spawning the trees in the same location as the older
 

Praxiiz

Sorceror
Potentially the wood types could be stored in the form of hues, but it would have to be done tastefully or a shard could end up looking like a rainbow. Also the areas that are chopable could be controlled by region or even by map ID.
The tree progression would basically start with a sapling and mature to a full tree, although there aren't many stages of trees that can be leveraged with existing graphics.


_Epila_ said:
I don't feel safe with the dynamic tree placing, just imagine you chop every tree in southern Minoc, it is a small amount of tree and they can spawn everywhere, leving Minoc out of trees. Unless the system contains a bunch of well elaborated rules (region based/heat map/etc) of tree placement, I still prefer spawning the trees in the same location as the older

RunUO could iterate over all the maps once per day, adding growth and new saplings. The system really would need a knowledge of the biomes to grow new trees. Without the biomes, the locations would have to be tracked and trees placed in the same location you suggest.

Although the system could use regions to track biomes if the regions were modified to track that information. This may be good so that you could mark a region to disable the destructible trees.
 

Praxiiz

Sorceror
Initially the wood types could alternatively be linked to the tree graphic, although that information would be lost at stage 3.

It should definitely be a requirement that there is an option to have dynamic spawning of trees and also an option to place trees in the same location.
 

_Epila_

Sorceror
Letting aside how the trees would be spawned (I need to think about it before posting again), there is another problem. Imagine that one of your players harvest a small area then build a house in this area, there will be less space for new trees. This is a small scale factor, I mean, how many houses your server must have to completely devastate the forests? Even knowing that the complete devastation would be really hard to achieve there is room for it, this must be pointed out. Locking the regions would make the house placing unrealistic for empty spaces
 

Praxiiz

Sorceror
Players being able to clear the trees to place houses can be thought of as a feature or a disadvantage depending on the shard. It's really going to depend on how a shard is setup.

Destructible trees could be enabled/disabled by region. Placing houses of course could be enabled / disabled by region. The difficulty of chopping down a tree could also be factored in. For some wood types, it may take a significant amount of time to chop down.

If a shard really doesn't want players placing houses after they've cleared a forested region, the system could designate a specific tree graphic that wouldn't be harvestable. It couldn't be chopped down or destroyed. Interleaving those trees could prevent players from dropping a house in a cleared area, or at the very least, reduce the size of an area that can be cleared.

Here's a first cut at what the hues could look like:

Keep in mind that I am a big fan of Daat99's OWLTR system. Out of pure laziness, I have used the same tree graphic for all the hues. In the actual implementation, the wood types would be limited to particular graphics. For example, bamboo wouldn't use that graphic. Also the more extreme colors toward the end (heart, frost, and bloodwood) would be much more rare than the other types. So players wouldn't see them very often.

If a shard wants to hide the type of tree so that players can't run around just grabbing the rare ones, the system could be adjusted so that the hues aren't added until stage 3, at which time they would be randomly determined.
 

HellRazor

Knight
This would be awesome, and some of the code used could possibly be re-purposed for things like sieges/burning buildings, etc.

One thing I'd recommend, just to add to realism, would be to leave the tree stumps behind. It would be neat to be able to tell where someone has been harvesting the trees or has cleared a forest! :)
 

Praxiiz

Sorceror
This would be awesome, and some of the code used could possibly be re-purposed for things like sieges/burning buildings, etc.

One thing I'd recommend, just to add to realism, would be to leave the tree stumps behind. It would be neat to be able to tell where someone has been harvesting the trees or has cleared a forest! :)

I like that idea. For shards wanting to let players clear areas for housing, you could require a greater explosion potion to remove the stump.
 

Miracle99

Squire
Praxiiz,

This is very cool. One comment though. Currently people can place a house when there is 1 free space next to a tree. What happens if there is a house and the "fallen tree" would basically land on the house.

The idea though for your project is awesome. I am sure we have all been there in our times on OSI back in the day and we looked at that one tree and thought "Damn if that wasnt there i could place xxx house"
 

Praxiiz

Sorceror
Currently I'm not checking for nearby objects, but that is an easy thing to add. Right now I'm not accounting for direction either. Since there are two different fallen log sets, I would like to take into account the position of the player relative to the tree and make the tree fall in the opposite direction.

If there is an object in the way, either that portion of the fallen tree would not be created, or it could be deflected to a nearby empty space.
 

pooka01

Sorceror
There is a leaf pile itemid, so you could even add that when the tree falls instead of removing those when cutting?
 

Praxiiz

Sorceror
I couldn't come up with anything useful to do with leaves. I'd like to add something like the leaf piles, I guess they could be added like blood is currently done: they could be dynamic items that l fade and disappear after a short while. That might be a nice effect if done well.

What ItemID are the leaf piles?
 

pooka01

Sorceror
What about bushes ending into brambles? And leaves that follow seasons? ;D
Honestly i love that idea...

Btw*
What about jungle trees? maybe some more logs on the floor at random positions aswell as branch itemids? tell me if you need the static number ;D
 

Praxiiz

Sorceror
What about bushes ending into brambles? And leaves that follow seasons? ;D
Honestly i love that idea...

Btw*
What about jungle trees? maybe some more logs on the floor at random positions aswell as branch itemids? tell me if you need the static number ;D

The system will already handle the bushes to brambles. I've made it very customizable, you just have to go in and define a couple phases that include the bush graphics, the resources they provide (if any), and the transition between phases.

As for the large jungle trees, you can define any graphics you want. Currently I've been experimenting using a big pile of sticks that gets hued to the wood type.


I am not making any assumptions about any of the graphics. People will be able to go in and define them however they want. I've made the system very flexible. In its current form, it wouldn't be much work to expand it to other map based harvesting systems.
 

Praxiiz

Sorceror
As I build up the tree regeneration part of this system, I am considering how the system will actually spawn trees.

The options as I see it are:
  • The system tracks tree location and tree type and respawns them automatically according to the type and location
  • The system spawns trees according to a list of allowable tree types that would be stored for each applicable region, and either does it at a stored location, or picks a random valid locatoin
I am also looking at permissions by region for enabling the system. An axe that is used in a region that has this system enabled will use it and chop down the trees. In a region without this system enabled, an axe would default back to the normal non-destructive lumberjacking harvest system.

Does anyone have a preference whether I use stock regions and require shard owners to modify them, or have shard owners use and modify Custom Regions in a Box? I personally like the Regions in a Box script because it is dynamic and GUI based, but if there are people who don't use it, then I can provide support for using the regular regions.
 

HellRazor

Knight
I think it would be better to not tie the system to a 3rd party script (unless it was only provided as an option, with the option of using default RUO regions also available).
 
Top