Have Landblocks load all scenery during start up and store it for use in the physics engine. #642
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Here is the first attempt at the landscape scenery generation. It's performing the same calculations that the original client does to build the scenery objects, although it's still not matched up perfectly yet.
The scenery is defined on a per-cell basis, which gets mapped through the region file to the actual scenery data. Instead of placing individual shrubs and trees on each cell though, the game uses something akin to perlin noise generation to move scenery objects around the grid in a non-uniform way.
https://imgur.com/a/wyQRt
Todo:
It appears there is more scenery generated than the original game, even though the functions should be matched up exactly with the client. I will need to investigate more to find out what could be causing any differences.
Scenery items should not spawn on roads or anywhere near other objects. The collision detection is currently just using a basic bounding box, but in acclient this is performed by the physics engine.
Scenery items should also not be placed on steep terrain that can't be traversed by the player. This should ideally be done by storing normals for each triangle in the landscape mesh, and performing the slope checks based on that.