Skip to main content

Solo and multiplayer

Action Battle works the same in standalone (RPG) and multiplayer (MMORPG) games. Factions and target selectors decide who fights whom.

Factions and targets

BattleAi can target players, other battle events, every combat entity, hostile factions, or an explicit list of factions.
Available target selectors:
  • players: target all players.
  • events: target action-battle events.
  • all: target players and action-battle events.
  • hostile: target entities with a different faction.
  • ["guards", "bandits"]: target only these factions.
  • (context) => boolean: fully custom target rule.
An allied event can share the player faction and attack only monster groups:
Two enemy groups can fight each other:
You can change faction and targets at runtime:
Players keep the previous behavior by default: their action attack targets action-battle events. To enable PvP or teams, set the player target selector and faction on the server:
Use "hostile" as the selector to target every entity of another faction. For a free-for-all, give each player its own faction:
MMORPG mode: Set the faction and targets in onJoinMap, not in onConnected. In MMORPG mode, changeMap() transfers the player to the map room, which only keeps synchronized properties (name, hp, …). actionBattleFaction, actionBattleTargets and player.param[...] values such as ATK set before the transfer are lost: no hit lands, or damage is 0. Set them again in onJoinMap.

Server authority and client presentation

Gameplay is decided on the server in both standalone and MMORPG games; the client only presents it. See Recommended composable DX and Enemy attack cadence for details.