@civ-clone/core-diplomacy

0.1.3 • Public • Published

core-diplomacy

Contains base entities for basic diplomacy.

  • Interaction for anything that happens involving Players.
  • Declaration for tracking persistent state between Players.
  • Expiry for terminating Declarations based on the current Turn.
  • Proposal for handling a decision within a Negotiation.
  • Resolution for resolving Proposals.
  • Negotiation for tracking chains of Proposals.

Rules to help manage some of the above entities

For Interactions

  • Created - fired on creation
  • Sentiment - allows a point system to be implemented for building a relationship score of Players based on their Interactions

For Negotiations

  • Interaction - fired at each completed step of a Negotiation
  • Step - controls which Interactions are available at any given point in a Negotiation.
  • Terminated - when the Negotiation is complete

For Proposals

  • Accepted/Declined/Resolved - fired when Proposals 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 a Voter, Proposals could then be voted on by any entity that implements the interface and the concept could work for any type of diplomacy like UN, internal City elections, etc
  • Full support for more than two participants.
  • ResolutionStrategys for requirements like Unanimous and Majority to allow Proposals to be actioned.
  • Dialogue probably shouldn't be a Proposal...

Package Sidebar

Install

npm i @civ-clone/core-diplomacy

Weekly Downloads

4

Version

0.1.3

License

MIT

Unpacked Size

80.4 kB

Total Files

120

Last publish

Collaborators

  • dom111