Face Cache
The face cache system allows players to save and restore facial identity data separately from clothing.
This system is intended for:
- identity preservation
- quick character rebuilding
- roleplay consistency
- appearance recovery
- face-only synchronization
System Purpose
Unlike outfits, the face cache system stores:
head blend
face features
head overlays
eye color
hair
without storing clothing data.
This allows players to:
- change outfits freely
- preserve facial identity
- restore appearance later
Cache Workflow
Typical workflow:
1. Save current face data
2. Change appearance/clothing
3. Restore cached face later
Saved Cache Data
The face cache system primarily stores:
headBlend
faceFeatures
headOverlays
eyeColor
hair
Example structure:
{
headBlend = {},
faceFeatures = {},
headOverlays = {},
eyeColor = 0,
hair = {}
}
Excluded Data
The cache system intentionally avoids storing:
components
props
tattoos
outfits
Purpose:
- prevent clothing overwrites
- preserve outfit flexibility
- separate identity from clothing
Cache Apply Workflow
When applying cache data:
1. Current appearance is read
2. Face cache data is merged
3. Face appearance rebuild runs
4. Appearance synchronization refreshes
Only identity-related data is replaced.
Cache Confirmation System
The UI includes a dedicated confirmation system before applying cached data.
Example configuration:
cache_confirm = {
title = "Apply Saved Face Data",
description = "Saved facial data will replace the current face appearance.",
confirm = "Confirm",
cancel = "Cancel",
delete = "Delete Saved Data"
}
Cache Warning Behavior
The system intentionally warns players before applying cached data.
Reason:
face data replacement is permanent until changed again
This prevents accidental identity overwrites.
Cache Delete Workflow
Players may permanently remove cached face data.
Delete workflow:
1. Confirmation dialog opens
2. Cached data is removed
3. Face cache state resets
Cache Synchronization
When cache data is applied:
head blend refreshes
face overlays refresh
face features refresh
hair refreshes
This ensures appearance consistency after:
- reconnects
- reloads
- ped rebuilding
- appearance synchronization
Hair Support
Hair data is included inside the cache system.
Supported values:
style
texture
color
highlight
Purpose:
- preserve identity
- preserve hairstyle
- restore appearance consistency
Overlay Support
The cache system supports overlays such as:
beard
eyebrows
makeup
lipstick
blush
moles
including:
style
opacity
color
depending on overlay type.
Freemode Requirement
Full cache support requires freemode models:
mp_m_freemode_01
mp_f_freemode_01
Custom/addon peds may not fully support:
- overlays
- blend data
- facial morphs
- eye colors
Internal Compare System
The cache system may internally compare appearance values before saving.
Typical comparison targets:
item
texture
mix
color
opacity
Purpose:
- prevent unnecessary saves
- reduce redundant cache updates
- improve synchronization logic
Recommended Usage
Recommended player workflow:
1. Finalize facial appearance
2. Save face cache
3. Change clothing/outfits freely
4. Restore identity when needed
Roleplay Usage
Common RP use cases:
undercover characters
identity restoration
barber recovery
character presets
multi-outfit roleplay
Developer Notes
Unlike most appearance systems, XDEV intentionally separates:
identity data
clothing data
tattoo data
peddata
This architecture improves:
- modularity
- rebuild reliability
- synchronization consistency
- compatibility workflows