# DELTARUNE Vita v0.71 — Texture Pipeline Update
**This build changes how DELTARUNE texture data is organized, prepared and loaded on PlayStation Vita.**
> [!WARNING]
> This is an internal development pre-release. Back up `ux0:data/deltarune_saves/` before testing.
> [!IMPORTANT]
> Texture caches from v0.70 or earlier are not compatible with the rebuilt v0.71 `data.win` layout. The chapter `data.win`, BC3 files and RGBA4444 cache must always come from the same preparation run.
## Main focus
v0.71 introduces a rebuilt GameMaker texture layout designed around the resources actually used by each room. Large or sparsely populated atlases are reorganized into Vita-friendly pages without splitting individual sprite frames.
## Atlas rebuild and VRAM results
The Chapter 2 reference set produced the following estimated Texture Page working-set reduction:
```text
106.0 MiB → 22.2 MiB
```
This represents an approximate **79% reduction** in the estimated room texture working-set peak. It does not include framebuffers, surfaces, video buffers or VitaGL internal allocations.
### Representative atlas result
```text
Before: 4096×4096
RGBA8888: 64 MiB
RGBA4444: 32 MiB
BC3: 16 MiB
After: 2048×2048
RGBA4444: 8 MiB
BC3: 4 MiB
```
### Rebuilt Texture Pages
| Chapter | Rebuilt pages |
| --- | ---: |
| Chapter 1 | 192 |
| Chapter 2 | 414 |
| Chapter 3 | 397 |
| Chapter 4 | 838 |
| Chapter 5 | 1,017 |
The higher page count is intentional. Smaller pages allow the runner to load a precise subset of a chapter instead of retaining a few oversized atlases containing unrelated resources.
## Prepared texture pipeline
```text
BC3 → RGBA4444 → explicit cache generation when a prepared page is missing
```
- **BC3/DXT5:** 4 MiB for a 2048×2048 atlas.
- **RGBA4444:** 8 MiB for a 2048×2048 atlas.
- **Runtime generation:** compatibility path used only when the matching prepared
page is absent. Legacy GL does not silently upload an RGBA8888 page directly
from `data.win` as a normal rendering fallback.
BC3 files are now generated with explicit sRGB input and output:
```text
-ics sRGB -f BC3,UBN,sRGB -m 1
```
This corrects the colour and contrast inconsistency found in earlier BC3 caches. Fonts, UI elements and other precision-sensitive resources may continue using RGBA4444. Translation packages require their own matching caches.
### On-device BC3 fallback
Aggressive compression no longer requires a PC-prepared BC3 set. When an
eligible `page_NNN.bc3.pvr` is missing, the Vita runner now decodes that page
from the active `data.win`, compresses it through vitaGL's `stb_dxt` DXT5
encoder and stores a validated PVR v3 file under the chapter/language `pvr/`
folder. Generation uses the localized **GENERATING TEXTURES** screen and keeps
its animation responsive during large pages.
- Output is written to `.tmp`, size/header checked, then renamed atomically.
- Runtime PVR uses BC3/DXT5, sRGB, one surface, one face and one mip level.
- A fingerprinted `complete.bc3.vtc` invalidates the set after a rebuilt
`data.win`; a missing file is regenerated on the next Aggressive load.
- The matching R444 companion is retained so switching back to Native remains
live and does not decode the atlas again.
- Font, text-box and critical UI pages remain RGBA4444 by design.
The runtime encoder prioritizes first-run speed. DeltaCache/PVRTexTool remains
the recommended method for distributing a pre-generated, higher-quality set.
## Graphics configuration
### Default profile
```text
Resolution: Native
Texture compression: Optimized
Frame-rate limit: 30 FPS
Renderer: Legacy GL
```
### Available settings
- **Resolution:** Native, Balanced or Performance.
- **Texture compression:** Optimized, None or Aggressive.
- **Frame-rate limit:** 30 FPS, 40 FPS, 60 FPS or Unlocked.
- **Renderer:** Legacy GL or experimental Modern GL.
- **Screen filter:** None, Scanlines, Sharp Bilinear, Dithering or VHS.
Resolution, compression profiles, frame-rate limits and screen filters can be changed live. Changing the renderer still restarts the selected chapter.
## Loading and memory management
- Added chapter-local BC3 and RGBA4444 cache discovery.
- Added room-aware unloading of old, non-shared Texture Pages.
- Shared UI and font resources can remain resident between rooms.
- Removed the old assumption that small Texture Pages must always remain loaded.
- Added progressive retry backoff for temporarily unavailable pages.
- Reduced repeated texture-loading attempts that caused stuttering and audio interruption.
- Added battle texture preloading to reduce the first-battle hitch.
- Added safer cache invalidation when changing resolution or compression.
- Loading diagnostics now distinguish cache loading from cache generation.
- Added a localized third loading state, `UPDATING / game files`, reserved for
safe, versioned game-data migrations supplied by the Runner. It does not
replace the PC DeltaBuilder for GML compilation or atlas repacking.
- Loading animations now hold every PNG frame for 750 ms and are pumped
cooperatively during long GML bootstrap scripts, BC3/RGBA4444 conversion and
battle-core texture preloading instead of freezing until the operation ends.
## Trophy system
The trophy interface introduced in v0.70 remains part of v0.71. The set contains 30 achievements based on the icons, names and descriptions from the [DELTARUNE Achievements/Trophies mod](https://gamebanana.com/mods/600897).
View the DELTARUNE Vita trophy set

### In-game trophy interface
- Available under **Game Settings → System → Trophies**.
- Scrollbar with D-Pad, left analog and touch navigation.
- Circle returns to the previous screen.
- Triangle alternates between catalog order and unlocked trophies first.
- Real-time notification when an achievement is unlocked.
- Progress is stored in `ux0:data/deltarune_saves/trophies.ini`.
The in-game trophy flow, unlock notifications, `trophies.ini` persistence and
Vita trophy integration have been validated on hardware for data packages that
contain DELTARUNE's trophy event-manager triggers. The current PT-BR Chapter 1
and Chapter 2 `data.win` files do not yet contain those GML triggers; the runner
still provides its audited native equipment fallback, but the full 29-trigger
gameplay set requires a future translation-safe GML injection pass.
### Immediate trophy synchronization
- The Vita bridge now reads both completed entries in `global.trophies` and newly earned entries still waiting in `obj_event_manager.trophies_queue`.
- Equipment and other mid-room achievements are written to `trophies.ini`, notified in-game and queued for NoTrpDrm immediately instead of waiting for a room transition.
- DELTARUNE's original queue remains untouched inside the VM, preserving its normal room-end resolution behavior.
## Game Settings and languages
- Interface strings are loaded from language-specific `.ini` files.
- Language packages can define categories, labels, descriptions and footer text.
- UTF-8 handling preserves supported accented characters.
- Language icons can appear beside each language name.
- Touch sliders map the horizontal touch position to an absolute value.
- Contextual descriptions are displayed for Game Settings parameters.
- The active console border remains visible behind Game Settings.
- Diagnostic logs can be rotated manually from Debug settings.
English and Nihongo use DELTARUNE's original game data. External translations use language-specific `data.win`, BC3 and RGBA4444 files.
## Console borders
- Dynamic borders follow the current chapter and room.
- Consecutive rooms using the same border retain the existing texture.
- Simple mode uses the dedicated `border_line_simple` asset.
- Borders can be disabled.
- Border images use BC3 with explicit sRGB handling.
- Game Over and chapter-specific shop rooms use corrected border rules.
## Rendering and shaders
- Legacy GL remains the recommended renderer for stable gameplay.
- Audited Chapter 2 colour shaders include `shd_hue` and `shd_pal_swapper`; Swatchling colour changes no longer depend on them and use native sprite subframes instead.
- The fixed-function pipeline is restored after custom shader compilation.
- GameMaker backgrounds stored as sprite resources can be resolved correctly.
- Expanded Modern GL vertex-buffer and primitive support.
- Added safer Modern GL startup validation and fallback handling.
- Added allocator reserves before large Modern GL texture uploads.
- Chapter 5 city shadows continue to be validated through Modern GL.
- The Chapter 5 LUT shader falls back safely when its external IDE LUT is unavailable.
Modern GL may still produce missing graphics, black frames or GPU instability. Use Legacy GL for stable gameplay.
## Audio improvements
- Improved preservation of music streams between compatible rooms.
- Corrected stale OpenAL buffers that could replay part of a track.
- Added proper seeking for streamed OGG Vorbis audio.
- Reduced music restarts during loading and room transitions.
- Corrected missing sound-effect path resolution in original and translated chapters.
- Audio initializes before the renderer to reduce startup pressure.
## Video playback
Chapter 3 and Chapter 5 MP4 files are resolved from:
```text
ux0:data/deltarune/deltarunevita/vid/
```
The Vita implementation uses `SceAvPlayer` for H.264 video and audio playback. v0.71 also replaces incompatible precompiled video shaders, releases stale room textures before playback and preserves the original subtitle logic.
Chapter 3 VHS playback remains under hardware validation. Subtitles may appear even when video presentation or audio decoding fails.
## Chapter-specific improvements
### Chapter 1
- Expanded first-battle texture preloading.
- Improved background music continuity.
- Reduced first-use battle UI and enemy-loading stalls.
### Chapter 2
- Preserved the mice and light-puzzle softlock fixes.
- Corrected Game Over continuation to prioritize a checkpoint, autosave or last SAVE Point.
- Restored and optimized Cyber World fireworks.
- Corrected silhouette rendering in the fireworks scene.
- Added native Swatchling colour subframes.
- Corrected backgrounds stored as sprite resources.
- Improved translated battle speech-bubble sizing.
- Updated room-specific console-border rules.
#### Native Swatchling colour subframes
- Added four texture subframes—blue, green, yellow and orange—to `spr_swatchling_body`, `spr_swatchling_head`, `spr_swatchling_legs` and `spr_swatchling_hurt`.
- Registered the new `PageItem` identifiers for full UndertaleModTool compatibility.
- Updated `obj_swatchling_enemy_Draw_0` to select the complete body, head, legs and hurt subframe directly.
- Removed the previous palette/tint overlay that left parts of the original red-and-white suit visible beneath the selected colour.
- The colour change now runs natively at 60 FPS without depending on a heavier runtime shader.
#### Expanded enemy speech bubbles
- Updated `obj_battleblcon_Draw_0` to replace the oversized 1.3× rule with a
measured width capped at 300 pixels, plus corrected vertical padding and text
anchoring.
- Translated dialogue and punctuation retain safe lateral spacing while the
extra vertical padding prevents the bottom row of glyphs from being clipped.
#### Applied to every Chapter 2 variant
These patches were applied to every Chapter 2 `data.win` used by the project:
- Original English prepared data.
- `data/prepared/` output.
- `local-test/` data.
- Every supported package under `mods/Lang/`.
The same logic is integrated into `apply_vita_gml_optimizations.csx`, ensuring future DeltaBuilder rebuilds reproduce the fixes automatically.
### Chapter 3
- Improved demanding couch, board and battle scenes.
- Added native video-player bootstrap and shared MP4 path resolution.
- Improved texture cleanup before video playback.
- Continued work on mini-game battle crashes and first-use frame drops.
### Chapter 4
- Added rebuilt Texture Pages and chapter-local caches.
- Reduced oversized and sparsely populated pages.
- Continued room-by-room effect and translation validation.
### Chapter 5
- Preserved the Susie locker fix.
- Improved loading of town and Dark World rooms.
- Added room-aware cleanup for complex transitions.
- Continued optimization of the Flowery battle.
- Added experimental Modern GL handling for the original city-shadow pass.
## PT-BR atlas optimization carried forward

Oversized 4096×4096 pages were repacked into 2048×2048 pages without cropping or splitting sprite frames. The same structural principle is now applied more broadly by the v0.71 rebuild pipeline.
## Developer diagnostics
- `butterscotch-probe.log` is generated only when Dev Mode logging is enabled.
- The active log can be rotated from Game Settings.
- Rotated logs use sequential names.
- Added room, texture, audio, shader and frame-time diagnostics.
- Chapter 0 reads the displayed port version from a shared build-version asset.
## Installation and compatibility
This build requires data generated with the current patcher and v0.71 texture layout.
1. Generate fresh Vita data from an official DELTARUNE Steam installation.
2. Copy the resulting `deltarune` directory to `ux0:data/`.
3. Confirm the final path is `ux0:data/deltarune/deltarunevita/`.
4. Install the current v0.71 VPK using VitaShell.
Do not combine an older `data.win` with newly generated caches, or a rebuilt `data.win` with caches from v0.70.
## Known issues
- Modern GL remains experimental.
- Chapter 3 VHS playback requires additional Vita hardware validation.
- Some Chapter 3 battles can exhibit first-use frame drops.
- The Chapter 5 final battle can still experience low FPS or memory pressure.
- Chapter 5 city shadows are not completely reproduced in Legacy GL.
- Some translated chapters may require regenerated language-specific caches.
## Bug reports
Report problems through the [Issues page](https://github.com/WolffsRoom/DeltaruneVita/issues) and attach:
```text
ux0:data/deltarune/deltarunevita/butterscotch-probe.log
```
Please mention the chapter, room, selected language, renderer, texture-compression mode and frame-rate limit.
## Asset
- **Deltarune-v0.71-92.vpk** — current internal development build.
> [!WARNING]
> This asset is provided for testing and has not completed final release validation.
No commercial DELTARUNE `data.win`, music, video or proprietary game assets are distributed with this release.