Targeting system (UO-style cursor) — foundation for spells & targeted commands #32

Closed
opened 2026-07-17 16:35:32 +02:00 by marco · 0 comments
Owner

A general target-selection system (UO-style targeting cursor) that gameplay features can request. Needed first-class for the spell system (most spells prompt "target a creature/tile"), and it also cleans up GM targeted commands.

Today there is no generic targeting: /kill (PR #31) works around it by reusing the click-selected creature (_attackTarget) — an interim hack, not a real cursor.

Scope

  • A server-driven target request: a feature (spell, GM command) asks the client to pick a target; the client enters a targeting mode (crosshair), the next click on a valid target (creature / player / tile) sends the selection back, bound to the pending request.
  • Support target kinds: mobile (creature/player) and ground tile (for area/tile spells), so the requester states what it accepts.
  • Server validates the returned target (exists, in range/line-of-sight as applicable) — never trust the client's pick blindly.
  • Cancelable (Esc), with a timeout so a stale request doesn't linger.
  • Retrofit /kill (and future GM targeted commands) onto it, replacing the interim click-target hack.

Out of scope

  • The spell system itself (this is the targeting primitive it will build on).
  • Fancy cursor art — a simple crosshair/highlight is enough for v1.

Definition of Done

  • A feature can issue a target request and receive the chosen mobile-id or tile, server-validated, demonstrable via at least one caller (GM /kill migrated to it).
  • Targeting mode is enterable, shows a distinct cursor, resolves on click, and is cancelable with Esc; a timeout clears an unanswered request.
  • Invalid picks (out of range, wrong kind, gone) are rejected server-side with feedback, not applied.
  • Protocol messages for request/response round-trip; server-side validation unit-tested.
A general **target-selection system** (UO-style targeting cursor) that gameplay features can request. Needed first-class for the **spell system** (most spells prompt "target a creature/tile"), and it also cleans up GM targeted commands. Today there is no generic targeting: `/kill` (PR #31) works around it by reusing the click-selected creature (`_attackTarget`) — an interim hack, not a real cursor. ## Scope - A server-driven **target request**: a feature (spell, GM command) asks the client to pick a target; the client enters a targeting mode (crosshair), the next click on a valid target (creature / player / tile) sends the selection back, bound to the pending request. - Support target **kinds**: mobile (creature/player) and ground tile (for area/tile spells), so the requester states what it accepts. - Server validates the returned target (exists, in range/line-of-sight as applicable) — never trust the client's pick blindly. - Cancelable (Esc), with a timeout so a stale request doesn't linger. - Retrofit `/kill` (and future GM targeted commands) onto it, replacing the interim click-target hack. ## Out of scope - The spell system itself (this is the targeting primitive it will build on). - Fancy cursor art — a simple crosshair/highlight is enough for v1. ## Definition of Done - A feature can issue a target request and receive the chosen mobile-id or tile, server-validated, demonstrable via at least one caller (GM `/kill` migrated to it). - Targeting mode is enterable, shows a distinct cursor, resolves on click, and is cancelable with Esc; a timeout clears an unanswered request. - Invalid picks (out of range, wrong kind, gone) are rejected server-side with feedback, not applied. - Protocol messages for request/response round-trip; server-side validation unit-tested.
marco closed this issue 2026-07-17 23:04:59 +02: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
marco/IsoMmo#32
No description provided.