Status of this specification: DRAFT
The equal entitlement powerbank sharing (EEPS) is an algorithm that allows multiple players to share the power of a single room in the online game Screeps.
It has the following properties:
- each player is entitled to the same amount of power eventually
- sharing is performed on a per room basis
- power distribution can be tracked by each player individually
- permanent observation of the target room is not necessary, but each powerbank has to be seen at least once
- sharing is independent of players actually taking the power they are entitled to
Each player is assigned a power tally, which is an integer tracking the amount of power this player has been entitled to.
When detecting a powerbank, a decision on the entitled player is made as follows:
- if the same powerbank has already been scanned before, return the result of the previous decision on that powerbank
- find the player with the lowest power tally so far
- if two players have the same tally, choose the player with the lexigraphically first name
- increase the tally of that player by the amount of power stored in the powerbank
- the player is entitled to the contents of the powerbank
The entitled player SHOULD be taking necessary steps to take posession of the power of that powerbank.
All other players of the party MUST NOT obtain any of the power of that powerbank and they MUST NOT interfere with the entitled player harvesting it.
Every player SHOULD log at least the following details for each encountered powerbank into permanent storage:
- game time of first seeing the powerbank
- amount of power in the powerbank
- player entitled to the power
Keeping such a log is encouraged to be able to resolve conflicts in a diplomatic way, in case players can't agree on the entitlement for a given powerbank (this can happen if a player failed to notice the presence of a powerbank).
For the same reason players are also encouraged to implement alerting/logging for party members harvesting power without entitlement.
When starting a new party, all members will start with a power tally of zero.
When adding a player to an existing party, the player with get the same tally as the player with the highest tally so far. This ensures that any existing imbalance has been settled, before the new player is entitled for the first time.
Upon removing players from a party they can't be entitled for further powerbanks. If players are removed while being entitled to an active powerbank, the powerbank MUST NOT be entitled to a different player.
The following topics are not covered by this specification and implementing them is up the party members. It is encouraged to define further specifications compatible with this one, to deal with these aspects.
In different situations all players must agree on the common state at a given point in time:
- when setting up a new party (players have to agree which powerbank is the first to be distributed by the algorithm)
- when adding or removing players from the party
- after a desynchronization (e.g. due to coding errors or a player not seeing a powerbank)
It is generally possible to perform such synchronizations maually (e.g. agree on all existing tallies while the room is devoid of a powerbank), but automatic synchronizations might reduce error potential and allow to start a mining party without human intervention.
The algorithm generally assumes players within the party to play by the rules. If any player violates the rules, it is up to the party members to decide how to proceed.
Protecting the mining operation from players outside the party is outside the scope of this specification. Probable general directions:
- the entitled player is responsible for guarding a powerbank
- the whole party is responsible for guarding a powerbank
It is assumed that players agree on whether they want to begin a common mining operation in any given room. For any group of players it might make sense to employ different rules on how to decide which rooms are shared among which players and if at all...