Skip to content

Conversation

@rjcorwin
Copy link
Owner

Summary

  • add reusable isometric world engine with player, agent, and ship controllers
  • provide vitest coverage for movement streaming and ship-boarding behavior
  • introduce isometric-fleet space template documenting four humans, four agents, and a demo ship

Testing

  • npm run build
  • npm test

https://chatgpt.com/codex/tasks/task_e_68ebba6b8f7c8325a0a5ba978029e685

cursor[bot]

This comment was marked as outdated.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting

Comment on lines +244 to +257
public boardShip(playerId: EntityId, shipId: EntityId, deckPosition?: Vector2): void {
const player = this.players.get(playerId);
const ship = this.ships.get(shipId);
if (!player || !ship) {
return;
}

const relativePosition = deckPosition ?? subtractVectors(player.position, ship.position);
ship.boardedPlayers[playerId] = relativePosition;
player.boardedShipId = shipId;
player.relativePosition = relativePosition;
player.position = addVectors(ship.position, relativePosition);
this.emit('player-moved', { type: 'player-moved', player });
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Remove player from previous ship when boarding new one

When boardShip is called for a player who is already aboard another vessel, the code assigns the new boardedShipId and updates the new ship’s boardedPlayers map but never removes the player from the old ship’s boardedPlayers. The previous ship will continue to treat the player as boarded and, in tick, will keep updating their position and velocity even after they have moved to another ship. With two ships moving simultaneously the player’s state will be overwritten every frame, producing jitter and inconsistent world snapshots. Clear the player from the previous ship before assigning the new ship.

Useful? React with 👍 / 👎.

});

this.emit('ship-moved', { type: 'ship-moved', ship });
});
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Ship Movement Overwrites Player Intents

During tick, boarded players' individual movement intents are processed, but their position and velocity are then immediately overwritten by the ship's movement. This causes personal movement to be ignored and results in an incorrect velocity.

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants