Settlement Concept

Revision as of 12:58, 27 February 2011 by PeterW (talk | contribs)

This is a settlement concept as I (PeterW) currently would like to see it implemented. It already contains a lot of ideas from other people, and I fully expect it to see a lot of updates when people think up better solutions. There even are sections marked as "ideas!" where I feel substantial improvements will be necessary in order to reach a good solution.

Feedback is therefore obviously highly welcome. But please put it into the forum, so this document can stay consistent. I will try to update it whenever I feel that we have reached consensus on an issue.

Menus

Context menus

When the player presses the interact button, a menu may open for each vehicle, building or construction site that is currently behind the Clonk, as well as an inventory menu for the Clonk and its backpack. Another press of the interact button closes all menus.

Menus can also be opened by clicking on the building. This will open all menus of vehicles, buildings or construction sites that are at the position of the mouse click.

As many context menus might open at the same time, it is important to make the origin clear for each of them. The menus should be stacked in the following order:

  1. Building / construction site menus
  1. Vehicle menus
  1. Clonk / item menus

Actions

A menu might containing "actions" that the vehicle, building or item might be tasked to execute. An example would be "open" for drawbridges, "produce flint" for a chemical plant or "build wall" for a hammer.

An action is requested by clicking on the menu item. While an action is executing, it should be marked as such in the menu. This mark should update when the action was performed to completion (e.g. the drawbridge has opened).

Generally, action menus can only be used when the Clonk has access to the object generating it. This might mean standing directly in front of it or holding it in the hand. Zapper: Additionally, structural buildings covered by a flag of the player's team always count as accessible.

When an action menu can no more be used - e.g. because the Clonk moved away, threw the generating object or a flag was removed - it closes automatically.

Inventory

A menu might also show an "inventory" of the object in question. As this might be shown alongside with action items, these two should be made to be visually distinct.

An inventory view shows icons for all types of objects currently contained in or available to the object. If the object generally uses a fixed set of object types, exactly those icons should be shown, no matter the contents.

Each icon should be annotated with a number detailing the count of items available. Special: When combined with an appropriate action menu, each item in the inventory menu should also be annotated with an indication of how many objects of the given type the action would require.

Inventory Usage

An inventory menu can be used to transfer objects between different containers. This generally requires mouse usage. There are two methods:

  • Drag & Drop: Click the item in the inventory, then hold mouse while moving it to the menu of another object.
  • Simple click: Clicking an item in an inventory transfers it to the most likely target. This means, in order:
  1. An inventory with a restricted item set, which matches the item type (e.g. production buildings requiring it)
  2. A mobile container (lorry)
  3. The Clonk's backpack

In both cases, holding "Shift" while dragging or clicking causes this operation to automatically repeat until either there is no object type left in the source object, or the target object can't hold any more objects of the given type.

Buildings

Buildings are the main strategic game element of Clonk. This means they shape how the game will shake out in the long run. Buildings should be designed so they are static until destruction, which should typically take considerable effort.

Construction menu

Constructing a building requires the Clonk to use a construction hammer. When the hammer gets activated where it is possible to perform a construction, it shows a menu above the Clonk, showing an action item for each building category (production, structural, repair) as well as the inventory of the Clonk.

Once a category gets selected, it takes the menu to a list of the buildings in that category. While the mouse hovers over a building, the cost of the building in terms of raw material as well as gold is shown, as specified in the "Menus" section.

In addition to the cost, hovering the mouse over a building automatically shows a preview of the building. If the construction is possible at the current location, the preview will be a picture of the building as it would look like after construction, with a green color. Otherwise, it is shown at the Clonk's location, using a red color. Some buildings might have construction aids that are shown alongside the preview (say, a preview of the shaft for the elevator, so you tell whether you will hit granite).

Each building requires free space in order to build it, meaning that its face should not be covered be "too many" solid pixels or another building of the same plane. Additionally, some buildings might want to align themselves to existing buildings (structural buildings, see below). When it is not possible to construct a building at the Clonk's current location, a best effort should be made to find a close location where the structure can indeed be built. Where no special rules apply, this could be implemented as simply trying out construction sites in a given radius (say, 5 pixels). This should be visible in the preview.

Construction Process

A construction site can only be constructed up to a certain point given by the percentage of the raw material required for it. The percentage is calculated using the weighted sum of all present raw materials multiplied by their worth.

If not all material is present and the construction site is contained in the base region of the player's team, a player might attempt to buy the rest of the materials by clicking the "buy" button. The cost is automatically calculated from the worth of the remaining raw materials (discuss?).

While there are enough materials to continue the construction, the construction site automatically slowly constructs itself. A Clonk might assist by activating an construction hammer in front of the construction site for a substantial speed boost. Each time a construction hammer is activated, all materials required for construction currently contained in the Clonk's backpack are automatically transferred to the building site.

It is not possible to remove any items from a construction site's inventory.

Destruction

A building gets "damaged" by:

  • explosions
  • lightning
  • sparks from burning objects (TODO: we need a fire concept!)

After a certain threshold damage is reached, the building starts burning. Whenever a building receives damage, a message is shown detailing how much more damage the building will be able to absorb (in relation to the building's total health).

When a building burns, it changes definition to a "ruin" building variant. While it burns, it itself damages buildings that are close to it, by emitting sparks. Therefore a fire might "spread". (Not sure on this one)

A ruin will automatically stop burning after it has burnt down to half its health. At this point, it won't catch fire anymore, but lightening or explosions will cause the ruin to be destroyed instantly.

Once a ruin has been extinguished, it can be rebuild for half the price required to build the complete structure. This applies even if the construction was extinguished before burning down to half its health.

Production Buildings

Production buildings are about giving the settlement access to certain types of items or vehicles. Each production building should cover one class of items or vehicles.

They are not defensive buildings, and therefore do nothing to protect Clonks or themselves. They might burn down quickly, have no fundament and don't provide an interior for Clonks to hide.

They also don't act as storages or transport, as it is the function of vehicles. Production buildings will only ever contain a bounded amount of items for the sole purpose of performing

Function

There are two ways to produce an item or a vehicle: Either by providing the raw materials required, or by buying it for an amount of gold. The latter requires the building to be currently owned by the player's team.

Both the amount of gold required for buying as well as the amount of raw materials required for building may depend on the item/vehicle to be produced. Note however that the variety of raw materials used in each production building should be kept low. For example, the chemical lab should only accept sulphur and coal (just skip the intermediate steps from CR). Some production buildings might actually require material classes like "fuel" (coal/wood/oil).

There are two ways to provide a building with the raw materials required for a production:

  • Throw the material into a collection zone.
  • Drag & drop from the inventory or a lorry

Both methods should ignore any material that is not a raw material used by the building. Each building should be able to store up to 20 items of each material. Surplus material doesn't get accepted. It should be visible from the outside how much raw material of each type a production building currently has.

As long as a product is select, production will start automatically whenever there is enough raw material. The production building then enters a production state that might take some time to finish. The time may depend on the type of item being produced.

After production, a produced item or vehicle is either:

  • Placed into a container in front of the production building (preferred)
  • Dropped in front of the building

User Interface

Each production building has a production menu that is shown as an overlay above the building once a Clonk approaches it.

Most prominently, the production menu should show a list of the available product types as well as an "idle" setting. This should take the form of a menu. If there is a currently selected product, it should be app appropriately highlighted in the menu. If no product is selected, the "idle" icon should be highlighted. Clicking on a product type that is not currently selected makes it the new selection. Clicking on a currently selected product again attempts to buy it. Clicking on the "idle" icon deactivates any production.

Furthermore, the menu must show the raw materials required for the production. This should take the form of a separate row in the production menu, showing all raw material types the building can consume. Each one should be annotated with a caption in the form of "X/Y" where X is the number of raw objects currently present and Y is the number of raw objects required to start production. Note that Y might be 0, in which case the object in question is not required for the selected product, but for other possible products of the building.

Lastly, the menu should show the cost of the object in gold. This could be hidden when the player's does not currently own the production building.

Ideas & Notes

  • Exploration: Need a way to find out about stuff *before* you produce it. Mousing over unselected product types could semi-highlight them, show production cost and maybe some info text. Not much a fan of tooltips, need to think about where to place them.
  • Automatically getting stuff out of lorries might be a bit too much. We don't really want production buildings to empty lorries while they are pushed through. Two fixes that don't kill the system:
    • Ignore lorries that aren't currently standing
    • Allow to "unselect" product by clicking somewhere neutral in the production menu
  • Take over the traditional diagonal item exits? I find them cumbersome.

Structural Buildings

The objective of structural buildings is to give the owner a passive advantage where they were built. This typically means protection against enemy players or the environment.

Walls

The base structural building is a wall. It has fixed proportions that are larger than that of the highest production building.

When a wall gets built close to another wall, its construction site will automatically be aligned with the existing wall. If the new construction site is invalid (e.g. not enough space) it is not possible to construct a wall at the given location. The construction preview should reflect this appropriately.

When a wall finishes construction, it becomes "static back", and remains at its position until it gets destroyed.

Features

Each wall can have a number of different "features" attached to it. These are mostly static themselves. When a wall is destroyed and a feature isn't attached to a wall anymore, it gets removed. Damage done to a feature is redirected to the wall.

Upon construction, a wall automatically gains the following features:

  • A solid roof
  • A fundament, if there is no wall below it
  • If there is no wall on either side: Two doors left and right
  • If there is one wall on either side: The feature of the existing wall is moved. No additional feature is added.
  • A rail on either side where there's no other wall

To construct a feature, the building hammer must be activated while standing at the wall where the feature should be constructed. For construction of a new roof, one must stand on top of the roof in question.

Rail (ideas!)

A rail is a small wall that is always at the top of walls on sides where there is no other wall. It is meant to be used as simple cover (it can be shot through) and should also make it impossible for Clonks to climb over them.

Any new cool ideas here?

Roofs

All walls have some sort of roof. They can generally not be shot through without destroying the wall first. They can come in different versions that can be replaced by each other:

  • Solid - just a normal solid mask.
  • Ladder - the roof has a hole where a ladder goes through it. The ladder reaches a bit down. Clonks can jump on them to get to the upper level. Additionally, this adds a hole cover which automatically opens when a friendly Clonk climbs up on the ladder or stands still on top of the cover. Like doors, near enemy Clonks cause the cover to not open.
  • Elevator - this attaches a rope and a gear box to the roof, with an elevator case being attached.
  • Elevator shaft - this basically means a roof with a hole that the elevator fits through

Fundaments

A fundaments gets created on walls where there is no wall below. If a wall is built under another wall, the existing fundament is removed.

Fundaments cannot be shot through with any projectile without first destroying the fundament (and therefore the wall).

Fundament choices:

  • Normal solid
  • With a ladder: See roof
  • Elevator shaft: See roof

Side Features

These features can be added to the left and right sides of walls. When there is a wall right next to another wall, the left feature of one wall counts as the right feature of the other.

  • Wall: Solid wall.
  • Door: Solid wall with an opening that is normally blocked by a "door" object. It will open automatically when a friendly Clonk gets close, and will close automatically when an enemy Clonk is close. The door object can be destroyed separately.
  • Drawbridge: Solid wall that can be rotated as a whole.

All side features can be shot through when standing close (maybe only on the inside?).

... to be continued ...