Author Topic: Limiting skills and structure placement to the vicinity of certain units  (Read 859 times)

MirceaKitsune

  • Technician
  • ****
  • Posts: 147
    • View Profile
This is a common feature in many RTS games, which I think the MegaGlest engine didn't implement yet. In some cases, faction designers might want to limit the creation of certain units as well as units preforming given actions to the vicinity of some structures. In other words, some buildings should only be possible to build within a given radius from other buildings, whereas certain units should only be able to preform certain skills when close enough to a specific unit.

Practical example 1: Limiting houses to the vicinity of the castle. The faction cannot place a house in the middle of nowhere, and may only create houses within a distance of eg: 15 tiles from a castle (and potentially other houses). When trying to place the house too far from a compatible structure, the hologram representation should turn red to indicate the action isn't possible.

Practical example 2: For some factions, we might want the summoner to only summon some units when standing close enough to a summoner tower (presumably to draw energy from it). Summoners can therefore wander anywhere around the map, but can only summon when they are standing at most 10 tiles away from the tower.

Practical example 3: The blacksmith can only research certain upgrades if a technodrome is located right next to it (eg: 5 tiles), otherwise the button is gray.

Note that the engine already supports boosting, so certain units gain a mana or health bonus when close enough to other units. But as far as I'm aware, there's no support for limiting the construction of some buildings to the vicinity of others, nor limiting specific actions this way. There should be a workaround to the second issue, by giving the unit 0 max mana by default and only allowing that to be enhanced by boosting... but you still can't limit the availability of specific actions.

Also: If the feature will be considered, it could be implemented to support the reverse effect as well. For example, mages could build towers that disrupt the energy of other mages, so when an enemy mage is too close it cannot preform any energy attacks. Or you cannot build houses too close to farms, because people don't like the smell or something :P