Add feasibility assessments for Japanese No Remorse Windows modding and Observer NPC analysis

- Created a new document outlining the feasibility of modding the Japanese version of No Remorse on Windows, detailing executive assessments, established evidence, modding base suitability, and potential risks.
- Introduced a comprehensive analysis of the Observer NPC in No Remorse, including its identity, data structure, AI behavior, and comparisons with similar NPCs, along with open questions for further investigation.
This commit is contained in:
Maddo 2026-10-10 14:42:43 +02:00
commit 1b70294ef7
17 changed files with 2124 additions and 345 deletions

217
docs/REA/ghidra-dos.md Normal file
View file

@ -0,0 +1,217 @@
# DOS MZ and COM analysis with Ghidra
REA can analyze DOS MZ executables and explicitly selected COM images through the bring-your-own Ghidra adapter.
The Linux x64 and macOS arm64 verification lanes exercise actual 16-bit disassembly and
decompilation through the CLI and stdio MCP. Provider admission accepts Ghidra
12.1.x and that installation's declared JDK range. The verification lane uses
Ghidra 12.1.4 and JDK 21; no DOS emulator or cross-compiler is required.
## Open and inspect
```bash
rea inspect /absolute/path/to/legacy.exe --provider ghidra --json
rea search /absolute/path/to/legacy.exe entry --kind procedures --provider ghidra --json
rea instructions /absolute/path/to/legacy.exe entry --provider ghidra --json
rea function /absolute/path/to/legacy.exe entry --provider ghidra --json
rea inspect-native-load-image /absolute/path/to/legacy.exe --provider ghidra --json
rea read-bytes /absolute/path/to/legacy.exe 0x10000 --length 16 --provider ghidra --json
rea address-to-file-offset /absolute/path/to/legacy.exe 0x10000 --provider ghidra --json
```
Use an observed procedure name or address from discovery when the target does
not name its entry function `entry`. MCP uses `open_binary`, `list_procedures`,
`procedure_info`, `read_function_instructions`, and `analyze_function` with the
same admitted target and provider semantics.
The classifier validates MZ page counts, initialized module length, header and
relocation-table bounds, relocation destinations, and the initialized entry
point. It distinguishes DOS load-module and relocation bytes from the Windows
new-header field. PE remains PE; NE, LE, and LX declarations are explicitly
unsupported. A damaged declared Windows header does not silently become DOS.
Inventory classification returns `unknown` when its bounded prefix cannot
establish the format; this is distinct from the complete target admission check.
Ghidra imports a private target snapshot with `MzLoader`, language
`x86:LE:16:Real Mode`, and compiler specification `default`. These settings,
the fixed Ghidra load segment `0x1000`, and the linear address convention are
committed in the analysis profile. The handshake rejects language or compiler
drift. Closing the session deletes the temporary project and snapshot.
The profile also commits `function_body_evidence: complete-inclusive-ranges-v1`,
so snapshots from older length-only Ghidra results do not satisfy the current
profile.
## Headerless COM images
COM has no identifying header. Select its interpretation explicitly; neither the
`.com` suffix nor arbitrary unrecognized bytes are enough to admit it.
```bash
rea inspect /absolute/path/to/legacy.com --target-format dos-com --provider ghidra --json
rea function /absolute/path/to/legacy.com 0x10100 --target-format dos-com --provider ghidra --json
rea inspect-native-load-image /absolute/path/to/legacy.com --target-format dos-com --provider ghidra --json
```
```json
{
"name": "open_binary",
"arguments": {
"path": "/absolute/path/to/legacy.com",
"format": "dos-com",
"provider_id": "ghidra"
}
}
```
The caller's interpretation applies to the complete file, even if its filename
suggests another format. Files must contain 1..65280 bytes: the 64 KiB COM segment
minus the 256-byte PSP prefix. Ghidra uses `BinaryLoader` with real-mode language
and maps file offset zero at `1000:0100` (linear `0x10100`). A packaged pre-analysis
script seeds the entry function and CS/DS/ES/SS context `0x1000`. These settings
and the preparation policy are committed in the analysis profile; a failed
preparation prevents the resident bridge from serving results.
Load-image verification checks all original and modified file bytes, complete
source mapping/memory digests, absence of relocations, entry and measured register
context. The context is imposed for analysis, not observed from execution. PSP
memory, initial stack contents/SP, DOS interrupts and PC-98 devices are not
modeled. COM has no MZ header, relocation table or appended-overlay model; all
selected bytes belong to its analysis module. The original file stays unchanged.
## Addresses and function extent
Returned default-space addresses are linear byte coordinates. A Ghidra
segment:offset address has linear value `segment * 16 + offset`; multiple
segment aliases can identify the same byte. REA accepts the returned linear
address for subsequent lookups and leaves instruction decoding context with
Ghidra. These coordinates are analysis load addresses, not file offsets or
observations of a running DOS system.
Offsets that Ghidra would truncate to a different address are rejected before
reading or annotating a function. This also applies to explicit or encoded
address-space names; leading zeros preserve the numeric offset.
`procedure_info` and function dossiers include `body` evidence:
```json
{
"available": true,
"provenance": "ghidra-function-body-address-set",
"ranges": [
{ "start": "0x10000", "end": "0x1000d" },
{ "start": "0x10060", "end": "0x10065" }
],
"total_bytes": 20,
"span_bytes": 102,
"non_contiguous": true,
"contains_entry": true
}
```
Each end is **inclusive**. `total_bytes` counts the complete observed
AddressSet; `span_bytes` measures its enclosing span and is null across address
spaces. Gaps and shared tails must not be treated as owned bytes. This is
Ghidra's database observation, not a proof of original source ownership or
exhaustive code discovery. Providers that do not report complete ranges return
`available: false` and an explicit reason.
## Loaded-image evidence
`inspect_native_load_image` independently checks the immutable session snapshot
against the loaded Ghidra Program. It measures complete original and modified
FileBytes digests, every source mapping and its memory digest, relocation records
(including multiplicity), and external entry points. It verifies MZ header and
module partitions, relocation fixups and linear coordinates rather than relying
on the imported executable SHA alone.
The result is `verified`, `mismatch`, or `unsupported`. Every check retains its
expected and observed values. A memory-digest mismatch identifies the source
range's file offset and analysis address; it does not locate the first differing
byte inside that range. Mapping ends are **inclusive**, unlike the exclusive ends
from `list_segments`. Appended overlays remain in source-file identity and are
excluded from initialized module coverage. Uninitialized allocations are reported;
their contents and DOS runtime semantics are not verified. Formats other than MZ and explicit COM return
`unsupported` with measured observations, not a successful MZ verification.
`read_bytes` returns initialized provider memory, including loader fixups; an
unmapped or uninitialized byte ends the read with an explicit returned length and
`complete: false`. `address_to_file_offset` uses the provider's source mapping;
unmapped, uninitialized and ambiguous mappings fail explicitly. A relocated word
can differ from the original file word even when its source offset is known.
## Coverage boundaries
Static decompilation does not execute the target or emulate BIOS, DOS
interrupts, device ports, or self-modifying code. PC-98 hardware behavior and
recovered calling conventions can remain uncertain; provider pseudocode and
diagnostics are retained for analyst review.
For a packed executable, importing the original can analyze its unpacking
stub. Analyze a separately prepared unpacked copy to inspect the original
program's recovered code. Retain both artifact digests and the transformation
evidence; REA never silently replaces the admitted target. Appended overlays
are separate from the initialized MZ module. Raw COM files and DOS extenders
without an admitted MZ real-mode entry are outside this import boundary.
DOS MZ is available through Ghidra, with no Hopper support claim. It is outside
the Windows native PE P0 boundary. macOS x64 DOS verification remains unverified.
## Real verification
```bash
npm run verify:ghidra:dos
```
The lane generates a small public fixture from source at runtime. It verifies
16-bit instruction bytes, a near call, a segment-relocated far call, actual
decompilation, disjoint function ranges, stable CLI/MCP observations, unchanged
input bytes, and session/process cleanup. It does not require external
executable fixtures, an emulator, or an existing analysis database.
Provider p-code representations can contain process-specific address-space selector
tokens. The lane preserves those reported values and compares stable dossier
observations rather than asserting cross-process identity of raw p-code.
## Local Verification (2026-10-10)
The connected VS Code MCP server identified itself as `rea-agents` 6.3.0, loaded
from `C:\Users\Maddo\AppData\Local\npm-cache\_npx\ec0ab2283efe73f6\node_modules\rea-agents`.
The session had no active binary when checked. The REA tool catalog exposed
native binary opening, procedure listing, function analysis, and loaded-image
inspection.
| Check | Result |
|---|---|
| Requested Ghidra installation | `I:\Apps\ghidra_12.1.4_PUBLIC` exists and contains `ghidraRun.bat` and `support\analyzeHeadless.bat`. Its `Ghidra\application.properties` reports Ghidra 12.1.4 and Java minimum 21; the maximum is unspecified. |
| Requested JDK | `C:\Program Files\Microsoft\jdk-25.0.3.9-hotspot\bin\java.exe` exists and reports Microsoft OpenJDK 25.0.3. |
| Ghidra headless startup | With both `JAVA_HOME` and `GHIDRA_JAVA_HOME` set to that JDK, `analyzeHeadless.bat -help` printed usage, then exited with code 1. Startup also reported an invalid manifest in the user `GhidraMCP` extension (`GHIDRA_MODULE_NAME` and `GHIDRA_MODULE_DESC` were rejected). This is evidence of launcher startup, not a successful analysis run; whether that extension warning affects the REA provider is unknown. |
| REA open of Crusader | `open_binary` with provider `ghidra` rejected `K:\ghidra\Crusader_Decomp\CRUSADER.EXE` as `unsupported NE executable in MZ image`. The file is 991,878 bytes. Rejection occurred before Ghidra analysis, so no Crusader functions, strings, or loaded-image checks were produced by REA. |
| REA end-to-end Ghidra analysis | Not verified. The installed npm package lists a `verify:ghidra:dos` command but does not include its referenced `scripts/verify-real-ghidra-dos.mjs` test runner; no DOS MZ/COM fixture was found in the workspace search. Antivirus blocked generation of a temporary MZ smoke-test image. |
The installed Ghidra/JDK pair is present, and the Ghidra headless launcher reached
its command-line usage path under JDK 25. That does **not** prove the REA provider
is configured to use these exact installations or that it can analyze Crusader.
The observed target-format rejection agrees with the provider boundary above:
the DOS workflow accepts validated MZ and explicitly selected COM images, not
NE. For the current Crusader executable, REA cannot replace the existing NE
Ghidra workflow. A future REA NE provider or a separately justified conversion
would be required before this MCP can analyze the game executable.
## Function annotations
`annotate_native_function` changes the name and/or comments at one exact local function entry, verifies readback, and returns a refreshed dossier. This is useful when recording recovered DOS function roles; it does not claim original-source names. Name writes preserve the existing namespace; readback returns the fully qualified name used by function inventories. Regular comments map to Ghidra PRE comments and inline comments to EOL comments. Empty text clears a comment; omitted fields preserve it. The whole edit rolls back if a setter, readback or analysis fails.
```json
{
"procedure": "0x10100",
"name": "entry",
"comment": "Recovered startup role",
"inline_comment": "Inspect segment setup"
}
```
```bash
rea annotate-native-function /local/program.com 0x10100 --target-format dos-com --provider ghidra --name entry --comment 'Recovered startup role' --json
```
The CLI returns the updated analysis before closing its isolated session. MCP edits remain visible to later reads until `close_binary`. Original bytes remain unchanged, database edits are discarded on close, and immutable analysis snapshots are invalidated after edits. This operation does not save a Ghidra project, change ABI/types/body ranges, patch instructions, or emulate a DOS runtime. Windows P0 does not admit it.

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,94 @@
# Japanese No Remorse Windows Modding Feasibility
## Executive Assessment
The Japanese No Remorse release is a credible base for a **separate Windows-native mod target**, especially for data and script experiments. It is not a drop-in replacement for Western DOS retail, and executable patches or data should not be shared across those builds without validation.
| Question | Assessment | Main boundary |
|---|---|---|
| Use JP as a modding base | **Feasible with a version-specific toolchain** | JP has a native Win32 executable and a substantial data set, but maps and scripts are not interchangeable with Western retail by default. Rebuilt assets have not yet been proven in-game. |
| Launch natively on Windows 10/11 | **Plausible; runtime proof needed** | The game is a Win32 PE and does not require DOSBox by architecture. DirectDraw, DirectSound, display, and configuration behavior still need testing on current Windows. |
| Reuse Western retail decompilation or patches | **Low without translation and validation** | JP is a flat Win32 implementation; Western retail is a Phar Lap protected-mode MZ/NE executable. Addresses, ABI, loader, and some runtime behavior differ. |
| Use JP as a cross-reference | **Useful selectively** | Shared data and behavior can corroborate hypotheses, but JP-specific interpreter/debugger behavior must be checked per build. |
Track JP as its own target profile: separate executable fingerprint, asset manifest, USECODE assumptions, patch format, and Windows launch tests. Keep Western DOS/NE retail as a separate target for existing patches and DOSBox workflows.
## Established Evidence
The prior [Win9x investigation](jp-remorse-windows9x-investigation.md) found that JP is a PE-style Win32 application loaded at `0x00400000`, with Windows startup/window creation, registry-backed configuration, DirectDraw/DirectSound initialization, and a `GetVersion`/TLS branch for Win9x behavior. This strongly supports an intended native Windows 9x path. It does not certify runtime behavior on Windows 95, nor Windows 10/11 compatibility.
The active `/ja/CRUSADER.EXE` Ghidra program was also queried for `004459b0` (`video_init_directdraw_and_directsound`). It calls `DirectDrawCreate`, sets the display mode to `0x280 x 0x1e0` (640x480), creates a palette and primary surface, and initializes DirectSound. Its decompilation is still imperfect: the flat Win32 function has a `ulonglong __fastcall` signature, `undefined4` parameters, synthetic `extraout_ECX` values, and calls through interface-vtable offsets. This is a useful concrete example of both the clearer Windows API boundary and the remaining decompiler cleanup.
The local JP assets and renderer evidence establish substantial shared format support, not drop-in data identity:
- Retail, 1.01, and JP expose the same 63 detected maps, and the map viewer exports JP scenes.
- Every shared JP/Western-retail map differs in the normalized exported scene payload. Similar top-line counts in sampled maps do not make the payloads identical.
- `COMBAT.DAT` is byte-identical across JP and the listed Western builds, showing that some gameplay data is exactly shared.
See [family export differences](versions/family-export-differences.md) and [COMBAT.DAT evidence](combat-dat.md). A successful map export proves the reader can inspect the format; it does not prove that a rebuilt archive loads in the original JP game.
## Feasibility As A Modding Base
### Good fits
- **JP-targeted map and asset work:** `STATIC_JP` contains a substantial game data set, including `FIXED.DAT` and major graphics/resource archives, and the viewer supports JP map exports. Keep JP inputs and outputs together and test edits in the JP executable.
- **Shared data:** files confirmed byte-identical, such as `COMBAT.DAT`, are candidates for shared tooling and cross-build tests. Matching filenames alone are not evidence of compatibility.
- **Windows-native experiments:** JP is a better host than DOS retail when the goal is to investigate the Windows API path or build a mod that avoids DOSBox.
- **Behavioral cross-reference:** JP can help explain shared game concepts, data structures, and services, but each conclusion should be checked against its intended target.
### Boundaries and risks
- **Not a Western-retail replacement:** JP map payloads differ, the local JP archive is named `JUSECODE.FLX`, and executable behavior is version-specific. Do not mix JP and Western fixed data or scripts without format and in-game validation.
- **USECODE compatibility is not established:** the JP interpreter dispatches opcodes `0x00..0x79`; `0x71` and `0x72` take an invalid-token path. Its `0x5b`/`0x5c` handlers also differ from the classic DOS hidden-debugger line/current-entry behavior. This is concrete reason not to assume Western compiled USECODE is a safe JP replacement. See [JP USECODE dispatch analysis](usecode-jp-dispatch-analysis.md) and [JP debugger investigation](jp-remorse-hidden-debugger-investigation.md).
- **Archive naming needs closure:** the JP executable contains an `eusecode.flx` string associated with its `-u` startup override, while the local static folder contains `JUSECODE.FLX`. The override helper does not establish the default JP archive lookup. Trace or runtime-test the default loader before renaming files or designing an override package. See [JP launch parameters](jp-remorse-cheats-and-launch-params.md).
- **Palette caveat:** the viewer currently falls back to Western `GAMEPAL.PAL` when the JP copy is absent. That is a renderer workaround, not proof the JP game expects or accepts that palette. See [version differences](versions/version-differences.md).
- **No known general plugin ABI:** native code changes need build-specific PE patching or a separately validated shim/injection mechanism. Existing NE patch definitions and relocation logic target the DOS executable and cannot be reused as-is.
- **Japanese integration matters:** the executable imports DBCS/code-page and IME APIs. Preserve the intended text/input environment during tests and distinguish localization failures from game logic failures.
**Modding verdict:** JP is reasonable for JP-targeted data mods and controlled binary experiments, provided executable and assets are fingerprinted as one profile. It is not yet a turnkey mod platform: the archive rebuild/load loop, JP USECODE round-trip/compiler path, and runtime acceptance of edited resources remain unproven. For Western retail mod support, retain the DOS/NE target and its existing [patch/data feasibility path](remorse-patching-mod-system-feasibility.md).
## Windows 10/11 Native Launch Feasibility
### Why direct launch is plausible
JP is already a Win32 executable, not a DOS program dependent on `RUN286`, Phar Lap, NE segment loading, or DOS interrupts. A 32-bit Win32 application can generally run on x64 Windows through WoW64, which is Windows' x86 compatibility layer, not DOSBox. The recovered imports include windowing, registry, file, timing, joystick, DirectDraw, and DirectSound APIs. The Win9x TLS branch handles a Win9x-specific allocation constraint; no blanket Windows NT rejection has been established.
This makes unmodified direct launch the right first experiment. It does not prove all legacy API behavior works on current Windows, or that the original installer runs on x64 Windows. The prior analysis did not identify the required DirectX/runtime prerequisites or test Windows 95 in a VM.
### Compatibility work, ordered by risk
1. **Test the unmodified executable first** on clean Windows 10 and 11 x64 systems with a complete JP data set, expected working directory, and writable game directory. Test the game separately from its installer. Record startup, menu/game entry, display mode, input, audio, config/save paths, and shutdown.
2. **Add a launch wrapper only for environment setup** if needed: establish the working directory, pass supported arguments, and capture diagnostics. Do not silently rewrite data paths or mix asset versions.
3. **Use compatibility settings or shims only for a reproduced failure.** Investigate legacy DirectDraw fullscreen/palette behavior, DirectSound initialization, display changes/Alt-Tab, registry assumptions, and writes beneath protected install directories. These are risks inferred from the API surface, not observed Windows 10/11 failures.
4. **Patch the PE only for a localized, repeatable failure.** Identify the exact version check or failing call first. The Win9x `GetVersion` branch alone is not a reason to patch version detection. Tie changes to an exact executable fingerprint and retest ordinary startup.
Current claim: **native Windows 10/11 support looks attainable and may work without a code patch, but is unverified.** If "native" means no DOSBox, the PE architecture is favorable. If it means no WoW64 or compatibility behavior on x64 Windows, that is not a realistic requirement for a 32-bit game.
## Decompilation And Reverse-Engineering Differences
| Surface | Japanese Windows build | Western retail build |
|---|---|---|
| Executable model | Flat Win32 PE image, reported at `0x00400000` | DOS MZ containing an NE image, with Phar Lap protected-mode loading |
| Addressing | Linear 32-bit addresses and PE imports/relocations | Segment:offset addresses, far calls, NE fixups, extender/runtime services |
| Platform boundary | Windows windowing, registry, DirectDraw/DirectSound, WinMM | DOS/extender, segmented memory, hardware/service calls, DOS-oriented paths |
| Decompiler friction | Win32 API behavior, flat pointers, Windows structures; still has ABI/type recovery work | 16-bit widths, near/far pointer provenance, segmented calls, loader fixups, uncertain conventions |
| Reuse value | Native Windows implementation and semantic parallels | Canonical target for current Western exports, ABI work, and NE patches |
These are distinct implementations, not two load formats for an interchangeable binary. JP addresses do not map to NE addresses by a constant offset. PE and NE relocations, pointer widths, calling conventions, and data layouts require independent recovery. JP decompilation is not a source drop-in for `exports/src_remorse`, and the Western NE patcher cannot patch the JP PE.
There is meaningful overlap at the behavior and data level: JP retains USECODE execution, familiar launch/cheat concepts, and shared assets such as `COMBAT.DAT`. But the JP debugger and opcode analyses show implementation differences. Use function comparisons to test specific hypotheses; do not infer source identity from matching names, strings, or file formats.
No complete function-by-function JP-versus-Western diff is claimed. Existing evidence is strongest for executable format, Windows integration, selected USECODE behavior, and resource/export differences. A broader code-equivalence map needs a dedicated comparison pass.
## Recommended Next Work
1. **Runtime gate:** launch the unmodified JP game on Windows 10 and 11 x64 from a writable copy; establish startup, menu/game entry, resolution, input, audio, config/save paths, and shutdown.
2. **Loader gate:** trace/test JP lookup for `FIXED.DAT`, `JUSECODE.FLX`, palette, and core assets. Resolve the `JUSECODE.FLX` versus `eusecode.flx` discrepancy before recommending overrides.
3. **Data-mod gate:** make one reversible JP map or asset edit, rebuild it, and prove the original executable loads it. Renderer export success is not this gate.
4. **USECODE gate:** establish a JP-compatible round-trip/compiler corpus and compare supported opcodes, intrinsics, class/event tables, and archive conventions before porting Western scripts.
5. **Patch gate:** fingerprint the JP PE and prototype one low-risk reversible patch only after launch behavior is known. Define PE-specific RVA/file-offset and relocation handling; do not reuse NE patch records.
6. **Cross-build gate:** maintain separate JP and Western retail test profiles, promoting only verified shared formats or behavior into common tooling.
## Evidence Boundary
This assessment combines the existing live-Ghidra JP Win9x, launch-parameter, debugger, and USECODE investigations with local version/resource comparisons, and directly inspected JP `video_init_directdraw_and_directsound` at `004459b0`. It does not claim a Windows 95/10/11 runtime pass, successful JP asset rebuild-and-load, or complete function-level equivalence. Those remain explicit validation gates.

View file

@ -0,0 +1,120 @@
# No Remorse Observer NPC Investigation
## Executive Read
No Remorse has a real NPC definition named `Observer`: DTABLE row `6` selects actor shape `0x033c` (`828`). The strongest evidence does not support a unique Observer-specific AI script. Instead, row 6 configures the normal native NPC activity system with a pacing activity and two `Attack5` defaults. The resulting behavior is a mobile actor that can transition into the shared attack process when its visibility/alert path fires.
The unusual part is the mismatch between that ordinary combat-capable runtime profile and the sparse presentation/content evidence: the Observer class has only one short event body, its current renderer preview deliberately avoids lower frames because they are blank or broken, and map records that resolve to Observer are often paired controller records rather than unambiguous actor spawns. "Unused" is therefore a plausible description of its encounter role, not a proven description of its executable/data status.
## Identity And Data
No Remorse `STATIC/DTABLE.FLX` contains row `6`:
| Field | Value | Meaning / evidence |
|---|---:|---|
| Name | `Observer` | DTABLE name object 2, row 6 |
| NPC row | `6` | Index used by the DTABLE-backed NPC creation path |
| Shape | `0x033c` (`828`) | Actor shape stored at NPCDat offset `0x3e` |
| HP range | `35-45` | Minimum/maximum HP at row offsets `0x00/0x02` |
| Weapon selectors | `1 / 2` | Words at offsets `0x18/0x1a`; these are data selectors, not proof of two simultaneously equipped weapons |
| Default activities | `3 / 5 / 5` | Words at offsets `0x1e`, `0x40`, and `0x42` |
The 142-byte NPCDat row and parallel 32-byte name row are loaded from FLEX objects 0 and 2. The layout is corroborated by the `NPCDat` reader and the local [NPC spawner investigation](map_renderer/npc-spawners.md). Native `NPC_SetDataFromDTable` (`10e8:0152`) reads a `0x8e`-byte row into a local buffer, equips a weapon using the row's `+0x18` selector when nonzero, and writes the three activity fields into the actor's `0x06/0x08/0x0a` activity slots.
Shape `0x033c` is an NPC because it is the shape in DTABLE row 6 and is referenced as Observer's actor shape by the spawn data. The map renderer's catalog currently labels it `Helper Geometry` and notes that its display name was derived from NPC self-shape comparison in USECODE; that catalog label is not evidence that the actor is scenery.
## Native AI
### Configured Activities
The activity values are named in the live No Remorse `CRUSADER.EXE` Ghidra database:
| DTABLE field | Value | Native activity | Effect when selected |
|---|---:|---|---|
| `0x06` / default activity 0 | `3` | `Pace` | Creates `PaceProcess` (`1100:0693`, run at `1100:0708`) |
| `0x08` / default activity 1 | `5` | `Attack5` | Creates the shared `AttackProcess` |
| `0x0a` / default activity 2 | `5` | `Attack5` | Same activity family; used by other callers that select activity field `0x0a` |
`NPC_StartNextNPCActivityBehaviorProcess` (`10e8:2cfa`) resolves special activity selectors for fields `0x06`, `0x08`, and `0x0a`, then applies common gates: the NPC must be alive, not the controlled actor, not suppressed by the relevant actor flag, and inside a fast area before an activity process is created. It records current/previous activity and avoids restarting an activity that is already current. `NPC_ResetForEgg` (`10d8:04b1`) is a confirmed creation path that loads/sets the three activity fields and starts the field-`0x06` activity. Exact authored `0x04d0` spawner pairs can also supply activity values through their paired records, so the DTABLE row is the baseline profile, not a guarantee that every map instance uses all three unmodified.
### Observer's Likely Runtime Loop
For an Observer whose initial field-`0x06` activity remains DTABLE value `3`, the expected loop is:
1. Start `PaceProcess`, rather than `GuardProcess` or `LoiterProcess`.
2. Before pacing, `PaceProcess::Run` calls `NPC_StartBehaviorInField0x8IfCanSeeControlledNPC` (`1100:026e`). That helper checks that the actor is entirely on screen, field `0x08` is nonzero, the current activity is not already the field-`0x08` activity, and the controlled NPC is visible.
3. If those checks pass, field `0x08` is selected. For Observer, that is `Attack5`, which creates the common attack process.
4. Otherwise, when not busy, `PaceProcess::Run` tries a walk animation in the actor's current direction. A successful walk clears its local failed-step count and waits for the animation. After a failed walk, it performs a stand/turn-around response and waits 60 ticks; after more than one failed step it requests another activity.
5. That blocked-movement fallback requests `Attack5` for ordinary shapes. The explicit surrender exceptions in the native branch are shapes `0x2f5`, `0x2f7`, `0x2f6`, `0x344`, and `0x597`; Observer shape `0x033c` is not in that list.
This makes Observer a pacing/roaming combat actor, not an inert lookout. However, this code does not prove that every Observer placement immediately sees or attacks the player: visibility, fast-area activation, busy state, and map-specific activity overrides all gate the transition.
`Attack5` is an activity/process selector, not a literal weapon or a complete behavior description. The resulting `AttackProcess` uses the actor's combat-tactic state and `COMBAT.DAT` machinery. The confirmed egg reset path initializes tactic number `0`; [the COMBAT.DAT analysis](combat-dat.md) records the shipped tactic 0 name `Dumb` and an unresolved compatibility detail around how tactic 0 is interpreted. Do not infer a precise firing pattern for every Observer spawn from the activity value alone. At difficulty level `4`, the native selector can randomly remap an `Attack5` request to `AttackA` (`10e8:2cfa`); this is shared NPC behavior, not an Observer-specific rule.
### No Bespoke Observer AI Script
The extracted `OBSERVER` class (`0x033c`) has no bodies for `setActivity`, `hit`, `gotHit`, `schedule`, `enterFastArea`, or the other common events. Its only non-empty common event is slot `0x0e`, `calledFromAnim`:
```text
set_info(0x021A, *(arg_06));
process_exclude();
return;
```
That is a short state/process callback, not a custom movement or combat routine. Compare the neighboring `GUARD` and `SCIENTIS` slot-`0x0e` bodies: both perform the same setup and additionally spawn `NPCDEATH.slot_20`. Observer's body does not. This is a real script difference, but it only proves that Observer omits that scripted callback; it does not prove that the engine has no native death handling.
The distinction between actor identity and controller identity matters here. Shape `0x04d0` uses the `MONSTER` class as a spawner/controller. Its `enterFastArea` body checks frame 0 and `mapNum & 8`, then launches `MONSTER.equip`; paired `ITEM.slot_2D` logic handles actor creation. Those `MONSTER` event bodies are not Observer's AI. See [the paired-spawner investigation](map_1_spawners_targeted_investigation.md) for the unresolved question of which member of some frame-0/frame-1 pairs supplies the final spawned NPC row.
## Comparison With Similar NPCs
All values below are from the No Remorse DTABLE rows; activity names are the native enum values.
| NPC row | Shape | HP | Weapon selectors `+0x18/+0x1a` | Activities `0x06/0x08/0x0a` | Main contrast |
|---|---:|---:|---:|---|---|
| Observer `6` | `0x033c` | `35-45` | `1 / 2` | `Pace / Attack5 / Attack5` | Baseline under investigation |
| GUARD `4` | `0x02fd` | `20-35` | `1 / 2` | `Pace / Attack5 / Attack5` | Same activity profile and weapon selectors, lower HP; its animation callback adds `NPCDEATH` |
| Thermatron `10` | `0x0338` | `250-250` | `7 / 5` | `Pace / Attack5 / Attack5` | Same activity profile, much higher HP and different weapon selectors |
| RoamingSusan `11` | `0x02cb` | `35-45` | `1 / 2` | `Loiter / Attack5 / Attack5` | Same HP and weapon selectors; starts in `Loiter`, not `Pace` |
| Scientist `7` | `0x0344` | `5-12` | `0 / 0` | `Loiter / Attack5 / Attack5` | Unarmed selectors and low HP; `PaceProcess` specifically treats this shape as a surrender exception after repeated blocked steps |
| Vetron `19` | `0x04e6` | `425-625` | `9 / 10` | `Pace / Attack5 / AttackA` | Same initial activity family, much higher HP and a distinct third default |
The most useful comparison is not simply Observer versus the NPC named GUARD. Observer shares GUARD's and Thermatron's default activity tuple, but the activity value `3` starts `PaceProcess`; the named `GuardProcess` is selected by the separate activity value `8`. Observer therefore does not inherit the named Guard's stationary guard/idle loop just because the DTABLE contains an armed humanoid row or the character is called Observer.
At the process level, `GuardProcess::Run` (`1100:0a0e`) attacks when the player is visible and otherwise sleeps or chooses random idle animations. `LoiterProcess::Run` (`1100:0bfa`) plays idle animations or pathfinds to randomized points near its anchor. Observer's activity `3` chooses the distinct `PaceProcess`, which attempts a directional walk and can transition to field `0x08`'s attack behavior. These process differences are stronger evidence than visual resemblance or class names.
## Maps And Spawn Evidence
The current No Remorse map-export audit reports DTABLE row 6 on maps `6, 7, 9, 16, 23, 42, 47, 55, 56, 62, 69, 116, 170, 248`. The No Remorse demo audit reports no Observer map occurrence. This establishes map-data presence in retail exports, not that every listed map is an intended encounter or that every preview resolves to a live Observer. The audit is maintained in the [map-viewer NPC spawn audit](../../crusader_map_viewer/map_renderer/docs/npc-spawn-audit.md).
Examples that show why the distinction matters:
- Remorse map 69 has a frame-0 family-7 `0x024f` monster egg with `npcNum = 6`, which resolves directly to Observer in the current preview pipeline.
- On map 1, a frame-0 `0x04d0` record with `npcNum = 6` is paired with a frame-1 record resolving to RoamingSusan, ChemSuitGuy, or GUARD. The `MONSTER` controller can be dormant or paired; those records are not equivalent proof of an Observer actor.
- On map 248, some frame-1 `0x04d0` records resolve to Observer while their paired frame-0 controller records contain `npcNum` values such as `100` or `134`, which do not resolve in the current Remorse DTABLE preview. These are stronger Observer-spawn candidates, but the paired creation arguments still need a call-site-level close.
These examples and the broader pair scan are detailed in [the map-1 spawner investigation](map_1_spawners_targeted_investigation.md). The evidence supports calling Observer a shipped, spawnable NPC definition with map placements. It does not establish that maps 6, 7, or 248 are all "unused," nor does the label `Observer` by itself establish a surveillance-specific combat role.
## Sprite And Presentation State
The No Remorse reference data identifies shape `0x033c` as an NPC-derived shape, but the current map renderer has only indexed Observer sprite entries at frames `7` (`121 x 98`) and `15` (`48 x 35`). Its preview code explicitly chooses frame `0x0f` for Observer because lower-numbered preview frames are blank or broken. That is concrete evidence of incomplete usable preview art in the current pipeline and is consistent with the reported missing orientations.
The atlas is a curated set of scene/preview sprites, not a complete inventory of every frame in `SHAPES.FLX`. The code's `frames.length > 15` test establishes that frame 15 exists in the loaded shape, but the two indexed atlas entries do not establish that the full shape contains only two frames. Exact missing facings and animation sets remain unverified; do not treat frame numbers 7 and 15 as a complete orientation table.
## Open Questions And Next Checks
1. Enumerate shape `0x033c` directly from the full No Remorse `SHAPES.FLX`; classify blank frames, animation groups, and facing coverage instead of relying on the preview atlas.
2. Trace every map-69 `0x024f` Observer egg through its trigger, difficulty gate, and field-`0x06` activity startup in the retail executable.
3. Close the `0x04d0` paired-spawner call argument ownership so frame-0/frame-1 pairs can be classified as actual Observer spawns or controller-only records.
4. Recover the initial activity and combat-tactic values for actors created through the `0x04d0` path, including whether map/partner fields override DTABLE row 6.
5. Test the Observer `calledFromAnim` path in a live No Remorse session and determine whether native death handling replaces the absent `NPCDEATH.slot_20` callback.
6. Compare retail `CRUSADER.EXE` handling of tactic 0 against shipped `COMBAT.DAT` entry `Dumb` to establish Observer's concrete weapon/fire loop on the egg-spawn path.
7. Audit the listed map IDs against mission routing and editor-only/unreachable status before labeling any placement definitively unused.
## Evidence Pointers
- No Remorse DTABLE and NPC row layout: [NPC spawner data](map_renderer/npc-spawners.md), `STATIC/DTABLE.FLX`, and ScummVM's [NPCDat loader](https://raw.githubusercontent.com/scummvm/scummvm/master/engines/ultima/ultima8/world/actors/npc_dat.cpp).
- Observer event body and class slots: `USECODE/EUSECODE_extracted/pseudocode/OBSERVER/slot_0E_calledFromAnim.txt` and `USECODE/EUSECODE_extracted/class_event_index.tsv`.
- Native activity selection: `NPC_SetDataFromDTable` (`10e8:0152`), `NPC_StartNextNPCActivityBehaviorProcess` (`10e8:2cfa`), `NPC_StartBehaviorInField0x8IfCanSeeControlledNPC` (`1100:026e`), `PaceProcess::Run` (`1100:0708`), `GuardProcess::Run` (`1100:0a0e`), and `LoiterProcess::Run` (`1100:0bfa`) in live No Remorse `CRUSADER.EXE`.
- Process family ownership: [NPC action process layout](npc-action-process-class-layout.md).
- `0x04d0` controller and map pair evidence: [NPC spawners](map_renderer/npc-spawners.md) and [targeted map investigation](map_1_spawners_targeted_investigation.md).
- Combat tactic data and tactic-0 caveat: [COMBAT.DAT](combat-dat.md).