Skip to content

Castle Siege Mini-Map & Guild Commands #730

@sven-n

Description

@sven-n

Summary

Implement the Castle Siege mini-map feature (showing ally and NPC positions during battle) and the guild command system (alliance masters issuing directional orders to their side).

Prerequisites

Requirements

1. Mini-Map Feature

Access Control:

  • Only alliance masters of participating guilds can view the mini-map.
  • Only available during Start state.
  • Server tracks which players have requested the mini-map in CastleSiegeContext.

Update Cycle (every 3 seconds during Start):

  1. For each participating guild with an online guild master who requested the mini-map:
    a. Collect positions of all same-side players in the CS map (up to 1000 points per guild).
    b. Identify the guild master position separately.
    c. Collect positions of NPC objects: gates and guardian statues (alive ones).
  2. Send two packets to each requesting guild master:
    • CastleSiegeMiniMapPlayerPositions — member coordinates.
    • CastleSiegeMiniMapNpcPositions — gate/statue coordinates.

2. Mini-Map Request Handler

When a player sends a mini-map request:

  • Validate: player is an alliance master of a participating guild, state is Start.
  • Add to the mini-map request tracking set.
  • Send initial acknowledgment.

3. Guild Commands

Alliance masters can issue commands to all same-side members on the CS map.

Packet structure:

team : byte     — Team identifier
x : byte        — Target X coordinate
y : byte        — Target Y coordinate
command : byte  — Command type

Processing:

  1. Validate: player is an alliance master of a participating guild, state is Start.
  2. Rebroadcast the command to all players on the same side in the CS map.

4. Mini-Map Data Gathering — New file: GameLogic/CastleSiege/CastleSiegeMiniMap.cs

public class CastleSiegeMiniMap
{
    public async ValueTask UpdateAsync(CastleSiegeContext context, GameMap csMap)
    {
        // 1. Iterate all players in csMap
        // 2. Group by guild, filter participating
        // 3. Build position data per guild
        // 4. Build NPC position data
        // 5. Send to each requesting alliance master
    }
}

5. View Interfaces — New files in GameLogic/Views/CastleSiege/

  • ICastleSiegeMiniMapPlugIn — sends player position data for the mini-map.
  • ICastleSiegeMiniMapNpcPlugIn — sends NPC position data for the mini-map.
  • ICastleSiegeCommandPlugIn — sends a guild command to a player.

6. Remote View Plug-ins — New files in GameServer/RemoteView/CastleSiege/

  • CastleSiegeMiniMapPlugIn — serializes player positions.
  • CastleSiegeMiniMapNpcPlugIn — serializes NPC positions.
  • CastleSiegeCommandPlugIn — serializes command broadcast.

7. Message Handlers — New files in GameServer/MessageHandler/CastleSiege/

  • CastleSiegeMiniMapRequestHandlerPlugIn — handles mini-map request.
  • CastleSiegeCommandHandlerPlugIn — handles C1-B2-1D guild command.

8. Guild Command Action — New file: GameLogic/CastleSiege/Actions/CastleSiegeGuildCommandAction.cs

Validates the command and rebroadcasts to all same-side players.

Files to Create

File Description
GameLogic/CastleSiege/CastleSiegeMiniMap.cs Mini-map data gathering
GameLogic/CastleSiege/Actions/CastleSiegeGuildCommandAction.cs Guild command action
GameLogic/Views/CastleSiege/ICastleSiegeMiniMapPlugIn.cs View interface
GameLogic/Views/CastleSiege/ICastleSiegeMiniMapNpcPlugIn.cs View interface
GameLogic/Views/CastleSiege/ICastleSiegeCommandPlugIn.cs View interface
GameServer/RemoteView/CastleSiege/CastleSiegeMiniMapPlugIn.cs Remote view
GameServer/RemoteView/CastleSiege/CastleSiegeMiniMapNpcPlugIn.cs Remote view
GameServer/RemoteView/CastleSiege/CastleSiegeCommandPlugIn.cs Remote view
GameServer/MessageHandler/CastleSiege/CastleSiegeMiniMapRequestHandlerPlugIn.cs Packet handler
GameServer/MessageHandler/CastleSiege/CastleSiegeCommandHandlerPlugIn.cs Packet handler

Acceptance Criteria

  • Only alliance masters of participating guilds can request the mini-map.
  • Mini-map data is sent every 3 seconds during battle.
  • Player positions are grouped by guild and sent to the alliance master.
  • NPC positions (gates, statues) are included in the mini-map.
  • Guild commands are broadcast to all same-side players on the CS map.
  • Mini-map and commands are only available during Start state.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions