Make procgen use weighted variants (#24669)
This commit is contained in:
@@ -16,6 +16,7 @@ public abstract class SharedBiomeSystem : EntitySystem
|
||||
[Dependency] protected readonly IPrototypeManager ProtoManager = default!;
|
||||
[Dependency] private readonly ISerializationManager _serManager = default!;
|
||||
[Dependency] protected readonly ITileDefinitionManager TileDefManager = default!;
|
||||
[Dependency] private readonly TileSystem _tile = default!;
|
||||
|
||||
protected const byte ChunkSize = 8;
|
||||
|
||||
@@ -158,13 +159,8 @@ public abstract class SharedBiomeSystem : EntitySystem
|
||||
// Pick a variant tile if they're available as well
|
||||
if (variantCount > 1)
|
||||
{
|
||||
var variantValue = (noise.GetNoise(indices.X * 8, indices.Y * 8, variantCount) + 1f) / 2f;
|
||||
variant = (byte) Pick(variantCount, variantValue);
|
||||
|
||||
if (variants != null)
|
||||
{
|
||||
variant = variants[variant];
|
||||
}
|
||||
var variantValue = (noise.GetNoise(indices.X * 8, indices.Y * 8, variantCount) + 1f) * 100;
|
||||
variant = _tile.PickVariant(tileDef, (int) variantValue);
|
||||
}
|
||||
|
||||
tile = new Tile(tileDef.TileId, 0, variant);
|
||||
|
||||
Reference in New Issue
Block a user