The COG Factory / Level Design Projects
The Duel with Yun
Dark Jedi duel
DOWNLOAD ZIP · 246 KBBUILD 12026-09-05
Q. What is the MINIMUM rigging for a Dark Jedi boss battle — a saber-wielding Yun who can be fought and killed in a generated level, with no cutscenes and no CD audio?
A boss is one bit, and the obvious test for it is wrong.
typeflags=0x200 is SITH_AF_BOSS, and it is the only thing that gets an actor the jkPlayerInfo a lightsaber hangs on; remove that one hex digit and the level parses, dumps its whole world inventory, and then segfaults inside a cog verb that writes through the null pointer. The saber is not weapon= — the engine grants the slot, a placed cog builds the blade, and only the AI can arm it, because jkEnableSaber from a cog is silently ignored on an actor. And the assertion that he swings it had to be rebuilt: two different things produce SITH_DAMAGE_SABER, and the AI's special attack deals it directly without touching the polyline — so the control, built with the blade deleted, still passed. What separates them is the amount, out of the AI file's own rows: 20 through the blade, a flat 40 without it. The screenshot is what broke the tie.| archetype | Dark Jedi duel |
|---|---|
| project | p51-yun-duel |
| date | 2026-08-30 |
| built | 6 sectors · 167 surfaces · Yun, 500 health · yellow blade · 4 gate rows, 1 a control |
| package | P51.GOB, readme.txt, screenshot.jpg |
| build | 1 — 2026-09-05 |
| sha256 | 014ec5ae5ff0d69ee89329d601a384b5caca82145586d6f06ed8b27c92456e68 |
Installing it
- Unzip it.
- Drop the
.GOBinto theepisodefolder of a Jedi Knight install — the one that already hasJK1.GOBin it. - Pick it from the episode list. On a libretro frontend, load the
.GOBitself as content.
The GOB carries its own level, cogs, materials and sounds and
reads the stock resource/ for everything else. There is no
retail game data in the zip.
These are living projects, not finished releases. A level is rebuilt whenever something is learned — a lighting rule, a texture orientation, a whole detail pass — and it keeps its filename through all of it. The build number is how to tell which one you have: it is printed in the readme inside every zip, and it only moves when the level's bytes actually change.
Screenshots
Textures generated for this project
The readme that ships with it
========================================================================
Jedi Knight Level
P51.GOB
A lightsaber duel against Yun, the Dark Jedi, in a vaulted stone
sanctum. He stands lit and waiting on the duel floor; the moment you
step onto it he comes for you. Five hundred points of health, a yellow
blade, a Jedi's jump and a circling guard -- and a green blade of your
own from the first frame. This is a saber fight and nothing else: he
throws no force powers.
[cogfactory / p51-yun-duel]
BUILD 1 -- 2026-09-05
sha256 014ec5ae5ff0d69ee89329d601a384b5
This level is not made or distributed by LucasArts
Entertainment Co.
========================================================================
THIS PACKAGE
------------------------------------------------------------------------
P51.GOB the level
readme.txt this file
screenshot.jpg what it looks like
INSTALLATION
------------------------------------------------------------------------
Drop P51.GOB into the `episode` folder of a Jedi Knight install (the one
that already has JK1.GOB in it) and pick it from the episode list.
Nothing else needs to change: the GOB carries its own level, cogs,
materials and sounds, and reads the stock resource/ for everything else.
On a libretro frontend, point the core at the GOB itself. It needs a
folder beside it holding `resource/` from a real install -- that is
where the retail data lives and none of it is in here.
CONTROLS
------------------------------------------------------------------------
PLAY IT: New Game, and pick COG Factory p51 Yun Duel.
You start with fists and a LIGHTSABER already drawn. Fire swings it.
Walk east out of the antechamber and through the passage.
THE DUEL STARTS WHEN YOU STEP ONTO THE DUEL FLOOR, and not before --
Yun holds his ground until then, and he will not follow you back out.
Two health packs in the north alcove, two shield rechargers in the south,
a bacta tank and a health pack in the east. Retreat into one and he waits.
KILL YUN to finish the mission.
NOTES
------------------------------------------------------------------------
A DARK JEDI IS ONE BIT AND FIVE THINGS THAT ALL FAIL THE SAME WAY.
typeflags 0x200 is SITH_AF_BOSS; the engine walks every thing at
load and gives a jkPlayerInfo slot -- the thing that HOLDS a
lightsaber polyline -- only to an actor carrying it. Miss it and the
level either crashes at startup or, worse, boots perfectly and gives
you an enemy who follows you around and does nothing. So do a
missing puppet, a missing AI class, a pool that ran out and a cog
that never ran. Every one looks identical from outside.
THE COG CANNOT SWITCH THE BLADE ON. A script may hand a boss the two
blade materials, the radii and the length, and set the SABERON flag
-- but jkEnableSaber checks that its target is a PLAYER and silently
ignores an actor. Only the AI can arm a boss blade, once per swing,
and the animation's own markers turn the damage on and off inside
the stroke. The saber has nothing to do with the `weapon=` field,
which for Yun is a melee axe the AI never fires.
HE HOLDS THE FLOOR. Yun's AI is disabled at level start and released
when you cross into the arena, then disabled again if you leave it.
That is boss-arena convention -- he does not chase you into the
corridor -- and it is also what makes the level testable, because an
enemy with a Follow instinct and seven units of sight otherwise ends
up standing in whichever doorway a probe is walking through.
THE ROOM IS TALLER THAN THE LIGHT. The duel hall is 2.10 units from
floor to vault, against 1.40 in the original game's Yun room and
0.90 in this campaign's tallest previous ceiling. The usual rig
hangs one lamp under the ceiling with a range of 1.70, and 1.70 is
less than 2.10 -- so the floor receives nothing at all and the room
bakes flat, with no warning. It takes two tiers: a working tier at
knee height for the duel and a vault tier that keeps the ceiling
from reading as a hole.
A 2.00-UNIT FLOOR RUNS OUT OF VERTICES BEFORE ITS WALLS DO. Every
vertical cut on a wall runs the wall's full height, and the editor
propagates the two new points into the floor and the ceiling that
share the edge. Four doorways plus four trim bands is twenty of the
twenty-four an engine surface may have; four carved portal panels on
the arena walls would have been twenty-eight, and the editor said
so. The portals moved to the four dead-end walls, which carry no
openings.
WHAT IS IN THE GOB
------------------------------------------------------------------------
92 episode.jk
69192 jkl\p51yun.jkl
2286 jkl\p51yun.manifest.json
2478 cog\p51done.cog
5046 cog\p51duel.cog
32908 mat\p51ceil.mat
32908 mat\p51dais.mat
32908 mat\p51flor.mat
32908 mat\p51gate.mat
32908 mat\p51trim.mat
32908 mat\p51wall.mat
276542 bytes in 11 entries
CREDITS
------------------------------------------------------------------------
Generated by tools/cogfactory in the openjkdf2_libretro tree.
Geometry authored through SED (github.com/smlu/SED) over the
cogfactory bridge.
LucasArts did not make this. Jedi Knight is theirs; this is a fan-
made level.
The readme format is styled after SM Sith Lord's cog headers,
because his are the ones everybody read.
========================================================================













