| 1 |
/* |
| 2 |
$Id$ |
| 3 |
|
| 4 |
Copyright (C) 1999/2000/2001 Kai Sterker <[email protected]> |
| 5 |
Part of the Adonthell Project http://adonthell.linuxgames.com |
| 6 |
|
| 7 |
This program is free software; you can redistribute it and/or modify |
| 8 |
it under the terms of the GNU General Public License. |
| 9 |
This program is distributed in the hope that it will be useful, |
| 10 |
but WITHOUT ANY WARRANTY. |
| 11 |
|
| 12 |
See the COPYING file for more details. |
| 13 |
*/ |
| 14 |
|
| 15 |
|
| 16 |
/*! \mainpage Item System Draft |
| 17 |
|
| 18 |
The purpose of this draft is to create a basis for discussion that will finally |
| 19 |
be turned into a specification for the low-level item, combat and inventory |
| 20 |
system. |
| 21 |
|
| 22 |
<h2>Contents</h2> |
| 23 |
|
| 24 |
-# \ref abstract |
| 25 |
-# \ref item |
| 26 |
-# \ref items1 |
| 27 |
-# \ref items2 |
| 28 |
-# \ref items3 |
| 29 |
-# \ref combat |
| 30 |
-# \ref combat1 |
| 31 |
-# \ref combat2 |
| 32 |
-# \ref inventory |
| 33 |
-# \ref inv1 |
| 34 |
-# \ref inv2 |
| 35 |
|
| 36 |
*/ |
| 37 |
|
| 38 |
/*! \page abstract Abstract |
| 39 |
|
| 40 |
This document tries to explore what type of items are required for Adonthell and |
| 41 |
which attributes and properties are needed for each item type. We will first |
| 42 |
concentrate on the use items have for a character, then turn to trading of items |
| 43 |
and finally we'll design an interface to manage them (inventory). |
| 44 |
|
| 45 |
The main emphasis lies on the definition and explanation of requirements, not |
| 46 |
on the implementation of the item subsystem. Once our needs are well defined, |
| 47 |
latter is just an exercise for the programmer. |
| 48 |
|
| 49 |
The goal is to create an item system that is both realistic and easy to use. |
| 50 |
More important, it should add new and interesting aspects to gameplay. |
| 51 |
|
| 52 |
\htmlonly |
| 53 |
<hr> |
| 54 |
<center> |
| 55 |
<< <a href="index.html">Main Page</a> |
| 56 |
<a href="index.html">Contents</a> |
| 57 |
<a href="item.html">Items</a> >> |
| 58 |
</center> |
| 59 |
\endhtmlonly |
| 60 |
|
| 61 |
*/ |
| 62 |
|
| 63 |
/*! \page item Items |
| 64 |
|
| 65 |
\subsection items1 Purpose of Items |
| 66 |
|
| 67 |
Before we can deal with items themselves, we'll have to take a look what use |
| 68 |
they have in a role playing game. That will give us an idea what kind of items |
| 69 |
we will need. |
| 70 |
|
| 71 |
\par Customising a character |
| 72 |
A major aspect of RPG's is the ability to customise human controlled characters, |
| 73 |
to a certain amount, to one's liking. This includes improvement of attributes |
| 74 |
and skills, but also the choice of a character's equipment. Among those items |
| 75 |
are armour and weapons, magic amulets and rings. |
| 76 |
|
| 77 |
\par Aiding a character |
| 78 |
There are plenty of items that can not be equipped, but have other uses that |
| 79 |
help a character in various situations. These include potions and light sources, |
| 80 |
but also items with certain magic powers. Books, which provide (valuable) |
| 81 |
information and lockpicks and keys to open doors and chests. |
| 82 |
|
| 83 |
\par Reagents |
| 84 |
Most of these items have no use on their own. However, with the right recipe |
| 85 |
they can be used to create items that can aid a character. They might also |
| 86 |
enhance other items. Reagents are various herbs, ores and other raw materials. |
| 87 |
|
| 88 |
\par Treasure |
| 89 |
Some items have no worth for the player other than their price. Gems and |
| 90 |
jewellery and all kinds of objects d'art fall into this category. |
| 91 |
|
| 92 |
Practically all items will fall into one of these categories. While they give |
| 93 |
us a good idea of the variety of items needed, they are of little help to |
| 94 |
classify them. The items within each category are simply too different and |
| 95 |
there might be items that fit into several categories. Before we try to find |
| 96 |
more practical organisation, we should have a look what all items have in |
| 97 |
common. |
| 98 |
|
| 99 |
|
| 100 |
\subsection items2 Basic Properties |
| 101 |
|
| 102 |
No matter how different two items may be, there are a few attributes they have |
| 103 |
in common. |
| 104 |
|
| 105 |
<h4>Physical properties</h4> |
| 106 |
As items are concrete objects, they need a number of attributes describing their |
| 107 |
appearance, namely weight, size and quality. |
| 108 |
- Weight can be used to determine whether a character is able to carry an item. |
| 109 |
It's the only value that can be measured directly. |
| 110 |
- Size determines whether an item is small or large, independent from it's |
| 111 |
weight. This value could be used to determine whether an item fits into a |
| 112 |
container or not. Also, up to a certain size, items of the same kind would be |
| 113 |
stackable, whereas identical, large items wouldn't be. |
| 114 |
- Quality denotes how well an item has been crafted or grown. It has an |
| 115 |
influence on the item's price but also on it's use as a reagent or bearer of |
| 116 |
enchantments. |
| 117 |
|
| 118 |
<h4>Immaterial properties</h4> |
| 119 |
There are a number of properties not directly defined through an objects |
| 120 |
physical nature: name, description and worth. |
| 121 |
- Every item has a short identifier, describing it's nature or type. Often the |
| 122 |
name gives a hint to a special property that sets an item apart from other items |
| 123 |
of the same kind. |
| 124 |
- Further, items should have a detailed explanation of their purpose as well as |
| 125 |
a listing of all special abilities. The description might also contain |
| 126 |
additional information about an item, like it's history or it's place in the |
| 127 |
game world. |
| 128 |
- The worth is an abstract measure for an item's price compared to other items. |
| 129 |
The actual price of an item depends, apart from it's physical quality, on the |
| 130 |
personal impression of the character you are dealing with. |
| 131 |
|
| 132 |
Now that we've seen what items have in common, let's go a step further and see |
| 133 |
what differences there are. |
| 134 |
|
| 135 |
|
| 136 |
\subsection items3 Item classes |
| 137 |
|
| 138 |
Before breaking everything down to individual item types, we'll try a more |
| 139 |
abstract division. Or, to put it the other way around, we'll have a look what |
| 140 |
different groups of items might have in common. The idea is to find a number of |
| 141 |
distinct properties that can be combined to form an individual item. By looking |
| 142 |
at this combination we can easily determine what actions are possible with an |
| 143 |
item. |
| 144 |
|
| 145 |
\par Offensive |
| 146 |
Items that influence an attack fall under this category. They may influence a |
| 147 |
character's basic and derived attributes that define the chance to hit and the |
| 148 |
amount of damage a successful hit will cause. An item's effect on those values |
| 149 |
might be both positive or negative. |
| 150 |
|
| 151 |
\par Defensive |
| 152 |
When under attack, these items either effect the chance to receive a hit, or the |
| 153 |
damage caused by a successful hit. Again, they might work in favour of the |
| 154 |
bearer or against it. |
| 155 |
|
| 156 |
\par Magical |
| 157 |
The magical powers of an item are kept separate. The actual effect an enchanted |
| 158 |
or magical item has is determined by the other classes it belongs to. Items can |
| 159 |
have several magical powers, and each of them can fall into a different class. |
| 160 |
|
| 161 |
\par Chargeable |
| 162 |
These are items that are either consumed through usage, or items that only work |
| 163 |
in combination with other items or magical enchantments. First ones are |
| 164 |
destroyed once no charges are left, latter can be "recharged". The actual use of |
| 165 |
such an item has to be determined otherwise. |
| 166 |
|
| 167 |
\par Usable |
| 168 |
These are items that have to be explicitly "activated" to show any effect. In |
| 169 |
some cases, activating an item will "turn it on" and it needs to be activated |
| 170 |
once more to "turn it off" again. In other cases, the item will simply apply |
| 171 |
it's effect. |
| 172 |
|
| 173 |
\par Equipable |
| 174 |
Any item that needs to be equipped to show any effect falls under this category. |
| 175 |
Some equipped items immediately effect a character's attributes, whereas others |
| 176 |
are only activated on special occasions, depending on what other class they |
| 177 |
belong to. |
| 178 |
|
| 179 |
Any item should be describable through a subset of any of these classes. The |
| 180 |
most simple items with no use whatsoever would belong to no class at all. To |
| 181 |
better understand this concept, let's have a look at a few examples. |
| 182 |
|
| 183 |
\par a Gem |
| 184 |
- Categories: - |
| 185 |
- Description: A simple item without any use. However, it could be used as a |
| 186 |
reagent or be sold. |
| 187 |
|
| 188 |
\par a Book |
| 189 |
- Categories: usable |
| 190 |
- Description: "Using" the book would display it's contents, so the player may |
| 191 |
read it. |
| 192 |
|
| 193 |
\par a Candle |
| 194 |
- Categories: chargeable, usable |
| 195 |
- Description: Using the candle would turn it on. While it burns, it is spending |
| 196 |
light (it's effect), but in the process it gets used up, until it is destroyed. |
| 197 |
|
| 198 |
\par the Helmet of Light |
| 199 |
- Categories: defensive, magical, equipable |
| 200 |
- Description: When worn (and only then) the Helmet of Light absorbs a certain |
| 201 |
amount of damage. It also radiates light, allowing it's bearer to see in the |
| 202 |
dark. Latter exposes him to his enemies however, thus decreasing the chance to |
| 203 |
avert a hit. |
| 204 |
|
| 205 |
\par a Bow |
| 206 |
- Categories: offensive, chargeable, equipable |
| 207 |
- Description: The bow itself influences the damage done on a successful hit, but |
| 208 |
without arrows it is useless. Further, it must be equipped before it can be used |
| 209 |
at all. |
| 210 |
|
| 211 |
\par the Staff of Fire |
| 212 |
- Categories: offensive, magical, chargeable, usable, equipable |
| 213 |
- Description: The Staff of Fire can be used in two ways. Equipped it acts as |
| 214 |
any wooden staff, dealing a fair amount of damage in the hand of a trained |
| 215 |
fighter. However, it also holds an amount of magical charges and using it will |
| 216 |
hurl a ball of fire against the enemy, reducing the number of charges by one. |
| 217 |
|
| 218 |
Especially from the last example we can see that there must be ways to connect |
| 219 |
the different classes, otherwise it would not be clear under what effect to |
| 220 |
apply under what circumstances. We also could imagine a Staff of Fire that would |
| 221 |
simply burn the foe when hit, in which case the offensive effect had also to |
| 222 |
apply the magical one, as long as there are charges left. (Latter version of the |
| 223 |
staff would not need to be usable though.) |
| 224 |
|
| 225 |
Later I'll present some ideas for the implementation of those classes and their |
| 226 |
interaction with each other and the character. Right now it's more important |
| 227 |
to see what purpose they fulfil: they give us an easy way to create item |
| 228 |
templates that can be turned into individual items by filling in the attributes. |
| 229 |
|
| 230 |
\htmlonly |
| 231 |
<hr> |
| 232 |
<center> |
| 233 |
<< <a href="abstract.html">Abstract</a> |
| 234 |
<a href="index.html">Contents</a> |
| 235 |
<a href="combat.html">Combat</a> >> |
| 236 |
</center> |
| 237 |
\endhtmlonly |
| 238 |
|
| 239 |
*/ |
| 240 |
|
| 241 |
/*! \page combat Combat |
| 242 |
|
| 243 |
Now that we have a way to construct individual items, lets see what attributes |
| 244 |
individual items need and what effect they have. In order to define this, we also |
| 245 |
need to know a character's attributes and some combat rules. What follows is |
| 246 |
a proposal for now, trying to take all prior discussions on that subject into |
| 247 |
account. In fact it's a summary of Mike Avery's work from early 2000. Credit |
| 248 |
whom credit is due. |
| 249 |
|
| 250 |
Combat will happen in real time, but for the sake of proper calculations, we'll |
| 251 |
break everything down into rounds behind the scenes. A round is the time a |
| 252 |
character needs for a single attack. That means that the length of a round will |
| 253 |
vary for different characters, unlike D&D where a round is a fixed length of |
| 254 |
time, but characters can do multiple attacks per round. |
| 255 |
|
| 256 |
For now we'll just concentrate on one character attacking another and leave |
| 257 |
anything else aside. An attack is divided into two phases: first, we determine |
| 258 |
whether the opponent is hit at all or not. Then, if we hit, we determine the |
| 259 |
amount of damage done. |
| 260 |
|
| 261 |
\subsection combat1 Hit Calculations |
| 262 |
For those calculations, each character needs the following attributes: |
| 263 |
<tt>dexterity</tt> and <tt>luck</tt> are basic attributes, the <tt>attack |
| 264 |
skill</tt> reflects a character's proficiency with the equipped weapon and the |
| 265 |
<tt>defence skill</tt> is the general ability to avoid being hit. From those we will calculate 4 ranges |
| 266 |
that determine the odds for a hit, a miss, a critical hit and a critical miss. |
| 267 |
These ranges will be scaled so that their sum equals 1 and weighted so that, |
| 268 |
given opponents of equal strength, the odds for hit, miss, critical hit and |
| 269 |
critical miss are 12:6:1:1. Then we roll the dice and see what we've got. Since |
| 270 |
we need attributes of both characters, we mark them with <i>A</i> (attacker) and |
| 271 |
<i>D</i> (defender) to tell them apart. |
| 272 |
|
| 273 |
First of all, we calculate the attack and defence ranges: |
| 274 |
|
| 275 |
\f[ |
| 276 |
\begin{aligned} |
| 277 |
hit\_range &= \frac{dexterity_A + attack\_skill_A}{200} \cdot 0.6, \\[2pt] |
| 278 |
miss\_range &= \frac{dexterity_D + defence\_skill_D}{200} \cdot 0.3. \\ |
| 279 |
\end{aligned} |
| 280 |
\f] |
| 281 |
|
| 282 |
From those two values we can calculate the remaining range, and the characters' |
| 283 |
luck attributes give us the ratio between critical hit and miss: |
| 284 |
|
| 285 |
\f[ |
| 286 |
\begin{aligned} |
| 287 |
crit\_allotment &= \frac{hit\_range + miss\_range}{9}, \\[2pt] |
| 288 |
crit\_ratio &= \frac{luck_A}{luck_A + luck_D}. \\ |
| 289 |
\end{aligned} |
| 290 |
\f] |
| 291 |
|
| 292 |
Now we can determine the actual critical hit and miss ranges: |
| 293 |
|
| 294 |
\f[ |
| 295 |
\begin{aligned} |
| 296 |
hit\_range_{crit} &= crit\_allotment \cdot crit\_ratio, \\[2pt] |
| 297 |
miss\_range_{crit} &= crit\_allotment - hit\_range_{crit}. |
| 298 |
\end{aligned} |
| 299 |
\f] |
| 300 |
|
| 301 |
The only thing left now is scaling these four ranges to 1. That is done by |
| 302 |
multiplying each value with a factor \f$x = 1 / (hit\_range + miss\_range + |
| 303 |
hit\_range_{crit} + miss\_range_{crit})\f$. |
| 304 |
|
| 305 |
And finally, to give you an impression how the formulas work, lets look at a few |
| 306 |
examples: |
| 307 |
|
| 308 |
- Opponents of equal strength |
| 309 |
\verbatim |
| 310 |
A D Raw Scaled |
| 311 |
|
| 312 |
dexterity 10 10 hit 0.075 0.603 |
| 313 |
luck 12 12 ---> miss 0.037 0.297 |
| 314 |
attack skill 15 13 critical hit 0.006 0.048 |
| 315 |
defence skill 18 15 critical miss 0.006 0.048 |
| 316 |
\endverbatim |
| 317 |
|
| 318 |
- Attacker (much) weaker |
| 319 |
\verbatim |
| 320 |
A D Raw Scaled |
| 321 |
|
| 322 |
dexterity 10 40 hit 0.072 0.324 |
| 323 |
luck 12 42 ---> miss 0.128 0.577 |
| 324 |
attack skill 15 38 critical hit 0.005 0.023 |
| 325 |
defence skill 18 45 critical miss 0.017 0.077 |
| 326 |
\endverbatim |
| 327 |
|
| 328 |
- Attacker (much) stronger |
| 329 |
\verbatim |
| 330 |
A D Raw Scaled |
| 331 |
|
| 332 |
dexterity 40 10 hit 0.255 0.787 |
| 333 |
luck 42 12 ---> miss 0.037 0.114 |
| 334 |
attack skill 38 13 critical hit 0.025 0.077 |
| 335 |
defence skill 45 15 critical miss 0.007 0.022 |
| 336 |
\endverbatim |
| 337 |
|
| 338 |
|
| 339 |
\subsection combat2 Damage Calculations |
| 340 |
We've seen how the hit determination works and can find out whether an attack |
| 341 |
was successful. Now we'll have a look how much damage a hit inflicts on the |
| 342 |
target. Here the equipment comes into play, although skills may influence the |
| 343 |
use a character can draw from a weapon or piece of armour. Only skilled |
| 344 |
characters can use good armour and weapons efficiently. On the other hand, |
| 345 |
skilled characters with poor equipment won't be able to make use of their |
| 346 |
full strength. |
| 347 |
|
| 348 |
We use the following attributes: the characters' <tt>strength</tt> and |
| 349 |
<tt>dexterity</tt> as well as the <tt>hit</tt>- and <tt>miss</tt> ranges |
| 350 |
calculated earlier. We further need the <tt>weapon base damage</tt>, |
| 351 |
<tt>armour rating</tt> and armour <tt>dexterity penalty</tt>. |
| 352 |
|
| 353 |
From those we calculate two modifiers that represent the abilities to inflict |
| 354 |
damage, and to absorb/avert damage: |
| 355 |
|
| 356 |
\f[ |
| 357 |
\begin{aligned} |
| 358 |
modifier_A &= (base\_damage_A + strength_A + dex\_penalty_A) \cdot hit\_range \\ |
| 359 |
modifier_D &= (armour\_rating_D \cdot 0.5 + dexterity_D) \cdot miss\_range |
| 360 |
\end{aligned} |
| 361 |
\f] |
| 362 |
|
| 363 |
\note |
| 364 |
The '0.5' in the \f$ modifier_D \f$ formula denotes the maximum percentage of |
| 365 |
base damage that armour can absorb. This is of course adjustable. |
| 366 |
|
| 367 |
From above values we can calculate the base damage: |
| 368 |
|
| 369 |
\f[ |
| 370 |
damage_{base} = \frac {modifier_A}{modifier_A + modifier_D} \cdot base\_damage_A |
| 371 |
\f] |
| 372 |
|
| 373 |
As you can see, the base damage will always be the same as long as the |
| 374 |
conditions do not change. Therefore, it should be randomly adjusted by a certain |
| 375 |
amount. \f$ \pm 20\% \f$ seems to be a good value. |
| 376 |
|
| 377 |
Lets have a look at some examples: |
| 378 |
- Opponents of equal strength |
| 379 |
\verbatim |
| 380 |
A D Equipment of A and D Base Damage |
| 381 |
Weapon Armour Penalty |
| 382 |
strength 10 10 |
| 383 |
dexterity 10 10 20 20 -2 15.032 |
| 384 |
luck 12 12 20 40 -4 ---> 13.039 |
| 385 |
attack skill 15 13 40 20 -2 33.535 |
| 386 |
defence skill 18 15 40 40 -4 30.728 |
| 387 |
\endverbatim |
| 388 |
|
| 389 |
- Attacker (much) weaker |
| 390 |
\verbatim |
| 391 |
A D Equipment of A and D Base Damage |
| 392 |
Weapon Armour Penalty |
| 393 |
strength 15 35 |
| 394 |
dexterity 10 40 20 20 -2 5.415 |
| 395 |
luck 12 42 20 40 -4 ---> 4.504 |
| 396 |
attack skill 15 38 40 20 -2 14.941 |
| 397 |
defence skill 18 45 40 40 -4 12.939 |
| 398 |
\endverbatim |
| 399 |
|
| 400 |
- Attacker (much) stronger |
| 401 |
\verbatim |
| 402 |
A D Equipment of A and D Base Damage |
| 403 |
Weapon Armour Penalty |
| 404 |
strength 35 15 |
| 405 |
dexterity 40 10 20 20 -2 18.962 |
| 406 |
luck 42 12 20 40 -4 ---> 18.427 |
| 407 |
attack skill 38 13 40 20 -2 38.475 |
| 408 |
defence skill 45 15 40 40 -4 37.689 |
| 409 |
\endverbatim |
| 410 |
|
| 411 |
There are a few things worth looking at. First of all, the base damage we get |
| 412 |
depends much on character attributes strength and dexterity. The formulas imply |
| 413 |
that the two attributes can take the same values as the weapon damage and armour |
| 414 |
rating. Otherwise one couldn't make full use of armour and weapons. |
| 415 |
|
| 416 |
Second, there are some problems with the formulas themselves: |
| 417 |
- Stronger armour has practically no benefit. |
| 418 |
- Equal opponents will cause less damage the stronger they are. |
| 419 |
- Part of the hit calculation is re-used. |
| 420 |
|
| 421 |
However, devising a set of formulas that fulfils all conditions is no easy |
| 422 |
task. So for now lets put down the requirement for the damage algorithm and |
| 423 |
leave the implementation for later: |
| 424 |
|
| 425 |
- Damage calculation should be independent from hit determination. |
| 426 |
- Both equipment and skill should influence the damage |
| 427 |
- The damage should (notably) increase with better weapons and decrease with |
| 428 |
better armour, given all other factors remain the same. |
| 429 |
- The stronger the opponents, the more damage they should cause |
| 430 |
|
| 431 |
\htmlonly |
| 432 |
<hr> |
| 433 |
<center> |
| 434 |
<< <a href="item.html">Items</a> |
| 435 |
<a href="index.html">Contents</a> |
| 436 |
<a href="inventory.html">Inventory</a> >> |
| 437 |
</center> |
| 438 |
\endhtmlonly |
| 439 |
|
| 440 |
*/ |
| 441 |
|
| 442 |
/*! \page inventory Inventory |
| 443 |
|
| 444 |
\subsection inv1 The Basics |
| 445 |
|
| 446 |
The main purpose of the inventory is to provide easy and fast access to |
| 447 |
individual items to examine, equip, use, drop or sell them. The main |
| 448 |
problem is that items are usually distributed among the party members for |
| 449 |
several reasons: |
| 450 |
|
| 451 |
- A single character may only carry a limited amount of items |
| 452 |
- The items a character carries could have an impact on his attributes, so we |
| 453 |
need to know who is carrying how much |
| 454 |
- In case the party gets separated, we must be able to determine which items are |
| 455 |
with which character. |
| 456 |
|
| 457 |
However, in general, it makes little difference what character carries what |
| 458 |
item, as long as all of them are nearby. In that case, the computer can handle |
| 459 |
any necessary item exchange that might occur if character A wants to use an |
| 460 |
item from character B's inventory. So the default mode of the inventory would be |
| 461 |
to display the items of all party members that are "nearby". Whether they are |
| 462 |
nearby or not could be determined via the pathfinding code. |
| 463 |
|
| 464 |
Since there might be a lot of items in the inventory later in the game, a filter |
| 465 |
for certain item types would be nice, so that for example only weapons or |
| 466 |
armour or potions are displayed. Sometimes it might be also interesting to see |
| 467 |
what a character actually carries. Those filters could work accumulative: first |
| 468 |
you'd select a subset of characters whose inventory you want to examine, then |
| 469 |
you decide what item types you want to see. The normal behaviour would of course |
| 470 |
be to display all items of all characters. |
| 471 |
|
| 472 |
Simply presenting the available items isn't everything the inventory has to |
| 473 |
accomplish. For one it has to display which character has which items equipped. |
| 474 |
It should also indicate whether a certain item may be used or equipped by a |
| 475 |
certain character. |
| 476 |
|
| 477 |
The inventory is used in different situations too. During normal gameplay, the |
| 478 |
player might bring it up to equip his characters, to read scrolls and books and |
| 479 |
so on. In combat however, there should be some restrictions: changing one's |
| 480 |
armour would be equally impossible as acquiring items carried by a different |
| 481 |
character. So during combat, the filters could restrict the view to the current |
| 482 |
character and to those items that can be equipped or used during combat, such as |
| 483 |
weapons and potions. |
| 484 |
|
| 485 |
All in all, basic inventory operations should impact the flow of the game as |
| 486 |
little as possible. |
| 487 |
|
| 488 |
|
| 489 |
\subsection inv2 A Suggestion |
| 490 |
|
| 491 |
Now that we know what the inventory has to do, lets see how this can be |
| 492 |
achieved. Consider we're on the normal mapview and want to access the inventory. |
| 493 |
Pressing a certain key (<i>i</i> for example) is all it takes to bring up the |
| 494 |
inventory. So how could it look like? |
| 495 |
|
| 496 |
|
| 497 |
<h4>The main inventory GUI</h4> |
| 498 |
I personally favour a minimalistic view floating on the screen without |
| 499 |
disturbing the mapview too much. Possibly a circle of item pictograms around the |
| 500 |
main character with a box marking the item in focus. Along the bottom of the |
| 501 |
screen could be a small window with the following content: |
| 502 |
|
| 503 |
- To the left might be some icons that indicate what can be done with the item |
| 504 |
in focus. Possible actions would be equip, unequip, use, examine, give and drop. |
| 505 |
- In the center is the pictogram of the focused item, it's name and possibly |
| 506 |
some basic informations about the item, depending on the context. |
| 507 |
- On the right would be two rows of images. On the top are small portraits of |
| 508 |
all party members. Below are pictograms for the different item categories. |
| 509 |
|
| 510 |
The purpose of left and center of the info window should be obvious. The icons |
| 511 |
on the right side serve multiple purposes: |
| 512 |
|
| 513 |
- First of all, they indicate the active filters. Active characters and item |
| 514 |
categories are highlighted. At the same time, these are the controls to change |
| 515 |
the filter rules. |
| 516 |
- Second, the character portraits will indicate which character is carrying the |
| 517 |
item in focus, and which characters can use or equip it. If an item is |
| 518 |
equipped by a character, the left side would also show the unequip symbol. |
| 519 |
Different borders around a portrait might show whether that character just |
| 520 |
carries or wears the item, different backgrounds could indicate which characters |
| 521 |
can or cannot use it. |
| 522 |
- And finally, if an item is selected to be equipped or given to another party |
| 523 |
member, the focus switches to the <i>filter display</i>, so you can chose |
| 524 |
the destination. The same is true for items that must be used on a character. |
| 525 |
During combat, if the item is offensive, the character portraits could be |
| 526 |
replaced by portraits of the enemies. To make things clearer, the character |
| 527 |
selected in the <i>filter display</i> should also be highlighted on the mapview. |
| 528 |
|
| 529 |
|
| 530 |
<h4>The inventory controls</h4> |
| 531 |
The controls should be similar for every input device: |
| 532 |
|
| 533 |
For keyboard and gamepad, we'd only need five functions: LEFT and RIGHT, ACTION, |
| 534 |
FILTER and CANCEL. |
| 535 |
|
| 536 |
- In item mode, LEFT and RIGHT rotate the item list to bring a certain item into |
| 537 |
focus. The ACTION key switches to <i>action mode</i>, the FILTER key to |
| 538 |
<i>filter mode</i>. CANCEL closes the inventory. |
| 539 |
- In action mode LEFT and RIGHT would scroll through the different activities. |
| 540 |
The ACTION key would select an activity, CANCEL would return to <i>item mode</i>. |
| 541 |
- In filter mode LEFT and RIGHT scroll through the different filters, the ACTION |
| 542 |
key would toggle them on or off and CANCEL returns to <i>item mode</i>. |
| 543 |
|
| 544 |
For keyboard control, there could be shortcuts to individual actions and |
| 545 |
filters. |
| 546 |
|
| 547 |
Mouse control is a little more tricky. One solution could be that dragging with |
| 548 |
left button pressed rotates the item list in the direction the mouse is dragged. |
| 549 |
Clicking on a filter would toggle it on and off, and clicking on a activity icon |
| 550 |
would launch that activity with the item in focus. Right button could close the |
| 551 |
inventory. |
| 552 |
|
| 553 |
|
| 554 |
<h4>Shopping and Looting</h4> |
| 555 |
So far we only addressed situations where an item is already within the party's |
| 556 |
inventory. There are a few occasions where this won't be the case: in shops, |
| 557 |
after battle when collecting the possessions of the late enemy, when examining |
| 558 |
containers or a pile of items on the ground. |
| 559 |
|
| 560 |
In general, it should be possible to both pick up/buy items as well as drop/sell |
| 561 |
them. That means it must be possible to switch between the party and |
| 562 |
shop/corpse/container inventory. This could be achieved by an additional button |
| 563 |
in the <i>filter display</i> that is only visible in those cases. |
| 564 |
|
| 565 |
There are a few additional differences: |
| 566 |
- In shops, the <i>info display</i> would contain an item's price. Further, |
| 567 |
giving items to the shopkeeper would not sell them directly, but rather raise |
| 568 |
your credit. Taking items from the shop would on the other hand lower the |
| 569 |
credit. There would be an extra button to complete the transaction. That enables |
| 570 |
you to exchange goods for other goods as well as goods for money. There should |
| 571 |
also be the possibility to steal an item from the shop. |
| 572 |
- After combat, items taken or dropped will be placed on the ground and vanish |
| 573 |
after a while. |
| 574 |
- When examining a container, items dropped will be put into the container (if |
| 575 |
they fit). Containers are the only safe way to store items outside the party's |
| 576 |
inventory. |
| 577 |
|
| 578 |
|
| 579 |
<h4>Activities revisited</h4> |
| 580 |
What remains now is a more detailed descriptions of the different activities: |
| 581 |
equip, unequip, use, examine, give and drop, steal, buy, sell and trade. |
| 582 |
|
| 583 |
- Equipping is possible for items such as weapons, armour, amulets and rings. When |
| 584 |
selecting this action, you can select the character to wear that item from the |
| 585 |
target list. The computer will prevent you from choosing characters that cannot |
| 586 |
use the equipment. If the item is worn by another character, it will be |
| 587 |
automatically unequipped. If the character already has an item of that kind |
| 588 |
equipped, it is also automatically unequipped. During combat, only the character |
| 589 |
carrying the selected item will be able to equip it. |
| 590 |
- Unequipping just removes the selected item from the character wearing it. It |
| 591 |
remains in his inventory though. This function is probably almost never needed. |
| 592 |
- Using an item will bring forth it's effect. If it requires a target that has |
| 593 |
to be selected first. Targets could either be party members, other items or |
| 594 |
enemies. A list of possible targets should appear in the <i>filter display</i>. |
| 595 |
Instead of selecting a target, the whole activity can still be cancelled. Uses |
| 596 |
without target could be turning on/off light sources, read scrolls and books, |
| 597 |
and others. |
| 598 |
- Examining an item will replace the <i>item view</i> with a window containing a |
| 599 |
detailed description of the item, it's attributes and uses. The CANCEL key |
| 600 |
closes this window, but it should be also possible to select another action |
| 601 |
without explicitly closing the window. That would be happen automatically after |
| 602 |
the new action was performed. |
| 603 |
- Giving can be used to move items between character's inventories. After |
| 604 |
selecting this action, the target list contains all party members that are |
| 605 |
nearby and have enough room for that item. When interacting with a container (a |
| 606 |
chest, cupboard or such), give can be used to put items into that container as |
| 607 |
well. In shops, give is replaced with a sell icon. During combat, giving should |
| 608 |
probably be disabled. |
| 609 |
- Dropping an item is the only way to get rid of it (apart from selling or |
| 610 |
putting it into a container). The item will be placed on the ground, where it |
| 611 |
will vanish after a while. |
| 612 |
- Stealing is only available in shops. When selecting that activity you can |
| 613 |
chose a character who should try and steal the focused item. |
| 614 |
- Buying will add the item in focus to the "shopping cart". Items selected for |
| 615 |
buying and selling are set off against each other. For items that are already in |
| 616 |
the cart, there would be a additional icon to remove them. Buying is only |
| 617 |
available when the shop inventory is displayed. |
| 618 |
- Selling is the opposite of buying and works in the same fashion. Selling is |
| 619 |
only available when the party inventory is displayed. |
| 620 |
- The trade button is used to complete the selling/buying transaction and will |
| 621 |
automatically close the inventory afterwards. |
| 622 |
|
| 623 |
\htmlonly |
| 624 |
<hr> |
| 625 |
<center> |
| 626 |
<< <a href="combat.html">Combat</a> |
| 627 |
<a href="index.html">Contents</a> |
| 628 |
<!--<a href="inventory.html">Inventory</a> >>--> |
| 629 |
</center> |
| 630 |
\endhtmlonly |
| 631 |
|
| 632 |
*/ |