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):
- 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).
- 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:
- Validate: player is an alliance master of a participating guild, state is
Start.
- 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
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
Startstate tick handlers.Requirements
1. Mini-Map Feature
Access Control:
Startstate.CastleSiegeContext.Update Cycle (every 3 seconds during
Start):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).
CastleSiegeMiniMapPlayerPositions— member coordinates.CastleSiegeMiniMapNpcPositions— gate/statue coordinates.2. Mini-Map Request Handler
When a player sends a mini-map request:
Start.3. Guild Commands
Alliance masters can issue commands to all same-side members on the CS map.
Packet structure:
Processing:
Start.4. Mini-Map Data Gathering — New file:
GameLogic/CastleSiege/CastleSiegeMiniMap.cs5. 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— handlesC1-B2-1Dguild command.8. Guild Command Action — New file:
GameLogic/CastleSiege/Actions/CastleSiegeGuildCommandAction.csValidates the command and rebroadcasts to all same-side players.
Files to Create
GameLogic/CastleSiege/CastleSiegeMiniMap.csGameLogic/CastleSiege/Actions/CastleSiegeGuildCommandAction.csGameLogic/Views/CastleSiege/ICastleSiegeMiniMapPlugIn.csGameLogic/Views/CastleSiege/ICastleSiegeMiniMapNpcPlugIn.csGameLogic/Views/CastleSiege/ICastleSiegeCommandPlugIn.csGameServer/RemoteView/CastleSiege/CastleSiegeMiniMapPlugIn.csGameServer/RemoteView/CastleSiege/CastleSiegeMiniMapNpcPlugIn.csGameServer/RemoteView/CastleSiege/CastleSiegeCommandPlugIn.csGameServer/MessageHandler/CastleSiege/CastleSiegeMiniMapRequestHandlerPlugIn.csGameServer/MessageHandler/CastleSiege/CastleSiegeCommandHandlerPlugIn.csAcceptance Criteria
Startstate.