Add riverboat captain career and distinct ship classes

Add class-specific vessel geometry and sea motion, a guided helm qualification path, dockside sailing orders, and local excursions at all 24 ports.
This commit is contained in:
josh
2026-11-29 20:41:00 -05:00
parent 46624bf5ba
commit 290e4cb45d
67 changed files with 1783 additions and 301 deletions

View File

@@ -6,6 +6,7 @@ namespace BigShipTycoon
internal sealed partial class VesselExterior
{
internal const float DeckBase = 5.38f, DeckSpacing = 2.62f;
internal static float BaseDeck(Ship ship) => ship?.HullIndex == Market.River ? 1.82f : DeckBase;
internal const float PoolHalfLength = 2.61f, PoolHalfWidth = 1.43f, PoolWaterHeight = .24f;
internal const float LoungerSeatHeight = .32f, LoungerBeamFraction = .67f;
private const int HullStations = 36, DeckStations = 28, BridgeStations = 20;
@@ -13,7 +14,8 @@ namespace BigShipTycoon
{
Navy, Ivory, Pearl, Gold, Teak, TeakSeam, Steel, Black, Glass, BlueGlass, LitGlass, Lounge,
Lifeboat, Pool, Antifouling, DeckCanvas, PortLight, StarboardLight, Turf, Fringe,
MegaHull, AtriumGlass, DeckTrack, FritGlass
MegaHull, AtriumGlass, DeckTrack, FritGlass,
CoastalHull, CoastalBlue, RegionalHull, RegionalTeal, OceanRed
}
private readonly Dictionary<Paint, HarborMesh> batches = new Dictionary<Paint, HarborMesh>();
@@ -31,6 +33,11 @@ namespace BigShipTycoon
public IReadOnlyDictionary<Paint, HarborMesh> Meshes()
{
if (ship.HullIndex == Market.River)
{
BuildRiverVessel();
return batches;
}
BuildHull();
for (int deck = 0; deck < ship.Decks.Count; deck++)
BuildPassengerDeck(deck);
@@ -58,10 +65,12 @@ namespace BigShipTycoon
{
bool mega = ship.HullIndex == Market.Mega;
int samples = ExteriorHullStations;
Vector2[] outline = Outline(length, beam, 0, samples);
int hull = ship.HullIndex;
Vector2[] outline = Outline(length, beam, 0, samples, hullStyle: hull);
Vector2 center = Vector2.zero;
Coat(Paint.Antifouling).Loft(outline, center, false, new Vector3(.875f, -2.65f, .53f),
new Vector3(.936f, -1.78f, .73f), new Vector3(.967f, -.83f, .87f),
Coat(hull == Market.Ocean ? Paint.OceanRed : Paint.Antifouling).Loft(outline, center, false,
new Vector3(hull == Market.Ocean ? .79f : .875f, -2.65f, .53f),
new Vector3(hull == Market.Ocean ? .89f : .936f, -1.78f, .73f), new Vector3(.967f, -.83f, .87f),
new Vector3(.984f, -.13f, .933f));
Coat(Paint.Black).Loft(outline, center, false, new Vector3(.984f, -.13f, .933f),
new Vector3(.991f, .27f, .969f));
@@ -75,14 +84,14 @@ namespace BigShipTycoon
}
else
{
Coat(Paint.Navy).Loft(outline, center, false, new Vector3(.991f, .27f, .969f),
Paint plating = hull == Market.Coastal ? Paint.CoastalHull : hull == Market.Regional ? Paint.RegionalHull : Paint.Navy;
Coat(plating).Loft(outline, center, false, new Vector3(.991f, .27f, .969f),
new Vector3(.996f, 1.22f, .988f), new Vector3(1, 2.39f, 1), new Vector3(1.01f, 4.65f, 1.03f));
Coat(Paint.Gold).Loft(outline, center, false, new Vector3(1.013f, 3.54f, 1.025f),
new Vector3(1.013f, 3.61f, 1.026f));
BuildClassHullMarkings(hull, samples);
}
Coat(Paint.Ivory).Loft(outline, center, true, new Vector3(.998f, 4.47f, 1.015f),
new Vector3(1.013f, 5.14f, 1.027f), new Vector3(1.003f, 5.32f, 1.015f));
Vector2[] promenade = Outline(length * .971f, beam * .979f, 0, samples);
Vector2[] promenade = Outline(length * .971f, beam * .979f, 0, samples, hullStyle: hull);
Coat(Paint.Teak).Loft(promenade, center, true, new Vector3(.997f, 5.32f, 1),
new Vector3(1, DeckBase, 1));
Rails(promenade, DeckBase, DeckBase + .77f, 2.1f);
@@ -95,7 +104,7 @@ namespace BigShipTycoon
{
float station = Mathf.Lerp(.105f, .837f, i / (float)(portholes - 1));
var (at, along, outward) = SideFrame(station, 2.76f, length * 1.002f,
beam * 1.006f, 0, side, samples);
beam * 1.006f, 0, side, samples, hull);
Coat(Paint.Steel).Disc(at + outward * .043f, along * (side * .22f), Vector3.up * .238f, 12);
Coat(Paint.Black).Disc(at + outward * .048f, along * (side * .178f), Vector3.up * .194f, 12);
Paint pane = (i + 5 * side) % 7 == 0 ? Paint.Lounge : Paint.Glass;
@@ -103,13 +112,14 @@ namespace BigShipTycoon
}
var (door, hinge, face) = SideFrame(.56f, 3.22f, length * 1.004f, beam * 1.016f, 0, side,
samples);
samples, hull);
SidePanel(Coat(Paint.Black), door + face * .027f, hinge, side, 2.22f, 1.66f);
SidePanel(Coat(Paint.Navy), door + face * .032f, hinge, side, 2.10f, 1.53f);
SidePanel(Coat(Paint.Steel), door + face * .04f + hinge * .82f, hinge, side, .21f, .08f);
}
BuildForecastle();
BuildLinerBreakwater();
if (mega)
BuildMegaHullDetail();
}
@@ -162,7 +172,8 @@ namespace BigShipTycoon
Vector2[] outline = Outline(deckLength, deckBeam, offset, DeckStations);
Coat(Paint.Ivory).Loft(outline, center, false, new Vector3(.97f, y, .77f),
new Vector3(.99f, y + .24f, .83f), new Vector3(.99f, roof - .37f, .83f));
Coat(Paint.Black).Loft(outline, center, false, new Vector3(.992f, roof - .39f, .835f),
Paint fascia = ship.HullIndex == Market.Coastal ? Paint.CoastalBlue : ship.HullIndex == Market.Regional ? Paint.RegionalTeal : Paint.Black;
Coat(fascia).Loft(outline, center, false, new Vector3(.992f, roof - .39f, .835f),
new Vector3(.995f, roof - .34f, .946f));
Coat(Paint.Pearl).Loft(outline, center, false, new Vector3(.995f, roof - .34f, .946f),
new Vector3(1.008f, roof - .26f, 1.005f), new Vector3(1.008f, roof - .11f, 1.008f),
@@ -190,7 +201,8 @@ namespace BigShipTycoon
bool occupied = (i * 3 + deck * 5 + row * 7) % 11 < 3;
BuildWindow(floor, along, outward, side, width * .76f, 1.03f, 1.73f, 2,
occupied ? Paint.Lounge : Paint.Glass);
BuildBalcony(floor, along, outward, width, Mathf.Abs(floor.z) * .23f);
if (ship.HullIndex != Market.Coastal)
BuildBalcony(floor, along, outward, width, Mathf.Abs(floor.z) * .23f);
break;
case Facility.Dining:
case Facility.Entertainment:
@@ -224,6 +236,7 @@ namespace BigShipTycoon
for (int side = -1; side <= 1; side += 2)
{
BuildClassDeckGlazing(deck, y, deckLength, deckBeam, offset, side);
for (int i = 0; i < 3; i++)
{
var (floor, along, outward) = SideFrame(.845f + i * .039f, y, deckLength * .99f,
@@ -282,10 +295,17 @@ namespace BigShipTycoon
float top = DeckBase + ship.Decks.Count * DeckSpacing;
float bridge = BridgeCenter(length, ship.Decks.Count);
Vector2 center = new Vector2(bridge, 0);
Vector2[] capsule = Outline(9.15f, beam * .67f, bridge, BridgeStations);
Vector2[] capsule = ship.HullIndex switch
{
Market.Coastal => RoundedRectangle(center, 4.21f, beam * .65f, .82f),
Market.Regional => RoundedRectangle(center, 4.51f, beam * .68f, 2.25f),
_ => Outline(9.15f, beam * .67f, bridge, BridgeStations, hullStyle: Market.Ocean)
};
Coat(Paint.Ivory).Loft(capsule, center, false, new Vector3(.91f, top, .91f),
new Vector3(1, top + .88f, 1));
Coat(Paint.Black).Loft(capsule, center, false, new Vector3(1.002f, top + .80f, 1.006f),
Paint bridgeTrim = ship.HullIndex == Market.Regional ? Paint.RegionalTeal
: ship.HullIndex == Market.Coastal ? Paint.CoastalBlue : Paint.Black;
Coat(bridgeTrim).Loft(capsule, center, false, new Vector3(1.002f, top + .80f, 1.006f),
new Vector3(1.002f, top + .91f, 1.006f));
Coat(Paint.Glass).Loft(capsule, center, false, new Vector3(1, top + .88f, 1),
new Vector3(.90f, top + 2.62f, .95f));
@@ -316,28 +336,10 @@ namespace BigShipTycoon
Coat(Paint.Black).Box(new Vector3(mast - .16f, top + 4.03f, 0), new Vector3(.07f, .066f, 2.30f));
float stack = offset - deckLength * .24f;
BuildClassFunnel(top, stack);
for (int side = -1; side <= 1; side += 2)
{
BuildBridgeWing(bridge, top, side);
float z = side * deckBeam * .23f;
Vector2 foot = new Vector2(stack, z);
Vector2[] funnel = Outline(3.85f, .94f, stack, 14, z);
Coat(Paint.Ivory).Loft(funnel, foot, false, new Vector3(1.13f, top, 1.12f),
new Vector3(.99f, top + .82f, .985f));
Coat(Paint.Navy).Loft(funnel, foot, false, new Vector3(.99f, top + .82f, .985f),
new Vector3(.95f, top + 2.37f, .86f));
Coat(Paint.Gold).Loft(funnel, foot, false, new Vector3(.95f, top + 2.37f, .86f),
new Vector3(.90f, top + 2.91f, .80f));
Coat(Paint.Black).Loft(funnel, foot, true, new Vector3(.90f, top + 2.91f, .80f),
new Vector3(.87f, top + 3.23f, .77f));
for (int exhaust = -1; exhaust <= 1; exhaust++)
{
Vector3 pipe = new Vector3(stack + exhaust * .65f, top + 3.22f, z);
Coat(Paint.Steel).Rod(pipe, pipe + Vector3.up * .21f, .185f, 10);
Coat(Paint.Black).Disc(pipe + Vector3.up * .142f, Vector3.right * .17f, Vector3.back * .17f, 10);
}
var (vent, along, outward) = SideFrame(.29f, top + 1.45f, 3.67f, .82f, stack, side, 14);
BuildVent(vent + Vector3.forward * z + outward * .027f, along, outward, side, .64f);
Vector3 radome = new Vector3(stack + 6.10f, top, side * deckBeam * .50f);
Coat(Paint.Steel).Rod(radome, radome + Vector3.up * .68f, .16f, 9, true);
Coat(Paint.Pearl).Radome(radome + Vector3.up * .90f, .54f);
@@ -366,7 +368,7 @@ namespace BigShipTycoon
private void BuildSunDeck(SunDeckLayout plan, float top)
{
var starts = new int[(int)Paint.FritGlass + 1];
var starts = new int[(int)Paint.OceanRed + 1];
foreach (SunDeckVenue venue in plan.Venues)
{
System.Array.Clear(starts, 0, starts.Length);
@@ -676,26 +678,32 @@ namespace BigShipTycoon
private void BuildLifeboats()
{
for (int i = 0; i < 5 + ship.HullIndex * 2; i++)
bool coastal = ship.HullIndex == Market.Coastal;
bool regional = ship.HullIndex == Market.Regional;
int count = coastal ? 3 : regional ? 7 : 9;
float boatLength = coastal ? 3.52f : regional ? 4.05f : 4.67f;
float rackSpacing = coastal ? 5.78f : regional ? 4.79f : 5.03f;
Paint rescuePaint = regional ? Paint.RegionalTeal : Paint.Lifeboat;
for (int i = 0; i < count; i++)
for (int side = -1; side <= 1; side += 2)
{
float x = -length * .31f + i * (ship.HullIndex == 0 ? 5.52f : 4.7f);
float x = -length * (coastal ? .285f : .31f) + i * rackSpacing;
float z = side * beam * .974f;
Vector2 center = new Vector2(x, z);
Vector2[] capsule = Outline(4.31f, .60f, x, 12, z);
Coat(Paint.Lifeboat).Loft(capsule, center, false, new Vector3(.86f, 6.27f, .59f),
Vector2[] capsule = Outline(boatLength, .60f, x, 12, z);
Coat(rescuePaint).Loft(capsule, center, false, new Vector3(.86f, 6.27f, .59f),
new Vector3(1, 6.49f, .99f), new Vector3(1, 6.65f, 1));
Coat(Paint.Pearl).Loft(capsule, center, true, new Vector3(1, 6.65f, 1),
new Vector3(.875f, 6.94f, .82f), new Vector3(.78f, 7.04f, .65f));
for (int window = 0; window < 3; window++)
{
var (at, along, outward) = SideFrame(.42f + window * .115f, 6.91f, 3.63f, .50f, x, side, 12);
var (at, along, outward) = SideFrame(.42f + window * .115f, 6.91f, boatLength * .842f, .50f, x, side, 12);
Vector3 pane = at + Vector3.forward * z + outward * .018f;
SidePanel(Coat(Paint.Glass), pane, along, side, .32f, .14f);
}
for (int arm = -1; arm <= 1; arm += 2)
{
float mount = x + arm * 1.73f;
float mount = x + arm * boatLength * .40f;
Vector3 from = new Vector3(mount, 6.15f, z - side * .67f);
Vector3 elbow = new Vector3(mount, 7.47f, z - side * .52f);
Vector3 tip = new Vector3(mount, 7.53f, z + side * .20f);
@@ -743,12 +751,12 @@ namespace BigShipTycoon
(DeckLength(length, deck), DeckHalfBeam(beam, deck), DeckOffset(length, deck));
private static (Vector3 Position, Vector3 Along, Vector3 Outward) SideFrame(float station, float y,
float length, float halfBeam, float offset, int side, int samples)
float length, float halfBeam, float offset, int side, int samples, int hullStyle = -1)
{
float sample = station * samples;
int first = Mathf.Min(samples - 1, Mathf.FloorToInt(sample));
float startWidth = SideWidth(first / (float)samples);
float endWidth = SideWidth((first + 1f) / samples);
float startWidth = HullWidth(first / (float)samples, hullStyle);
float endWidth = HullWidth((first + 1f) / samples, hullStyle);
float z = side * halfBeam * Mathf.Lerp(startWidth, endWidth, sample - first);
Vector3 along = new Vector3(length / samples, 0, side * halfBeam * (endWidth - startWidth)).normalized;
return (new Vector3(offset + (station - .5f) * length, y, z), along,
@@ -771,13 +779,13 @@ namespace BigShipTycoon
return Mathf.Cos(Mathf.Clamp01((t - .69f) / .31f) * Mathf.PI * .5f);
}
private static Vector2[] Outline(float length, float beam, float x, int intervals, float z = 0)
private static Vector2[] Outline(float length, float beam, float x, int intervals, float z = 0, int hullStyle = -1)
{
var outline = new Vector2[intervals * 2 + 1];
for (int i = 0; i < intervals; i++)
{
float position = i / (float)intervals;
float width = beam * SideWidth(position);
float width = beam * HullWidth(position, hullStyle);
float station = (position - .5f) * length + x;
outline[i] = new Vector2(station, z - width);
outline[outline.Length - 1 - i] = new Vector2(station, z + width);