Teams and Clans

How the players group up: teams for a play session and clans that are saved in the database. Both are part of the teams feature (enabled in Features).

Teams

A team is a group of players created in the game, it is not saved: it ends when the players leave it or log out.

  1. The player clicks another player in the same room and the target box shows the Team - Invite button.
  2. The invited player gets the "Team request from" dialog and clicks Accept (or Decline).
  3. The team icon appears in both players UI, it opens the team box with the leader name and the HP and MP of the other members.
Reldens - Target box with the Team - Invite button Reldens - Team request dialog of the invited player Reldens - Team box of the team leader
  • The leader removes a member with the x next to the name and ends the team with Disband Team; the other members have Leave Team.
  • When a team of two players loses one, the team ends.
  • The team is kept when the members change rooms, and a player that logs out leaves the team.
  • The rewards of the enemies killed by a member are shared with the team, see Rewards sharing below.

Clans

A clan is saved in the database: the players stay in their clan after logging out, and the clan is loaded again when a member logs in.

  1. A player without a clan opens the clan icon, writes the clan name and clicks Create. The name must be unique, up to 50 characters.
  2. The leader clicks another player in the same room and the target box shows the Clan - Invite button.
  3. The invited player accepts the "Clan request from" dialog and becomes a member.
  4. The clan box shows the clan name and leader, the connected players with their HP and MP, and every member.
Reldens - Clan creation box Reldens - Clan box with the connected players and the members
  • The leader removes members and has Disband Clan, the other members have Leave Clan. The clan is deleted when it has no members left.
  • By default only the leader can invite; with the client/clan/general/openInvites config at 1 every member can.
  • A new clan starts with the first Clan > Levels row (ordered by key) and the points of the server/clan/settings/startingPoints config (1 by default). Without any level row the clan can not be created.
  • The clan points and level do not change by themselves in the current version, and the Levels Modifiers are stored but not applied to the members yet: use them from your own code.

Managing clans in the admin panel

The Clan section of the admin sidebar has the Clan, Levels, Levels Modifiers and Members lists. The clans and the members are created by the players in the game, the admin panel is useful to review them, rename a clan or change its points:

Admin Panel - Clan list Admin Panel - Clan members list

See Clan Entity, Clan Members Entity, Clan Levels Entity and Clan Levels Modifiers Entity.

Rewards sharing

When a team member kills an enemy, its rewards (see Rewards Entity) are shared with every team member, configured in the client/rewards/general config:

  • splitExperience - 0 (default) the experience is divided in equal parts, 1 each member gets a part proportional to its level.
  • The item rewards that go directly to the inventory are given to a random member.
  • The modifier rewards are applied to every member (splitModifier 0, the default).
  • splitItems - the dropped items picked up by a member go to a random member, set it to 0 so the player that picks the item keeps it.

Configuration reference

  • client/ui/teams/enabled and client/ui/clan/enabled - show the team and clan UI, with their x, y, responsiveX and responsiveY position.
  • client/ui/teams/sharedProperties and client/ui/clan/sharedProperties - the stats shown for each member, as JSON: {"hp":{"path":"stats/hp","pathMax":"statsBase/hp","label":"HP"}}.
  • server/clan/settings/nameLimit (50) and server/clan/settings/startingPoints (1).
  • client/team/labels/* and client/clan/labels/* - the box titles and button labels, for example client/clan/labels/clanTitle "Clan: %clanName - Leader: %leaderName".

Code integration (advanced)

  • Server: TeamsPlugin (lib/teams/server/plugin.js) registers the teams and clan message actions, loads the player clan on reldens.createPlayerAfter, keeps the team on room changes and removes the player on reldens.removePlayerBefore. The teams and clans live in teamsPlugin.teams and teamsPlugin.clans.
  • Events to change the flow: reldens.tryTeamStart, reldens.beforeTeamCreate, reldens.beforeTeamJoin, reldens.afterPlayerJoinedTeam, reldens.teamLeave, reldens.beforeTeamDisband, reldens.tryClanStart, reldens.clanLeave and reldens.beforeClanDisband; most of them carry a continue* flag to cancel the action.
  • Client: lib/teams/client/plugin.js, with the invite buttons added by TargetBoxEnricher and the boxes rendered by TeamMessageHandler and ClanMessageHandler.
Go Up