Topic: Tile Functions for Gamma
I've had the chance to mess around with the single tile terraforming for a bit now and I enjoy it quite a bit. There are a few issues with it though that will need to be changed for the new maximum slope allowances for players. Also the "smoother" function changes the terrain too aggressively compared to the other tile changers.
A general idea of how I think the system should work is:
Raiser/Lowerer: All vertices inside the target area are raised/lowered by a set value (lets call just call this value "y units"). All changed vertices must adhere to the Vertex Slope Check.
Flattener: An average of the 4 vertices on the center tile of the target zone is calculated. All vertices inside the target zone approach this average by a maximum of "y units". All changed vertices must adhere to the Vertex Slope Check.
Smoother: A "perfect" smoothing endpoint is calculated for every vertex inside the target area (that doesn't allow for the maximum slope allowances given to players). Every vertex inside the target area is adjusted by a maximum of "y units" to approach this "perfect" smoothing endpoint. All changed vertices must adhere to the Vertex Slope Check.
Vertex Slope Check: For any vertex that changes height the initial slope and after slope must be calculated for all adjacent vertices. The after slope must be less than or equal to the initial slope or be less than or equal to the maximum slope that a player can create.
I also think there should be 3 sizes of charges for each function (but at the very least all variations of the tile changers should have a size that will only affect 1 tile):
1 tile: Target area will affect the height of the 4 vertices on the selected tile.
9 tile: Target area will affect the height of the 16 vertices on the 3x3 tiles centered around the selected tile.
25 tile: Target area will affect the height of the 36 vertices on the 5x5 tiles centered around the selected tile.
I've written a few prototype functions currently to test a few of my theories about how I think the best solutions should be approached and they seem to be working well. I'd be happy to clean them up and share them with the Dev Team if they are interested, however they are written in C# and use the CSML library for some simple matrix math. I would be happy to port them to C++ however but I'd have to use a different library for the matrix math or code that part by hand (which I would prefer not too). Also my C++ is a bit rusty so it might take some time.