> For the complete documentation index, see [llms.txt](/llms.txt)

# Character Enhancement

Enhances a character with material items, turning them into experience, with configurable bonus multipliers.




**About this demo**

The demo signs in automatically with an anonymous account. The account is shared across every demo in the showroom, so items and currency you get in one demo carry over to the others. Loading takes a moment. If the frame is too small, open the demo in a new tab.

## Overview

Spend enhancement materials to give a character experience. There are two materials, `potion` (worth 300 experience) and `elixir` (worth 1000), and each enhancement has a 20% chance of a great success that grants 1.5 times the experience. Recruit a character, get some materials, then spend them on the character's row.

## How to try it

1. Under **Recruit a character**, press **Recruit** next to **Recruit knight** (or another character) to get a character.
1. Press **Get** under **Materials** to add one of that material (the row reads, for example, `potion x1`).
1. On the character's row under **Spend materials to level up**, press **Enhance with potion**; one `potion` is consumed, the character gains 300 experience (450 on a great success), and **Level** rises from `1/10`.
1. Press **Enhance with elixir** to consume one `elixir` for 1000 experience (1500 on a great success).
1. Pressing an enhance button without the material fails because there is not enough material.

## GS2 services used

- [GS2-Enhance](/microservices/enhance/): GS2-Enhance's `Basic` rate adds the experience written in the material's metadata (300 for `potion`, 1000 for `elixir`) to the target character, with a bonus of 1.5x at 20% and 1x at 80%.
- [GS2-Inventory](/microservices/inventory/): GS2-Inventory holds two inventories: the `Character` inventory with the recruited characters, and the `CharacterEnhanceMaterial` simple inventory with the material counts.
- [GS2-Experience](/microservices/experience/): GS2-Experience keeps each character's experience, level and level cap (10); the experience added by enhancing raises the level.
- [GS2-Exchange](/microservices/exchange/): GS2-Exchange rate models define the buttons: **Get** acquires a material (`Gs2Inventory:AcquireSimpleItemsByUserId`), and **Enhance with potion** and **Enhance with elixir** run an enhancement with that material (`Gs2Enhance:DirectEnhanceByUserId`), each as a free server-side transaction.

## Use it in GS2 Studio

In GS2 Studio's Simple mode, open **Add features** and press **Add** on **Character Enhancement** to bring this feature into your own project. To point at the package directly, choose **Add from GitHub** and enter the package below.

```text
https://github.com/gs2io/gs2-studio-package/tree/main/micro-economy-character-enhance/packages/micro-economy-character-enhance
```

- Owner: `gs2io`
- Repository: `gs2-studio-package`
- Subdirectory: `micro-economy-character-enhance/packages/micro-economy-character-enhance`

## Source code

- Demo project: <https://github.com/gs2io/gs2-studio-package/tree/main/micro-economy-character-enhance/live-demo>
- Feature package: <https://github.com/gs2io/gs2-studio-package/tree/main/micro-economy-character-enhance>



