0.1.3 • Published 3 years ago
@civ-clone/core-diplomacy v0.1.3
core-diplomacy
Contains base entities for basic diplomacy.
Interactionfor anything that happens involvingPlayers.Declarationfor tracking persistent state betweenPlayers.Expiryfor terminatingDeclarations based on the currentTurn.Proposalfor handling a decision within aNegotiation.Resolutionfor resolvingProposals.Negotiationfor tracking chains ofProposals.
Rules to help manage some of the above entities
For Interactions
Created- fired on creationSentiment- allows a point system to be implemented for building a relationship score ofPlayers based on theirInteractions
For Negotiations
Interaction- fired at each completed step of aNegotiationStep- controls whichInteractions are available at any given point in aNegotiation.Terminated- when theNegotiationis complete
For Proposals
Accepted/Declined/Resolved- fired whenProposals are affected
All interactions (anything that inherits from Interaction) can be stored in the InteractionRegistry to enable
sentiment analysis.
Future ideas
I'm sure some of these approaches might not work out further down the line, the implementation of using the
chooseFromList mechanism in the Client in particular might need altering, which might encourage further changes to
the flow here, but this is "good enough" for now.
Other ideas:
Voters. Maybe this is just an interface and any object can be aVoter,Proposals could then bevoted on by any entity that implements the interface and the concept could work for any type of diplomacy like UN, internalCityelections, etc- Full support for more than two participants.
ResolutionStrategys for requirements likeUnanimousandMajorityto allowProposals to be actioned.Dialogueprobably shouldn't be aProposal...