Class Caspar
- All Implemented Interfaces:
IClient
Princess. It shares Princess's entire
network/phase/state plumbing; experimental behavior is added by overriding Princess's wiring seams (for
example initializePathRankers() and initializeFireControls()) so that each divergence can
be compared against Princess head-to-head.
Current divergences from Princess:
- Mutual Support movement doctrine (
MutualSupportPathRanker): supporting-range cohesion instead of center-of-mass herding, a cover bonus for advancing inside a set friend's engagement envelope, and a uniform closing tempo so slow and fast elements commit together. - Mutual Support deployment (
MutualSupportDeployment): a force comes onto the board as a formation instead of scattering across its whole deployment zone. - Atmospheric aerospace doctrine (
AerospacePathRanker,AerospaceFireControl,AeroGroundDoctrinePathFinder): altitude becomes something the bot chooses rather than a constant, air-to-air dead zones are respected in both movement and gunnery, and enemy fighters that have already moved are told apart from those that have not. - Aerospace move order: fighters whose engagement geometry is already settled move before those still waiting on an opponent, and an element's lead moves ahead of its wingmen.
-
Nested Class Summary
Nested classes/interfaces inherited from class megamek.client.bot.princess.Princess
Princess.HeatMapMarkerNested classes/interfaces inherited from class megamek.client.bot.BotClient
BotClient.CalculateBotTurnNested classes/interfaces inherited from class megamek.client.AbstractClient
AbstractClient.ConnectionHandler -
Field Summary
Fields inherited from class megamek.client.bot.princess.Princess
DISTANCE_TO_WAYPOINTFields inherited from class megamek.client.bot.BotClient
behaviorSettings, boardClusterTracker, BOT_TURN_RETRY_COUNT, frame, rerolledInitiativeFields inherited from class megamek.client.AbstractClient
awaitingSave, bots, connected, connection, connectionListener, connThread, disconnectFlag, host, iconCache, localPlayerNumber, log, name, phaseReport, port, roundReport, unitNameTracker -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected AeroGroundPathFinderaeroGroundPathFinder(Game game) CASPAR divergence: generate ground-mapsheet aerospace paths at more than one altitude, so the ranker has an altitude to choose rather than inheriting a constant.protected doublecalculateMoveIndex(Entity entity, StringBuilder msg) Moves the fighters whose engagement is already decided before the ones still waiting to find out.protected MovePathcontinueMovementFor(Entity entity) CASPAR divergence: a grounded aerospace unit tries to get back in the air.Which AI implementation this bot is.voidInitialize the fire controls.voidInitialize the possible path rankers.prioritizeDeploymentCoords(Entity deployedUnit, List<Coords> possibleDeployCoords) Orders the candidate deployment hexes thatPrincess.rankDeploymentCoords(Entity, List)will scan.Methods inherited from class megamek.client.bot.princess.Princess
abandonShipOneUnit, addDesignatedTagTarget, addStrategicBuildingTarget, calcAmmoConservation, calculateAdjustment, calculateAimedShotLocation, calculateArtyAutoHitHexes, calculateCalledShotDirection, calculateDeployment, calculateFiringTurn, calculateInfantryVsInfantryCombatTurn, calculateMoveTurn, calculatePhysicalTurn, calculatePointBlankShot, calculatePreEndDeclarationsTurn, calculateTargetingOffBoardTurn, checkForEnhancedTargeting, checkMorale, clearDesignatedTagTargets, clearManualAMSIds, computeGuidedWeapons, computeTeamTagUtility, createPrincess, decideToRerollInitiative, die, disconnected, endOfTurnProcessing, flagManualAMSUse, getAerospaceFocus, getAerospaceGroundOrder, getAimedShotLocation, getAllowCalledShotsOnImmobile, getAppropriateTarget, getAppropriateTarget, getArtilleryCommandAndControl, getArtilleryTargetingControl, getCalledShotDirection, getCoverageValidator, getDesignatedTagTargets, getEnemyHotSpots, getEnemyTracker, getEnhancedTargetingControl, getFallBack, getFireControlState, getFirstValidCoords, getFriendlyHotSpot, getFriendlyHotSpot, getHoldPosition, getHonorUtil, getMaxWeaponRange, getMaxWeaponRange, getMovePathsAndSetNecessaryTargets, getPartialCoverEnhancedTargeting, getPathRankerState, getPriorityUnitTargets, getShootAndScoot, getShootAndScootHex, getSpinUpThreshold, getStrategicBuildingTargets, getSwarmCenterManager, getSwarmContext, getUnitBehaviorTracker, handlePacket, hasStrategicBuildingTargets, initEnemyHeatMaps, initFiring, initFriendlyHeatMap, initialize, initMovement, initTargeting, isAtmosphericAerospace, isValidEnhancedTargetingAttacker, isValidEnhancedTargetingTarget, pickTagTarget, postMovementProcessing, processChat, rankDeploymentCoords, rankKernelAroundCoords, receiveEntityUpdate, refreshCrippledUnits, registerFireControl, registerPathRanker, removeStrategicBuildingTarget, resetEnhancedTargeting, resetSpinUpThreshold, revealEntities, seeEnhancedTargetingAttackerTypes, seeEnhancedTargetingTargetTypes, sendBotSettingsToServer, sendChat, sendDishonoredData, sendLoadGame, sendPrincessSettings, setAerospaceFocus, setAerospaceGroundOrder, setAllowCalledShotsOnImmobile, setAttackAsAimedOrCalled, setBehaviorSettings, setEnableEnhancedTargeting, setEnhancedTargetingAttackerTypes, setEnhancedTargetingTargetTypes, setFallBack, setFleeBoard, setHoldPosition, setPartialCoverEnhancedTargeting, setShootAndScoot, setShootAndScootHex, shouldAbandon, showArtilleryHeatMap, startPrecognition, updateEnemyHeatMaps, updateEntityState, updateFriendlyHeatMap, usedManualAMSMethods inherited from class megamek.client.bot.BotClient
cacheImgTag, calculatePrePhaseTurn, changePhase, connectOwnTrains, correctName, deployMinefields, doAlertDialog, getArbitraryEntity, getBehaviorSettings, getClusterTracker, getEnemyEntities, getEntitiesOwned, getFriendEntities, getMassOfAllInBuilding, getStartingCoordsArray, getStrandedEntities, isBot, keepGameLog, performVictorySetupTurn, receiveReport, setClientGUIMethods inherited from class megamek.client.Client
canUnloadStranded, changeTurnIndex, deploy, getAvailableMapSizes, getBoard, getBoard, getEntitiesVector, getEntity, getFirstDeployableEntityNum, getFirstEntityNum, getGame, getMapSettings, getMyTurn, getNextDeployableEntityNum, getNextEntityNum, getPrevEntityNum, getSelectedEntities, getSkillGenerator, handleGameSpecificPacket, isMyTurn, moveEntity, receiveAttack, receiveBuildingAdd, receiveBuildingCollapse, receiveBuildingRemove, receiveBuildingUpdate, receiveDeployMinefields, receiveEntities, receiveEntitiesUpdate, receiveEntityRemove, receiveEntityVisibilityIndicator, receiveForcesDelete, receiveForceUpdate, receiveIlluminatedHexes, receivePrincessDishonored, receiveRemoveMinefield, receiveRevealMinefield, receiveSendingMinefields, receiveTurns, receiveUpdateCutHexes, receiveUpdateGroundObjects, receiveUpdateIndustrialElevators, receiveUpdateMinefields, sendActivateHidden, sendAddEntitiesToForce, sendAddEntity, sendAddForce, sendAddSquadron, sendAmmoChange, sendAMSAssignCFRResponse, sendAPDSAssignCFRResponse, sendArtyAutoHitHexes, sendAssignForceFull, sendAttackData, sendBuildingEdit, sendBuildTrain, sendCalledShotChange, sendChangeOwner, sendChangeTeam, sendChargeLevelChange, sendCustomInit, sendDamageEdit, sendDeleteEntities, sendDeleteEntity, sendDeleteForces, sendDeployBridge, sendDeployFortifications, sendDeployGroundObjects, sendDeploymentUnload, sendDeployMinefields, sendDominoCFRResponse, sendEjectionSettingChange, sendEntityWeaponOrderUpdate, sendExplodeBuilding, sendForceParent, sendGameOptions, sendGhostTargetAction, sendHexEdit, sendHiddenPBSCFRResponse, sendInfantryActionDeclaration, sendLoadEntity, sendLobbyBoardGenerationRequest, sendMapDimensions, sendMapSettings, sendModeChange, sendMountFacingChange, sendNovaChange, sendPlanetaryConditions, sendPlayerPickedPassThrough, sendPrePhaseData, sendRerollInitiativeRequest, sendResetRoundDeployment, sendSensorChange, sendSinksChange, sendSpecialHexDisplayAppend, sendSpecialHexDisplayDelete, sendSystemModeChange, sendTAGTargetCFRResponse, sendTelemissileTargetCFRResponse, sendTowEntity, sendUnitAbandonmentAnnouncement, sendUnloadStranded, sendUpdateEntity, sendUpdateEntity, sendUpdateForce, sendUpdateForce, sendVariableRangeTargetingModeChange, setSkillGeneratorMethods inherited from class megamek.client.AbstractClient
addCloseClientListener, checkDuplicateNamesDuringAdd, connect, fireSaveCompleted, flushConn, getBots, getHost, getLocalPlayerNumber, getName, getPort, handleGameIndependentPacket, initGameLog, isAwaitingSave, isConnected, memDump, possiblyWriteToLog, receivePlayerInfo, receiveUnitReplace, send, sendArtilleryRevealPreference, sendChat, sendDone, sendNextPlayer, sendPause, sendPlayerInfo, sendPlayerInfo, sendServerChat, sendUnpause, setAwaitingSave, setLocalPlayerNumber, setName, setSaveCompletionCallback, updateConnectionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface megamek.client.IClient
getBotClient, getInGameObject, getInGameObjects, getLocalPlayer, getPlayer, isLocalBot, playerExists
-
Constructor Details
-
Caspar
Creates a new CASPAR bot with the given display name, configured for the given host and port.- Parameters:
name- The display namehost- The host address to which to connectport- The port on the host where to connect
-
-
Method Details
-
getAIType
Description copied from class:BotClientWhich AI implementation this bot is. Reported to the server alongside the bot's settings so a savegame remembers what kind of bot held each seat, and shown by the bot config dialog so it tells the truth about a running bot instead of assuming Princess. Subclasses that are their own AI type override this. -
initializePathRankers
public void initializePathRankers()Description copied from class:PrincessInitialize the possible path rankers. Has a dependency on the fire controls being initialized.- Overrides:
initializePathRankersin classPrincess
-
initializeFireControls
public void initializeFireControls()Description copied from class:PrincessInitialize the fire controls.- Overrides:
initializeFireControlsin classPrincess
-
aeroGroundPathFinder
CASPAR divergence: generate ground-mapsheet aerospace paths at more than one altitude, so the ranker has an altitude to choose rather than inheriting a constant.- Overrides:
aeroGroundPathFinderin classPrincess- Parameters:
game- the current game- Returns:
- the path finder to enumerate ground-mapsheet aerospace movement with
-
continueMovementFor
CASPAR divergence: a grounded aerospace unit tries to get back in the air. The engine has always supported both takeoff types; no bot has ever asked for one - a crashed fighter sat as terrain for 33 rounds in the game that motivated this. Runway first when the strip is clear (nothing to roll), vertical liftoff when boxed in and the roll clears the stunt floor, ground turret otherwise. A crippled-but-flyable fighter taking off IS its forced withdrawal: once airborne, the Winchester and fallback doctrines fly it off the board.- Overrides:
continueMovementForin classPrincess- Parameters:
entity- The entity who is to move.- Returns:
- The calculated move path.
-
calculateMoveIndex
Moves the fighters whose engagement is already decided before the ones still waiting to find out.Aerospace units move last and in their own turn class, interleaved between players, so partway through that block some enemy fighters have committed to an altitude this turn and some have not. A fighter facing opponents who have committed can pick an altitude that guarantees an engagement; one facing opponents still to move can only guess. Spending the earlier turn slots on the decided fighters leaves the undecided ones later, by which time more of the enemy has committed.
Within a force, the heaviest fighter goes first and its wingmen follow, so an element always keeps something back that can react to whatever its lead flushes out (the move-order habit described in the aerospace primer, chapter 10.4).
- Overrides:
calculateMoveIndexin classPrincess- Parameters:
entity- The unit to be indexed.- Returns:
- The movement index of this unit. May be positive or negative. Higher index values should move first.
-
prioritizeDeploymentCoords
protected List<Coords> prioritizeDeploymentCoords(Entity deployedUnit, List<Coords> possibleDeployCoords) Description copied from class:PrincessOrders the candidate deployment hexes thatPrincess.rankDeploymentCoords(Entity, List)will scan.This matters more than it looks. The candidate list arrives shuffled, and the scan below stops after roughly twenty entries, so whatever sits at the front of this list is very nearly the whole choice. Princess returns it unchanged: each unit is placed on terrain merit alone, with no regard for where the rest of the force went.
- Overrides:
prioritizeDeploymentCoordsin classPrincess- Parameters:
deployedUnit- the unit being placedpossibleDeployCoords- legal deployment hexes- Returns:
- the hexes to scan, in the order to scan them
-