Build menu

From Unknown Horizons - Wiki
Jump to: navigation, search
Answer This feature is available in-game
This page is part of the Unknown Horizons Design Document and the proposed features have been implemented.
The article reflects the design at that point. For new features or improvements, please create an own article or tickets instead of editing this page!

At this page we will define two different visualizations of the buildmenu.

  • a buildmenu which has a tab for every tier. In every tab the buildings are sorted by categories -> tier grouping
  • a buildmenu that has a tab per category. In each tab you have the all buildings of the category -> category grouping

Contents

Proposal (tier grouping)

The building menu is the place where you select buildings to build. It's one of the most needed menus. It is one menu that has different tabs, one tab for every tier.

Summary

The build menu can be opened by using the hotkey b or press the buildmenuicon at the bottom of the minimap.

How it should look and work (view of the player):

     _____________________
    |---------------------| \
    |category I           |  \ one line
 ___| __    __    __   __ |  /
|_1_||__|  |__|  |__| |__|| /
|_2_|---------------------|/
|#3#|cat. II     cat. III |
|_4_| __    __    __   __ |
|_5_||__|  |__|  |__| |__||
|_6_|---------------------|
    |                     |
    |                     |
    |                     |
    |                     |
    |                     | 
    |_____________________|
  • --- don't have to be drawn
  • category name should be left aligned, orientated at the first placed icon of this category

At the left side you see the different tabs, one for every tier. In this case the third tab is chosen.
In the menu you have different categories of buildings and there are the buildings, they are represented by an icon. If you hover the icon you get a tool-tip with a closer description.
If you click on the icon, you choose this building and now you are theoretically able to place it one the map.

Implementation related notes

This menu is already implemented, but its static. That means every icon is placed manually in the xml file. Take a look at this for details.

Whats the idea

Change the static build-menu to a auto-generated one. As you know, we have a database with all game information. So, there is the following information stored for every building:

  • the name
  • the tier
  • the category
  • a link to the icon of a building
  • a small description, displayed as tooltip

With this information it should be possible to generate content of the build menu on the fly.

  • create a tab for every tier
    • look how much categories are there for these tiers
    • split the available space of the tab in the number of available tiers, depending on the available buildings for these tiers.
      • max. 4 icons (buildings) per line
      • only 4 icons per per category
      • max. 2 categories per line
      • only 2 categories per line if the is no other free line to place a new category
      • a line consists of header (category label) and icons (see above)
      • cause of a fixed width and height -> only 4 lines -> max. of 8 categories
      • the tab is filled from the top to bottom
    • write a header for every category (the name of the category)
    • add all icons with their tooltips below the header, one for every available building.

Graphical content

  • icons for every building (WIP)
  • the menu graphics (already done)

Proposal (category grouping)

In contrast to the first idea, the player sees all buildings sorted by category, not by tier.

Summary

How it should look and work (view of the player):

     _____________________
    |                     |
    |     category XY     | 
 ___| __    __    __   __ |  
|_1_||__|  |__|  |__| |__|| 
|_2_|                     |
|#3#|                     |
|_4_| __    __    __   __ |
|_5_||__|  |__|  |__| |__||
|_6_|                     |
|_7_|                     |
    |                     |
    |                     |
    |                     |
    |                     | 
    |_____________________|

Instead of a number in the tab we will use icons, that represent this category.

Categories

We need some categories, so every buildings fits in one of them and no category gets too big (max. 16 per tab). This is only possible if fields do not show up in the main build menu but in the farm tab "Build related fields".

  • Infrastructure: tent, roads, storage buildings, fire service and other catastrophe prevention
  • Services: Everything incorporeal inhabitants desire (pavilion, school, tavern)
  • Montane Industry: clay pit, stone pit, mine and their refiners (carver, brickyard, smeltery, charcoal)
  • Raw resources: farm, garden as well as their refiners (distillery, tobacconist, butchery and so on)
  • Companies: last resource refiners (e.g. toolmaker). Distinction between Raw and Companies is hard. Combining them might cause a lack of space though.
  • Military: production of units and weapons

Implementation related notes

Like the other view this one will be filled automatically, so every building needs a category.

  • one tab for every category, dynamically create a tab for every category with >=1 building
  • max. 4 icons(buildings) per row in each tab
  • one tab has space for up to 16 icons/buildings (4 icons per row * 4 rows)
  • every icon (building) has a tooltip

database related tasks

  • add a new table or column to the database with the category of every building

Graphical content

  • icons for every building (WIP)
  • icons for every category tab (missing)
  • the menu graphics (already done)

Additional Ideas

Some buildings, like path and tents are built very often so we could add 2 static icons in the header of the buildmenu. Then its available in every tab. Independent from which visualization you choose.

Build menu with additional icons for the most wanted buildings. The path icon will always build the best available path. Tents always start in tier I. Both could be supported by introducing special hotkeys to build roads and tents.
Personal tools