Merge origin/master (arena cut 1: ItemManager takes a seed) into eureka/aetheria-gravity-laned-belts

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
soul 2026-10-22 00:44:50 +02:00
commit 95903ab00e
118 changed files with 1157 additions and 297 deletions

View file

@ -266,14 +266,18 @@ public class Zone
foreach (var wear in pack.ChunkWear)
_wear[new ChunkId(wear.Field, wear.Index)] = new ChunkWear { Damage = wear.Damage, BrokenUntil = wear.BrokenUntil };
var ordinal = 0u;
foreach (var entityPack in pack.Entities)
{
ordinal++;
var entity = EntitySerializer.Unpack(_itemManager, this, entityPack);
var ship = entity as Ship;
Admit(entity, piloted: ship is {IsPlayerShip: false});
// Generation placement, not admission: a ship packed at the origin is scattered across the zone.
// Generation placement, not admission: a ship packed at the origin is scattered across the zone, on the
// zone's own dice, so nothing drawn from the item stream can move it.
if (ship is {IsPlayerShip: false} && lengthsq(ship.Position) < 1)
ship.Position = _itemManager.Random.NextFloat3(float3(-pack.Radius * .5f), float3(pack.Radius * .5f));
ship.Position = SimulationDice.For(CombatSeed, SimulationDice.ScatterStream, ordinal)
.NextFloat3(float3(-pack.Radius * .5f), float3(pack.Radius * .5f));
}
// TODO: Associate planets with stored entities for planetary colonies