Forts are set up as small dense challenge areas that force the player to fight a set of enemies in order to either unlock progression on the map (opening the ice door on this map) or to unlock a fixed reward (coins or a permanent extra heart when encountered on the open world).
They are setup as the object GeneralFortBoundingBox and include the following parameters:
- number of enemies–this spawns a fixed number of enemies at a random location inside the bounding box, right at the start of the fort encounter.
- Spawn Portal Points–these are an array of point objects that specify where spawn portals are meant to spawn. If empty, no spawn portals will spawn as part of the fort’s challenge.
- Fort Number–this is a parameter used to track which fort is activating when relevant for keeping track of progression on the map.
- Crossbow Rat Spawn Points–these are the array of points where crossbow rats should spawn.
- Siege Bows Array–these are the array of the actual bows, already placed on the map. The user can operate these bows after they kill the rat, so they serve as a kind of turret.
- Is IceFort (boolean value to decide whether progression logic should apply).
- Fort Finish Point–single point actor indicating where to spawn the sphere that indicates a player has conquered the fort.
When the player enters the area of a fort, fort-specific combat music starts, the fixed number of enemies spawn, the spawn portals are created, and the siege bow rats are spawned.
Any open world enemies still alive are deleted and the door of the fort closes behind the player.
If the player teleports out of the fort, it destroys all enemies and ceases the fort specific combat music. Some logic should take place at this point to spawn enemies back out in the open world again.
If the player dies in the process of battling inside a fort, they should respawn at a point directly outside of the fort.
To win the fort, the player must close all the spawn portals and all the crossbow rats–as soon as they meet this criteria, all enemies are destroyed and some victory music should play.
In the future, some forts will feature specific mini-bosses and additional parameters will be added to specify different sets of enemies.