Gorilla.Utils.SkillSystem Unit Reference
Overview
The Gorilla.Utils.SkillSystem unit implements a hierarchical skill tree framework for Gorilla3D games. Skills are organized in groups, support leveling with configurable interpolation, async leveling processes, multi-language names, and XML serialization.
Class Hierarchy
TComponent
└── TGorillaSkillSystem
TCollectionItem
└── TGorillaCustomSkillEntity
└── TGorillaSkillGroup
└── TGorillaSkill (extends group, so skills can have sub-skills)
Enumerations
TGorillaSkillLevelInterpolation
| Value |
Description |
LinearInterpolation |
Value = BaseValue + Level * Factor |
LogarithmicInterpolation |
Logarithmic growth curve |
ExponentialInterpolation |
Exponential growth curve |
ExponentialMinus1Interpolation |
Exponential minus 1 curve |
TGorillaCustomSkillEntity
Base class for skills and groups.
Published Properties
| Property |
Type |
Description |
Enabled |
Boolean |
Whether this entity is unlocked |
Icon |
Integer |
Icon index in TImageList |
Position |
TPointF |
Flow chart position (editor layout) |
Public Properties
| Property |
Type |
Description |
GUID |
TGUID |
Unique identifier (auto-generated) |
Name |
String |
Display name (current language) |
Names[Index] |
String |
Name by language index |
NameMap |
TGorillaLanguageMap |
Full language map |
SkillSystem |
TGorillaSkillSystem |
Parent skill system |
Public Methods
| Method |
Description |
FromXml(ANode) |
Load from XML |
ToXml(AParent) |
Save to XML |
TGorillaSkillGroup
A category of skills.
Published Properties
| Property |
Type |
Description |
Skills |
TGorillaSkillCollection |
Contained skill entities |
Public Methods
| Method |
Returns |
Description |
AddSkill() |
TGorillaSkill |
Add a new empty skill |
FindSkillByName(ASkillName) |
TGorillaSkill |
Find skill by display name |
FindSkillByGUID(AGUID) |
TGorillaSkill |
Find skill by GUID |
GetActivatedSkills(AMap) |
— |
Return all activated skills (flat list) |
TGorillaSkill
A single skill with leveling support. Extends TGorillaSkillGroup, so skills can contain sub-skills forming a hierarchy.
Published Properties
| Property |
Type |
Default |
Description |
Activated |
Boolean |
False |
Whether the skill is currently active |
Value |
Single |
1.0 |
Main skill value |
Factor |
Single |
1.0 |
Interpolation factor |
Interpolation |
TGorillaSkillLevelInterpolation |
Linear |
How value scales with level |
Level |
Integer |
0 |
Current skill level |
MaxLevel |
Integer |
— |
Maximum achievable level |
LevelingTime |
Integer |
— |
Time required to level up (ms) |
Public Properties
| Property |
Type |
Description |
Data |
TValue |
Custom runtime data (not serialized) |
SkillGroup |
TGorillaSkillGroup |
Parent group |
Public Methods
| Method |
Returns |
Description |
StartLevelingUp() |
TGorillaSkillProcess |
Start async leveling (targets first sub-skill) |
StartLevelingUp(ADest) |
TGorillaSkillProcess |
Start async leveling toward specific sub-skill |
TGorillaSkillProcess
Manages an async leveling operation.
TGorillaSkillSystem
Main component managing all skill groups.
Published Properties
| Property |
Type |
Description |
Groups |
TGorillaSkillGroupCollection |
Collection of skill groups |
Language |
String |
Current language for display names |
ImageList |
TImageList |
Linked image list for icons |
Public Methods
| Method |
Returns |
Description |
AddGroup() |
TGorillaSkillGroup |
Add a new skill group |
FindGroupByName(AName) |
TGorillaSkillGroup |
Find group by name |
FindGroupByGUID(AGUID) |
TGorillaSkillGroup |
Find group by GUID |
FindSkillByName(AName) |
TGorillaSkill |
Find skill across all groups |
FindSkillByGUID(AGUID) |
TGorillaSkill |
Find skill by GUID across all groups |
Serialization
| Method |
Description |
ToXml(AParent) |
Serialize to XML element |
FromXml(ANode) |
Deserialize from XML element |
Type Aliases
TGorillaSkillMap = TDictionary<String, TGorillaSkill>;
See Also