CRITICAL: AIController uses wrong property names for Ship class #2

Closed
opened 2026-05-11 06:16:42 +00:00 by Mark · 0 comments
Owner

Description

AIController.js references property names that don't match the Ship class, preventing AI ships from working.

Specific mismatches

  • ship.position -> Ship uses pos
  • ship.velocity -> Ship uses vel
  • ship.fuel -> Ship has fuel.current and fuel.capacity
  • ship.capacitor -> Ship has capacitor.current / capacitor.maxCapacity
  • ship.maxThrust -> Ship doesn't have this
  • ship.thrust -> Ship has currentThrust
  • ship.health -> Ship has hull.current
  • ship.gForce -> Ship has totalG
  • ship.velocity.scale() -> Ship's Vec2 uses mul() not scale()

Impact

AI ships cannot steer, thrust, or manage resources. Racing is effectively single-player.

Fix

Add adapter properties/getters to Ship, or refactor AIController to use Ship's property names.

## Description AIController.js references property names that don't match the Ship class, preventing AI ships from working. ## Specific mismatches - `ship.position` -> Ship uses `pos` - `ship.velocity` -> Ship uses `vel` - `ship.fuel` -> Ship has `fuel.current` and `fuel.capacity` - `ship.capacitor` -> Ship has `capacitor.current` / `capacitor.maxCapacity` - `ship.maxThrust` -> Ship doesn't have this - `ship.thrust` -> Ship has `currentThrust` - `ship.health` -> Ship has `hull.current` - `ship.gForce` -> Ship has `totalG` - `ship.velocity.scale()` -> Ship's Vec2 uses `mul()` not `scale()` ## Impact AI ships cannot steer, thrust, or manage resources. Racing is effectively single-player. ## Fix Add adapter properties/getters to Ship, or refactor AIController to use Ship's property names.
Mark closed this issue 2026-05-11 16:00:20 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Mark/gravity-racer#2
No description provided.