The editor

Logic rules

Gameplay as when, if, then sentences, with no code.

Logic lives in the Systems workspace. A rule is one sentence: when an event happens, if some conditions hold, then do some actions. Rules run wherever your game runs, in Preview and in the published game, and in multiplayer their results reach every player.

When: events

EventFires
Round startsAt the start of a round or session.
Round endsWhen a round ends.
Player joinsWhen a player connects.
Player leavesWhen a player disconnects.
Score changesWhenever a score changes.
Player enters zoneWhen a player enters a trigger zone.
Player leaves zoneWhen a player leaves a trigger zone.
Every secondOnce a second, for timers and checks.

If: conditions

A rule can have no conditions (Always) or several. Each compares a fact with a value using is, is not, is below, is at most, is above or is at least.

FactWhat it reads
Round numberThe current round.
Team scoresEither team's score in a Versus game.
Player countHow many players are connected.
Event team, Event zone, Event playerDetails of the event that fired the rule.
Match variableA named number your rules set.
Item countHow many of a named item the player holds.
Quest statusInactive, active, complete or failed.

Then: actions

ActionEffect
AnnounceShows a message to players.
Set variable, Add to variableWrites a named match variable.
Emit eventFires a custom event other rules can listen for.
Give item, Take itemChanges the player's inventory, using items from Game Data.
Start, Complete, Fail questChanges a quest's status.
Win game, Lose gameEnds the match with a result screen.

Wiring a trigger to a rule

1

Place the zone

In Scene, place a trigger and give it a zone id, for example skiff_bay. In a 2D project, place a trigger in Pixel Studio\'s Place view and give it an event name.

2

Write the rule

In Logic, add a rule. Set When to Player enters zone. Add an If: Event zone is skiff_bay. Add a Then, for example Announce.

3

Test it

Press Preview and walk into the zone. The rule fires and the announcement appears in the HUD feed.

Zone ids and item names are picked from your own project, so a rule cannot point at something that does not exist. The Reference panel beside the editor lists every event, fact and action that runs today.

What runs in a published game

  • Logic rules: Authored when / if / then rules now run in every published project, evaluated by the same shared engine Sunder itself uses.
  • Trigger volumes: Placed triggers now dispatch: teleport actually moves the player in 3D (2D teleport movement is still a follow-up), and every trigger kind reaches your Logic rules as a trigger-enter / trigger-exit event.
  • Quests: Authored quests do not yet reach the runtime or the HUD - there is no quest-log widget yet for them to reach.
  • Dialogue: The Dialogue widget now shows your first authored line. Triggering a specific line from gameplay, or branching, is not wired yet.
  • Win conditions: Authored win conditions now decide match outcomes: the moment one resolves, players see a win/lose result screen and further movement/actions stop, in both 2D and 3D.
  • Multiplayer: A lightweight relay gives every published project a presence list, synchronised player movement, and shared Logic state - a variable a rule sets, a quest it starts or completes, a win/lose result - reaching every other connected player automatically, no authoring required. Good for turn-based and simple co-op. It is not a match server: one connected client is deputised to run Logic rules on behalf of the room, but nothing sent through the relay is simulated or validated - treat every player as someone who could be running modified code. Sunder alone runs a dedicated server-authoritative host with real simulation and hit registration.

Quest status still works inside rules as a condition and an action; what is not yet live is showing quest progress to the player.

For more than rules can express, see Code and scripting.