Skip to content

Manually set a sector as unsafe - #6

Open
StudentAlleg wants to merge 2 commits into
student/feat/waypointfrom
student/feat/manual-not-friendly-cluster
Open

StudentAlleg wants to merge 2 commits into
student/feat/waypointfrom
student/feat/manual-not-friendly-cluster

Conversation

@StudentAlleg

Copy link
Copy Markdown
Owner

Manually sets a sector as unsafe. Drones will avoid pathing through these sectors if at all possible. When a sector is marked, all drones check to see if they were pathing through it. If so, they choose a new path and send an alert.

…nd now also marks a sector as dangerous (red flashing). Updated pathfinding to update when this happens and send a notification if a miner was re-routed because of this.
Comment thread src/FedSrv/FedSrv.CPP Outdated
TrapHackBoot(pcluster);
pcluster->SetHighlight(pside->GetObjectID(), pfmHC->highlight);

//Xynth #208 What a drone says when the mark pushes it off the route it was flying.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

not apart of Xynth's 208 changes

Comment thread src/FedSrv/FedSrv.CPP Outdated
pcluster->SetHighlight(pside->GetObjectID(), pfmHC->highlight);

//Xynth #208 What a drone says when the mark pushes it off the route it was flying.
//Swap this for whichever line fits best - the names are in src/Igc/sounds.h.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

we are keeping, remove comment

Comment thread src/Igc/clusterIGC.cpp Outdated
}

m_highlight = false; //Xynth #208
for (SideID sid = 0; sid < c_cSidesMax; sid++) //Xynth #208

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

not a //Xynth kgersen#208 change

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

The server-side drone reroute/alert logic only compares the first hop and can miss drones whose route intersects the newly-dangerous sector later, which doesn’t fully match the PR’s stated behavior.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds a per-team “sector marking” system that supports cycling highlight states (none/important/danger), propagates the state over the network, and updates AI/pathing to prefer avoiding “danger” sectors while keeping client route rendering consistent with the AI’s actual routing behavior.

Changes:

  • Replace the legacy boolean sector highlight with a per-side ClusterHighlight state (none/important/danger) and update message payloads/versioning accordingly.
  • Update minimap interaction/rendering to cycle and display highlight states (cyan for important, red for danger).
  • Update routing utilities so AI (and route drawing) prefer to avoid sectors marked dangerous, falling back only when no other route exists.
File summaries
File Description
src/Wopr/AllegianceInterop/igcWrapper.h Updates interop cluster highlight API to be per-side and multi-state.
src/Wopr/AllegianceInterop/igcWrapper.cpp Wires interop wrapper calls through to the updated native interface.
src/Wopr/AllegianceInterop/AllMessages.h Updates managed message wrapper to carry ClusterHighlight instead of bool.
src/WinTrek/sectormap.cpp Cycles highlight state on ctrl-right-click and renders important/danger colors.
src/WinTrek/cmdview.cpp Draws routes using the same “real route” search as AI (FindRouteList).
src/Inc/MessageVersion.h Bumps MSGVER for the wire-format change to HIGHLIGHT_CLUSTER.
src/Inc/Messages.h Changes CS_HIGHLIGHT_CLUSTER payload to ClusterHighlight.
src/Igc/shipIGC.h Implements new IshipIGC::ReplanRoute() by delegating to GotoPlan.
src/Igc/igc.h Introduces ClusterHighlight constants; updates interfaces and routing APIs; adds FindRouteList/FindRoute and GotoPlan::ReplanRoute.
src/Igc/common.cpp Implements danger-avoidance in path search and adds FindRouteList/FindRoute.
src/Igc/clusterIGC.h Stores highlight per side and updates IclusterIGC implementation accordingly.
src/Igc/clusterIGC.cpp Initializes per-side highlight state on cluster initialize.
src/FedSrv/FedSrv.CPP Validates highlight messages, applies marks server-side, and triggers drone replanning/alert logic.
src/clintlib/appmsg.cpp Applies incoming highlight state for the local side and plays activation sound for any non-none mark.
Review details
  • Files reviewed: 14/14 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/FedSrv/FedSrv.CPP Outdated
Comment on lines +7432 to +7433
if (FindRoute(pshipDrone, pmodelPlan, pshipDrone->GetPilotType() < c_ptCarrier) == pwarpFlying)
continue; //Same first aleph: the route it is flying still stands
Comment thread src/WinTrek/sectormap.cpp Outdated
Comment thread src/Igc/common.cpp Outdated

static bool IsFriendlyCluster(IclusterIGC* pcluster, IsideIGC* pside)
{
//Xynth #208 A sector the team has marked as dangerous is never friendly, whatever is

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

not a Xynth change

Comment thread src/Igc/common.cpp Outdated
return rc;
}

//Xynth #208 A sector the side has marked dangerous is not routed through. Unlike

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

not a xynth change

Comment thread src/Igc/igc.h Outdated
//marked dangerous - are preferences: a route that exists only through what they exclude
//still beats not going at all, which is what the caller asked for. They are given up in
//that order, because the danger mark is the deliberate one and cowardice is only a habit.
//Callers that draw a ship's route use this too, so the line drawn is the one flown.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

wordy

Marking a sector dangerous only replanned drones whose committed first
aleph changed, so a drone whose route met the sector further along kept
flying it and said nothing. Look at the whole route instead - the leg it
is committed to, plus the search from where that leg comes out - and
replan every drone whose route runs through the sector. The check has to
run before the mark is applied, because afterwards the search keeps out
of the sector and there is nothing left to recognise; clearing a mark is
the mirror case and runs after.

Also drop the //Xynth kgersen#208 tags from code that is not part of that
change, remove the leftover note about swapping the reroute sound, and
tighten the FindRouteList and sector-outline comments.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E6xUxh5QSWKV5rAJawfaUg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants