Skip to content
This repository was archived by the owner on May 2, 2020. It is now read-only.

Gather points for production buildings #3

@puzzlepaint

Description

@puzzlepaint

With one or more production buildings selected, right-clicking on the map should set the gather point for the selected buildings.

  • The gather point should be stored in the ClientBuilding and should be displayed graphically with a flag sprite when this building is selected. Notice that gather points could be set to a map coordinate, but can in some cases (for town centers) also be set on a resource, for example.
  • The gather point should be sent to the server with a new message type.
  • The server checks the validity of the message and stores the gather point in the corresponding ServerBuilding(s) if valid.
  • If a building that has a gather point set produces a new unit, its target should be automatically set to the gather point (ServerUnit::SetTarget()) or it should attempt to move there in case it is a map coordinate.
  • The building should also attempt to spawn the unit at the point where it is closest to the gather point. This could be done somewhat intelligently; for example, it is possible that a building is built next to a forest, and there is a single free tile between the building and the forest. Spawning a unit on this tile would trap it, which may cause frustration for the player. To prevent this, pathfinding could be used to figure out whether there is a valid path between the gather point and the spawn location. However, care should be taken not to cause too many pathfinding requests in order not to slow the server down too much.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions