Skip to content

RuleSettings beta ​

Interface of @v12-engine/engine

ts
export interface RuleSettings

The numbers and formulas of a kind of game that are not about any one unit: the supply cap, what selling gives back, how a hit is mitigated. In groups, each about one thing: supply, production, the economy, combat, movement, the fog, talk, the camps, heroes, what the HUD is told, the score. A game module changes the ones it wants (Rules.settings: any of a group, the rest of it the engine's) and a pack the ones it brings (GamePack.settings).

Read them from world.settings in the simulation, and from session.registry.settings on a player's screen.

Members ​

camps ​

ts
camps: CampSettings;

Creeps' camps (camps.ts, CampSettings): how far from its centre a camp fights (leash), how long a creep chases without a blow (chaseTime), how long after the last blow the camp goes home (resetAfter), whether all of it answers a hit at once (helpAtOnce), whether creeps sleep at home at night until attacked (sleep), and the seconds after a camp is cleared that it comes back (respawn; never when left out). What makes creeps keep to them, sleep and come back is the heroes pack's (heroesPack). See docs/creeps.md

combat ​

ts
combat: CombatSettings;

How a hit lands and how much of it is felt, and who fights whom (CombatSettings)

economy ​

ts
economy: EconomySettings;

What is paid back, paid for and given away (EconomySettings)

fog ​

ts
fog: FogSettings;

What is seen and kept of what was (FogSettings)

heroes ​

ts
heroes: HeroSettings;

Heroes' numbers (HeroSettings): how many a player may have, the experience a level takes, what bringing one back costs. The heroes pack's to change (heroesPack(rules)); the classic RTS numbers when left out

hud ​

ts
hud: HudSharing;

What of a unit the players who see it are told beyond what they always are (its health, mana, level, buffs and their stacks), for the plates over it to show (indicators-plan U3): the seconds left of its buffs, its abilities, a hero's experience. Nothing more than that when left out

items ​

ts
items: ItemSettings;

What a hero may carry and how what it carries works (ItemSettings): the limits of groups of items (one pair of boots), unique passives counted once, the game's own rule of what may be carried

mayCommand ​

ts
mayCommand(world: World, player: PlayerId, entity: Entity): boolean;

Whether a player may command an entity: its owner, and whoever the owner shares control with (world.sides.shareControl, a force's sharedControl), when left out. What every command is checked against, and what decides whose units a player is told the own state of (orders, the queue, the bag)

movement ​

ts
movement: MovementSettings;

How units find their way among each other (MovementSettings)

production ​

ts
production: ProductionSettings;

What buildings make and how they go up (ProductionSettings)

score ​

ts
score?: ScoreSettings;

What the game counts of its players for its score (a classic RTS score screen): kills, losses, damage, healing, resources, its own (ScoreSettings, presetScore(), defineStat). Counted by the rules as the game goes, kept in saves, told to the players as it says. Nothing is counted when left out

shop ​

ts
shop: ShopSettings;

Shops (ShopSettings): the seconds within which a purchase is taken back

supply ​

ts
supply: SupplySettings;

What armies cost in supply, and how much a player may have (SupplySettings)

talk ​

ts
talk: TalkSettings;

Pings, chat and pauses (TalkSettings)