# 07 — Core GML 5.3a Functions to Recognize

Decompiled scripts call into proprietary 2D engine functions. Map these to algorithmic intent.

## Geometry / collision

### `collision_line(x1, y1, x2, y2, obj, prec, notme)`

- Foundational raycaster. Traces straight line `(x1,y1) → (x2,y2)`.
- Returns instance ID of first intersected object, or `noone`.
- Args:
  - `obj`: object/family to test (or `all`).
  - `prec`: precise (per-pixel) vs bounding-box collision.
  - `notme`: exclude calling instance.
- **Use cases in legacy code**: hitscan weapons, line-of-sight, AI vision cones.

## Sprites / graphics

### `sprite_add_alpha(str, img, ...)`

- Loads external `.png` or `.bmp` from disk into runtime sprite.
- Computes alpha channel from a separate alpha mask image.
- **Use cases**: dynamic asset loading outside the `.gmd` blob — check for these in decompiled `Game Start` events.

## DLL bridge

### `external_define(dll, fn_name, call_type, return_type, arg_count, arg_types...)`

- Binds a function from an external `.dll` into GML callable scope.
- Returns a function ID used by `external_call(id, args...)`.
- **Critical**: this is the **only** path to networking, advanced filesystem, or anything outside the VM sandbox in 5.3a.
- Always present in multiplayer projects → see [08-39dll-networking](08-39dll-networking.md).

## What you will *not* find natively

- **Native sockets** — none. Multiplayer = 39dll.
- **3D rendering** — none. GM6 introduced primitive Direct3D8 vertex calls; 5.3a is strictly 2D. Any "3D" in 5.3a code = pseudo-3D math (trig projections, mode-7-style transforms) implemented in pure GML.
- **JSON / XML / structured serialization** — write your own with byte buffers via 39dll or string concat.
- **Threads** — single-threaded VM.

## See also

- [05-gml-vm](05-gml-vm.md)
- [06-gml-syntax-5x](06-gml-syntax-5x.md)
- [08-39dll-networking](08-39dll-networking.md)
- [16-bno-bnb-notes](16-bno-bnb-notes.md) — proprietary file formats use these primitives
