space-browser / commits / e12ca5f
feat: enemy forces have arrived
@@ -39,12 +39,22 @@ export type Ship = {
3939 ty: number;
4040 fuel: number; // what is in the tank
4141 fuelmax: number; // capacity, summed from the hull
42- foe: number; // the ship this one is hostile with, 0 = neutral
42+ side: string; // police or rogue for a server hull, empty for a player
43+ foe: number; // the ship this one is chasing, 0 = nobody
4344 target: number; // piece of that ship its guns are pointed at, 0 = the nearest
4445 ai: boolean; // a server-run hull, so it draws in its own colour
4546 pieces: Piece[];
4647 };
4748
49+// The same rule the server shoots by, so the rim on a hull can never say hostile
50+// while the guns say neutral: the rogue faction is at war with everything else on
51+// sight, and anyone else is only at war once one of the two has declared it.
52+export const hostile = (a?: Ship, b?: Ship): boolean => {
53+ if (!a || !b || a.id === b.id) return false;
54+ if (a.side === 'rogue' || b.side === 'rogue') return a.side !== b.side;
55+ return a.foe === b.id || b.foe === a.id;
56+};
57+
4858 export function toWorld(s: Ship, p: Piece): { x: number; y: number } {
4959 const c = Math.cos(s.h);
5060 const n = Math.sin(s.h);
@@ -2,7 +2,7 @@
22 // fullscreen pass that turns it into glyphs. It draws what it is handed and keeps
33 // only the meshes that belong to an id, so a piece keeps its mesh for its whole life.
44 import * as THREE from 'three';
5-import { toWorld, type Body, type Kind, type Loose, type Ore, type Ship, type Shot, type System } from '../sim';
5+import { hostile, toWorld, type Body, type Kind, type Loose, type Ore, type Ship, type Shot, type System } from '../sim';
66 import { barrenMesh, shipyardMesh, starMesh } from './bodies';
77 import { Galaxy } from './galaxy';
88 import { CELL, CELL_WORLD, snapCell } from './grid';
@@ -237,15 +237,15 @@ export class View {
237237 this.bodies(bodies, performance.now() / 1000);
238238
239239 const seen = new Set<number>();
240- const foe = ships.find((s) => s.id === ownId)?.foe ?? 0;
240+ const me = ships.find((s) => s.id === ownId);
241241 for (const s of ships) {
242- const role: Role = s.id === ownId ? 'own' : s.ai ? 'ai' : 'other';
243- // A ship is an enemy the moment either side has declared it, so the rim can
244- // never say hostile while the guns say neutral.
245- const hostile = s.id !== ownId && (s.id === foe || s.foe === ownId);
242+ const role: Role = s.id === ownId ? 'own' : s.side === 'rogue' ? 'rogue' : s.ai ? 'ai' : 'other';
243+ // A ship is an enemy by the server's own rule: a rogue always, anyone else
244+ // the moment one of the two has declared it.
245+ const enemy = hostile(me, s);
246246 for (const p of s.pieces) {
247247 const w = toWorld(s, p);
248- this.place(p.id, p.kind, role, w.x, w.y, s.h, p, hostile, seen);
248+ this.place(p.id, p.kind, role, w.x, w.y, s.h, p, enemy, seen);
249249 }
250250 }
251251 for (const l of loose) this.place(l.id, l.kind, 'loose', l.x, l.y, l.h, l, false, seen);
@@ -17,6 +17,7 @@ const SHADE = {
1717 own: [lum(1, 7), lum(0.5, 7)],
1818 other: [lum(0.8, 6), lum(0.4, 6)],
1919 ai: [lum(0.75, 15), lum(0.35, 15)],
20+ rogue: [lum(0.7, 13), lum(0.35, 13)],
2021 loose: [lum(0.55, 5), lum(0.28, 5)],
2122 ore: [lum(0.95, 6), lum(0.5, 4)], // ore in a planet's ring
2223 towed: [lum(1, 7), lum(0.55, 6)], // ore on someone's line, bright as a hull
@@ -50,6 +50,7 @@ export function apply(dt: number): void {
5050 s.fuel = p.fuel; // a gauge has to jump, not ease, or it lies about the tank
5151 s.fuelmax = p.fuelmax;
5252 s.foe = p.foe;
53+ s.side = p.side;
5354 s.pieces = p.pieces; // a hull is never eased: a piece is where the server says
5455 }
5556 }
@@ -7,19 +7,20 @@ import (
77 )
88
99 // An AI hull is a root gun with a few pieces bolted around it. The size says how
10-// many pieces it carries; which piece goes on and which slot it lands in is drawn
11-// per ship, so two hulls of one size still differ. Every kind a player can fly
12-// turns up on a hull, because a wreck is the only place a piece comes from: a star
13-// is the one exception, since being craft-only at the rim is all it is.
14-func (h *hub) compose(size int) []piece {
15- ps := []piece{h.fitted("triangle", 0)} // the root gun is what makes it dangerous
10+// many pieces it carries and the tier how good they are; which piece goes on and
11+// which slot it lands in is drawn per ship, so two hulls of one size still differ.
12+// Every kind a player can fly turns up on a hull, because a wreck is the only place
13+// a piece comes from: a star is the one exception, since being craft-only at the rim
14+// is all it is.
15+func (h *hub) compose(size, tier int) []piece {
16+ ps := []piece{h.fitted("triangle", tier)} // the root gun is what makes it dangerous
1617 for range size - 1 {
1718 host := ps[rand.Intn(len(ps))]
1819 free := freeSlots(ps, host)
1920 if len(free) == 0 {
2021 continue // this hull is boxed in, so it just carries less
2122 }
22- q := h.fitted([]string{"triangle", "square", "circle"}[rand.Intn(3)], 0)
23+ q := h.fitted([]string{"triangle", "square", "circle"}[rand.Intn(3)], tier)
2324 a := float64(free[rand.Intn(len(free))]) / slots * 2 * math.Pi
2425 q.Parent, q.LX, q.LY = host.ID, host.LX+math.Cos(a)*spacing, host.LY+math.Sin(a)*spacing
2526 ps = append(ps, q)
@@ -27,29 +28,57 @@ func (h *hub) compose(size int) []piece {
2728 return ps
2829 }
2930
30-// A passive AI hull: born on a shipyard's ring, it picks an orbit line of its own
31-// and circles the yard. It is nobody's enemy until someone picks a fight with it.
31+// A police hull: born on a shipyard's ring, it picks an orbit line of its own and
32+// circles the yard. It is nobody's enemy until someone picks a fight with it.
3233 func (h *hub) spawnAI(b *body) *player {
3334 a := rand.Float64() * 2 * math.Pi
3435 r := b.R + standoff
3536 h.nextID++
36- p := &player{ID: h.nextID, Name: "AI" + strconv.Itoa(h.nextID), AI: true, home: b.ID,
37+ p := &player{ID: h.nextID, Name: "AI" + strconv.Itoa(h.nextID), AI: true, Side: sidePolice, home: b.ID,
3738 X: b.X + math.Cos(a)*r, Y: b.Y + math.Sin(a)*r,
3839 angle: a, ring: r + patrolLow + rand.Float64()*patrolHigh,
3940 spin: patrolSpin * (0.8 + 0.5*rand.Float64())}
4041 if rand.Intn(2) == 0 {
4142 p.spin = -p.spin
4243 }
43- p.Pieces = h.compose(aiMin + rand.Intn(aiMax-aiMin+1))
44+ p.Pieces = h.compose(aiMin+rand.Intn(aiMax-aiMin+1), 0)
4445 p.FuelMax = p.capacity()
4546 p.Fuel = p.FuelMax
4647 return p
4748 }
4849
49-// An AI flies its own orbit line around the yard it was born at. The moment it is
50-// hostile with anything it drops the patrol and runs that ship down, and it keeps
51-// running it down until one of the two is dead.
50+// A rogue hull: born on the patrol circle of its point, sized and built by the ring
51+// it patrols, so the middle ring fields small hulls and the rim fields packs.
52+func (h *hub) spawnRogue(i int) *player {
53+ s := h.slots[i]
54+ n, top := rogueMidPieces+rand.Intn(rogueMidVar), rogueMidTier
55+ if s.ring >= rimRing-1 {
56+ n, top = rogueRimPieces+rand.Intn(rogueRimVar), rogueRimTier
57+ }
58+ a := rand.Float64() * 2 * math.Pi
59+ h.nextID++
60+ p := &player{ID: h.nextID, Name: "ROGUE" + strconv.Itoa(h.nextID), AI: true, Side: sideRogue,
61+ spot: i, hx: s.x, hy: s.y, angle: a,
62+ ring: rogueRingLow + rand.Float64()*rogueRingVar,
63+ spin: patrolSpin * (0.8 + 0.5*rand.Float64())}
64+ if rand.Intn(2) == 0 {
65+ p.spin = -p.spin
66+ }
67+ p.X, p.Y = s.x+math.Cos(a)*p.ring, s.y+math.Sin(a)*p.ring
68+ p.H = a
69+ p.Pieces = h.compose(n, rand.Intn(top+1))
70+ p.FuelMax = p.capacity()
71+ p.Fuel = p.FuelMax
72+ return p
73+}
74+
75+// A police hull circles its yard and runs down whoever hit it, and a rogue hull
76+// watches the gap it was posted in. Both keep to the ground they were given.
5277 func (h *hub) think(p *player, dt float64) {
78+ if p.Side == sideRogue {
79+ h.maraud(p, dt)
80+ return
81+ }
5382 p.angle += p.spin * dt
5483 if p.Foe != 0 {
5584 p.orbit, p.chase = 0, p.Foe
@@ -60,8 +89,43 @@ func (h *hub) think(p *player, dt float64) {
6089 }
6190 }
6291
63-// A wrecked AI leaves its hull in space like anyone else, and its yard births a
64-// replacement after a delay, so a system never runs out of traffic.
92+// A rogue opens fire on anything that is not a rogue the moment it can shoot it, so
93+// the gun range ring is the whole of its warning. It runs that ship down until one
94+// of them is dead, but only that far from its own point: every hull flies at the
95+// same top speed, so a chase with no leash would follow a fleeing player across the
96+// galaxy forever and break the promise that deep space is not their ground.
97+func (h *hub) maraud(p *player, dt float64) {
98+ if o := h.player(p.Foe); o != nil && hostile(p, o) && math.Hypot(o.X-p.hx, o.Y-p.hy) < rogueLeash {
99+ p.chase = p.Foe
100+ return // the chase order below flies it into gun range
101+ }
102+ p.Foe, p.Target, p.chase = 0, 0, 0 // the prey is gone or out of reach: back to the patrol
103+ if t := h.prey(p); t != nil {
104+ p.Foe, p.chase = t.ID, t.ID
105+ return
106+ }
107+ p.angle += p.spin * dt
108+ p.TX, p.TY = p.hx+math.Cos(p.angle)*p.ring, p.hy+math.Sin(p.angle)*p.ring
109+}
110+
111+// The nearest ship a rogue may shoot, which is anything that is not a rogue, and
112+// only once it is close enough for its own guns: nothing is aggroed from off screen.
113+func (h *hub) prey(p *player) *player {
114+ var got *player
115+ best := gunRange
116+ for _, o := range h.players() {
117+ if o == p || !hostile(p, o) {
118+ continue
119+ }
120+ if d := math.Hypot(o.X-p.X, o.Y-p.Y); d < best {
121+ best, got = d, o
122+ }
123+ }
124+ return got
125+}
126+
127+// A wrecked AI leaves its hull in space like anyone else. A yard births a police
128+// replacement after a delay and a rogue point does the same, so neither runs dry.
65129 func (h *hub) bury(p *player) {
66130 h.corpse(p)
67131 for i, q := range h.ai {
@@ -70,10 +134,15 @@ func (h *hub) bury(p *player) {
70134 break
71135 }
72136 }
137+ if p.Side == sideRogue {
138+ h.slots[p.spot].wait = rogueDelay
139+ return
140+ }
73141 h.grave = append(h.grave, &grave{home: p.home, wait: aiDelay})
74142 }
75143
76-// Graves count down, then birth a new hull in the same shipyard's orbit.
144+// Graves count down, then birth a new hull in the same shipyard's orbit, and a
145+// silent rogue point births a new patrol on its own circle.
77146 func (h *hub) stepAI(dt float64) {
78147 live := h.grave[:0]
79148 for _, g := range h.grave {
@@ -86,4 +155,13 @@ func (h *hub) stepAI(dt float64) {
86155 }
87156 }
88157 h.grave = live
158+ for i, s := range h.slots {
159+ if s.wait <= 0 {
160+ continue // one is alive and patrolling
161+ }
162+ if s.wait -= dt; s.wait > 0 {
163+ continue
164+ }
165+ h.ai = append(h.ai, h.spawnRogue(i))
166+ }
89167 }
@@ -85,3 +85,43 @@ func (h *hub) system(cx, cy, r float64) {
8585 h.bodies = append(h.bodies, b)
8686 }
8787 }
88+
89+// The rogue points of the galaxy: the gaps between the stars on the two outer
90+// rings, never in orbit of anything. A patrol posted there is far from every
91+// shipyard, so police traffic and rogue traffic only ever meet if a rogue is drawn
92+// out to the edge of its leash, and the core stays the safe end of the galaxy.
93+func (h *hub) rogues() {
94+ for _, r := range []struct {
95+ r float64
96+ n int
97+ }{{midRing, rogueMidN}, {rimRing, rogueRimN}} {
98+ for i := 0; i < r.n; i++ {
99+ x, y, ok := h.gap(r.r)
100+ if !ok {
101+ continue // this ring is too crowded to post another patrol on
102+ }
103+ h.slots = append(h.slots, &slot{x: x, y: y, ring: r.r})
104+ h.ai = append(h.ai, h.spawnRogue(len(h.slots)-1))
105+ }
106+ }
107+}
108+
109+// A point on a galaxy ring that is clear of every star system. Thirty-two tries is
110+// plenty: the gaps between two stars are far wider than the clearance.
111+func (h *hub) gap(rad float64) (float64, float64, bool) {
112+ for i := 0; i < 32; i++ {
113+ a := rand.Float64() * 2 * math.Pi
114+ x, y := math.Cos(a)*rad, math.Sin(a)*rad
115+ clear := true
116+ for _, s := range h.systems {
117+ if math.Hypot(s.X-x, s.Y-y) < rogueClear {
118+ clear = false
119+ break
120+ }
121+ }
122+ if clear {
123+ return x, y, true
124+ }
125+ }
126+ return 0, 0, false
127+}
@@ -50,13 +50,24 @@ func aim(p, o *player) (float64, float64) {
5050 return tx, ty
5151 }
5252
53-// The closest ship this hull is hostile with. Rounds hit whatever they touch, so
54-// this only decides who the guns are pointed at.
53+// Who shoots whom. A rogue is at war with everything that is not a rogue the moment
54+// it can reach it, so its own gun range ring is the whole of its warning. Everyone
55+// else is neutral until a fight is declared: a player declares it by clicking a
56+// hull, and the police declare it by answering whoever shot them.
57+func hostile(a, b *player) bool {
58+ if a.Side == sideRogue || b.Side == sideRogue {
59+ return a.Side != b.Side
60+ }
61+ return a.Foe == b.ID || b.Foe == a.ID
62+}
63+
64+// The closest ship this hull is fighting. Rounds hit whatever they touch, so this
65+// only decides who the guns are pointed at.
5566 func (h *hub) foeNear(p *player) *player {
5667 var got *player
5768 best := math.MaxFloat64
5869 for _, o := range h.players() {
59- if o == p || (p.Foe != o.ID && o.Foe != p.ID) {
70+ if o == p || !hostile(p, o) {
6071 continue
6172 }
6273 if d := math.Hypot(o.X-p.X, o.Y-p.Y); d < best {
@@ -74,7 +85,7 @@ func (h *hub) stepShots(dt float64) {
7485 d := shotSpeed * dt
7586 nx, ny := s.X+math.Cos(s.H)*d, s.Y+math.Sin(s.H)*d
7687 if p, id := h.shotHit(s, nx, ny); p != nil {
77- h.hurt(p, id)
88+ h.hurt(p, id, s.owner)
7889 continue
7990 }
8091 s.X, s.Y, s.left = nx, ny, s.left-d
@@ -105,7 +116,14 @@ func (h *hub) shotHit(s *shot, nx, ny float64) (*player, int) {
105116 return got, id
106117 }
107118
108-func (h *hub) hurt(p *player, id int) {
119+// A round always names the hull that fired it, so a hull that is hit can answer:
120+// this is the whole of what makes the police defend themselves instead of sitting
121+// there as free kills. A hull on your own side is never answered, so a police round
122+// that grazes another police hull does not start a faction war.
123+func (h *hub) hurt(p *player, id, by int) {
124+ if o := h.player(by); p.AI && o != nil && p.Foe == 0 && o.Side != p.Side {
125+ p.Foe = o.ID
126+ }
109127 for i := range p.Pieces {
110128 if p.Pieces[i].ID != id {
111129 continue
@@ -73,10 +73,31 @@ func (h *hub) sever(p *player, gone map[int]bool) []*loose {
7373 }
7474
7575 // A piece torn off a hull keeps its identity, its damage and its tier, and lands in
76-// space where the hull was holding it.
76+// space where the hull was holding it. A server hull's wreckage carries a timer: it
77+// is litter from a fight nothing was watching, not somebody's run.
7778 func (h *hub) wreck(p *player, q piece) *loose {
7879 x, y := hullToWorld(p, q.LX, q.LY)
79- return &loose{ID: q.ID, Kind: q.Kind, X: x, Y: y, H: p.H, HP: q.HP, MaxHP: q.MaxHP, Tier: q.Tier}
80+ l := &loose{ID: q.ID, Kind: q.Kind, X: x, Y: y, H: p.H, HP: q.HP, MaxHP: q.MaxHP, Tier: q.Tier}
81+ if p.AI {
82+ l.ttl = wreckTTL
83+ }
84+ return l
85+}
86+
87+// Wreckage with a timer is taken out of the world when it runs down, unless a hand
88+// is on it: a piece being dragged is not litter yet. Nothing a player left behind
89+// has a timer, because that is where a run ended and what it was flying.
90+func (h *hub) stepLoose(dt float64) {
91+ live := h.loose[:0]
92+ for _, l := range h.loose {
93+ if l.ttl > 0 && l.held == 0 {
94+ if l.ttl -= dt; l.ttl <= 0 {
95+ continue
96+ }
97+ }
98+ live = append(live, l)
99+ }
100+ h.loose = live
80101 }
81102
82103 // A star is not instant death: its heat eats whatever of the hull actually enters
@@ -44,13 +44,9 @@ func (h *hub) pick(p *player, x, y float64) {
4444
4545 // Clicking a ship's piece is a declaration, not a shot: both hulls become hostile,
4646 // the attacker closes to gun range, and its guns are pointed at the piece that was
47-// clicked. Nobody is hostile until someone says so.
47+// clicked. Nobody is hostile until someone says so. A third hull keeps whatever
48+// fight it was already in, so declaring on one enemy never calls off another.
4849 func (h *hub) engage(p, o *player, piece int) {
49- for _, q := range h.players() {
50- if q.Foe == p.ID || q.Foe == o.ID {
51- q.Foe, q.Target = 0, 0 // an old pairing ends when a new one starts
52- }
53- }
5450 p.Foe, o.Foe, p.chase, p.orbit = o.ID, p.ID, o.ID, 0
5551 p.Target = piece
5652 }
@@ -47,6 +47,7 @@ func newHub() *hub {
4747 h.ai = append(h.ai, h.spawnAI(b))
4848 }
4949 }
50+ h.rogues() // the gaps between the stars, after the systems are where they are
5051 log.Printf("galaxy: %d systems, %d bodies", 1+midCount+rimCount, len(h.bodies))
5152 return h
5253 }
@@ -85,6 +85,7 @@ func (h *hub) step(dt float64) {
8585 }
8686 h.stepShots(dt)
8787 h.stepAI(dt)
88+ h.stepLoose(dt)
8889 }
8990
9091 // A root piece at zero, or a dry tank, ends that hull. A player is replaced at
@@ -47,14 +47,34 @@ const (
4747 fuelPer = 1800.0 // world units of travel one unit of fuel buys
4848 refuel = 1.0 // fuel a second a docked shipyard puts back in the tank
4949
50- aiPerYard = 2 // passive AI ships a shipyard keeps in orbit
51- aiDelay = 25.0 // seconds after an AI death before that yard births another
52- aiMin = 1 // ship pieces the smallest AI hull is born with
50+ aiPerYard = 2 // police ships a shipyard keeps in orbit
51+ aiDelay = 25.0 // seconds after a police death before that yard births another
52+ aiMin = 1 // ship pieces the smallest police hull is born with
5353 aiMax = 2 // and the largest a yard fields
5454 patrolSpin = 0.18 // radians a second an AI circles its yard on patrol
5555 patrolLow = 6.0 // the tightest patrol line sits this far beyond the standoff
5656 patrolHigh = 30.0 // and the widest this much further out again
5757
58+ // The two factions a server hull can belong to. A connected player has no side:
59+ // players are only at war with whoever declared it.
60+ sidePolice = "police"
61+ sideRogue = "rogue"
62+
63+ rogueMidN = 2 // rogue patrols in the gaps of the middle galaxy ring
64+ rogueRimN = 6 // and in the gaps of the rim, so danger grows outward
65+ rogueMidPieces = 2 // piece count of a middle-ring rogue hull, plus
66+ rogueMidVar = 2 // this much more drawn per hull
67+ rogueRimPieces = 3 // a rim rogue is bigger still
68+ rogueRimVar = 3
69+ rogueMidTier = 1 // best tier a middle-ring hull is built from
70+ rogueRimTier = 2 // and the rim's, so going out buys quality and not only bulk
71+ rogueDelay = 25.0 // seconds a dead rogue's point stays quiet
72+ rogueLeash = 300.0 // how far from that point it runs a target down
73+ rogueClear = 500.0 // a rogue point keeps this far from every star system
74+ rogueRingLow = 80.0 // patrol circle around that point, plus
75+ rogueRingVar = 120.0 // this much more per hull
76+ wreckTTL = 60.0 // seconds a server hull's wreckage lies before it is gone
77+
5878 gunRange = 140.0 // world distance a triangle will shoot at
5979 gunCool = 1.6 // seconds between salvos from one hull
6080 shotSpeed = 150.0 // a round is faster than a ship, so range alone is not safety
@@ -86,6 +106,7 @@ type loose struct {
86106 MaxHP float64 `json:"maxhp"`
87107 Tier int `json:"tier"`
88108 held int // player dragging it, 0 = free
109+ ttl float64 // seconds until a server hull's wreckage is gone, 0 = it stays
89110 }
90111
91112 // A shot is a real object in the world: it travels, it can be outrun sideways,
@@ -146,6 +167,7 @@ func (b *body) place(t float64) {
146167 type player struct {
147168 ID int `json:"id"`
148169 Name string `json:"name"`
170+ Side string `json:"side"` // police or rogue for a server hull, empty for a player
149171 X float64 `json:"x"`
150172 Y float64 `json:"y"`
151173 H float64 `json:"h"`
@@ -154,12 +176,14 @@ type player struct {
154176 Pieces []piece `json:"pieces"`
155177 Fuel float64 `json:"fuel"` // what is in the tank, spent by flying
156178 FuelMax float64 `json:"fuelmax"` // capacity, summed from the hull every tick
157- Foe int `json:"foe"` // ship this one is hostile with, 0 = neutral
179+ Foe int `json:"foe"` // ship this one is chasing, 0 = nobody
158180 Target int `json:"target"` // piece of that ship the guns are pointed at
159181 AI bool `json:"ai"` // a server-run hull, not a connection
160182
161- home int // shipyard body an AI was born at, and comes back to
162- angle float64 // AI patrol angle around that yard
183+ home int // shipyard body a police hull was born at, and comes back to
184+ spot int // rogue point a rogue patrols, as an index into hub.slots
185+ hx, hy float64 // centre of a rogue's patrol circle, in world units
186+ angle float64 // AI patrol angle around that yard or point
163187 ring float64 // AI patrol radius around it
164188 spin float64 // AI patrol angular speed, negative for the other way round
165189 chase int // ship this one was ordered to close on, 0 = no order
@@ -184,6 +208,15 @@ type grave struct {
184208 wait float64
185209 }
186210
211+// A rogue point is a gap between two stars on a galaxy ring, and it holds exactly
212+// one rogue patrol: when that hull dies the point goes quiet, and births another
213+// after a delay. So a ring never runs out of patrols and never gains a second one.
214+type slot struct {
215+ x, y float64
216+ ring float64 // the galaxy ring the point sits on: it sets how big its hull is
217+ wait float64 // seconds until it births a hull, 0 while one is alive
218+}
219+
187220 type hub struct {
188221 mu sync.Mutex
189222 clients map[*client]bool
@@ -196,6 +229,7 @@ type hub struct {
196229 shots []*shot
197230 ai []*player // server-run hulls, tracked whether or not anyone is connected
198231 grave []*grave
232+ slots []*slot // the rogue points of the galaxy, one patrol each
199233 nextPiece int
200234 time float64
201235 }