Resource Key Type

From SC4D Encyclopaedia
Revision as of 12:56, 6 December 2021 by Z (talk | contribs) (→‎RKT4)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Resource Key Type (RKT) is a common Exemplar property which is used to reference models. There are several different RKT variants that are used in SC4, which are detailed below:

RKT0

RKT0 is used to reference a single true-3D model that applies to all zoom levels (1 model total). This is used on many NAM puzzle pieces, though the practice of using RKT0 has begun to fall out of favor with the NAM Team due to oversharpness of models in farther-away zooms. Only one value is specified here.

RKT1

RKT1 is used to reference isometric models, one per face and one per zoom (20 models total). This is used on most standard in-game buildings. While the RKT1 property will reference 20 different models, only one value, that of the south-facing Zoom 1 model, needs to be specified in the property. The game is able to infer the existence of the others through the RKT1 property.

RKT2

RKT3

RKT3 is used to reference a series of true-3D models, one per zoom level (5 models total). This is used on many NAM puzzle pieces but is falling into disuse in light of new methods for wrapping textures around models such as Embedded Mipmapping. Each zoom level model needs to be specified with RKT3.

RKT4

RKT4 is like RKT3, with the additional capabilities of specifying overhanging models and/or timed props. The full specification is as follows:

Rep 1: 0x0000000S
Rep 2: 0xXXXXXXXX
Rep 3: 0xZZZZZZZZ
Rep 4: 0xYYYYYYYY
Rep 5: 0xRRRRRRRR
Rep 6: 0xTTTTTTTT
Rep 7: 0xGGGGGGGG
Rep 8: 0xIIIIIIII
These 8 reps can be repeated several times.

0x0000000S
is 0 for the normal state, 1 for the special state.
If one of the states is missing, the prop will be invisible at that state.
The special state is given by one of the following properties:
- Nighttime State Change
- Prop Time of Day
- Simulator Start Date, Simulator Date Duration, Simulator Date Interval,

0xXXXXXXXX
is the offset in the model's X direction. Divide this number by 0x10000 to get meters.

0xZZZZZZZZ
is the offset in the model's Z direction. Divide this number by 0x10000 to get meters.

0xYYYYYYYY
is the offset in the model's Y direction (vertical). Divide this number by 0x10000 to get meters.

0xRRRRRRRR
is the Resource Key Type of the prop, one of the following:
- 0x27812820 for RKT0 (one single model used for all rotations and zooms)
- 0x27812821 for RKT1 (separate models for each rotation and zoom)
(see what the original prop you're converting used).

0xTTTTTTTT
0xGGGGGGGG
0xIIIIIIII

is the TGI address of the prop model.

Other Properties

The various "xm" RKT properties, such as RKT1xm, are used for referencing mirrored versions of props, particularly in conjunction with Type21 Exemplars. The mirrored RKT0 property is named RKTMisc.