ATS Scripting Language Documentation
ATS = Animation Texture Script (presumed). Proprietary low-level scripting language for game animation behavior. Reverse-engineered through observation and testing
Table of Contents
Overview
ATS is a low-level, proprietary scripting language used in Crash Bandicoot: The Wrath of Cortex to control animation states via texture swapping. The language is plain text and appears structured similarly to assembly or early scripting languages. ATS files typically define animation loops, eye-blinking behavior, and reactive visual changes via direct frame manipulation.
File Structure
- Each file begins with a
Scriptname
declaration:
Scriptname angel
- Files end with
End
.
-
Start
indicates the beginning of the executable block.
Syntax
- Comments begin with
;;
- Instructions are case-sensitive
- Labels are defined with a colon (
:
)
- Each instruction appears on its own line
- Whitespace is non-significant
Commands / Instructions
General
Command |
Description |
Start
|
Begins script execution. |
End
|
Terminates script. |
Scriptname
|
Declares the name of the script. |
;;
|
Denotes a comment. |
Control Flow
Command |
Description |
Goto labelName
|
Unconditional jump to label. |
labelName:
|
Label declaration for jumps. |
Repeat
|
Begins a repeat loop. |
UntilTex = x
|
Ends loop when current texture frame is x . |
Gosub labelName
|
Calls a subroutine. |
Ret
|
Returns from a subroutine. |
Texture & Animation
Command |
Description |
Tex x
|
Sets the texture to frame x . |
TexAdj a,b,c
|
Adjusts current texture by delta. First param is usually -1 (decrement). |
Wait a, b
|
Waits a random duration between a and b frames. |
Rate a, b
|
Sets animation frame rate. Presumed: Rate 0,0 = 60 FPS, Rate 1,0 = 30 FPS. |
Event Handling
Command |
Description |
On x
|
Executes block when event/state x is triggered. |
Off x
|
Executes block when event/state x is disabled. |
Cross-File Interaction
Command |
Description |
XDef label
|
Defines a cross-referenced routine. |
XRef label
|
Calls a cross-referenced routine. |
Labels & Subroutines
- Labels (
LabelName:
) are jump targets.
- Subroutines end in
Ret
.
- External functions are marked by
XDef
and are callable using XRef
.
Examples
Blink Loop
BlinkLoop:
Wait 0,180
XRef FastCloseLeftEye
Gosub FastCloseRightEye
Wait 0,7
XRef OpenLeftEye
Gosub OpenRightEye
Goto BlinkLoop
Fast Eye Close (from XDef)
FastCloseRightEye:
Tex 0
Tex 2
Tex 3
Ret
Loop using Texture Adjustment
OpenRightEye:
Repeat
TexAdj -1,0,3
UntilTex = 0
Ret
Known Behaviors / Observations
-
TexAdj
modifies frame index
-
Rate
values change animation timing
-
Wait
likely pauses execution (frames = time)
- No duration defined for how long a
Tex
frame is held unless a Wait
follows
Questions
- What do the 2nd and 3rd parameters of
TexAdj
mean?
- Can
XRef
call into multiple files, or only one?
- Do
On
/ Off
map directly to boolean engine states?