Post-processing-effectors (PPE)

From Mod Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 16:58, 6 July 2008 (edit)
Atrocious (Talk | contribs)
(minor edit)
← Previous diff
Revision as of 17:02, 6 July 2008 (edit) (undo)
Don Reba (Talk | contribs)
m (category)
Next diff →
Line 93: Line 93:
[[ru:Формат файлов постпроцессинга (ppe)]] [[ru:Формат файлов постпроцессинга (ppe)]]
 +[[Category:Articles]]

Revision as of 17:02, 6 July 2008

Custom PPE for gray vision
Custom PPE for gray vision

Post-process effectors (.ppe) in STALKER are used to create visual effects like radiation-exposure, drunkenness, psy-effects, night-vision and other. They are binary files that have a certain internal structure. Once you understand the structure and manage to keep the overview in the file, you can edit them or even create new effectors. Note that PPEs always effect the whole screen, so it is not possible to limit effects to certain areas. A necessary tool to edit PPEs is a decent hex editor like HxD.

This article is based on the Russian version by Green Hawk (see interwiki link). Many thanks to him for doing the research and sharing with the community!

Contents

Analysis

It may help you to understand the structure of PPEs if you look into \gamedata\script\postprocess.script and into some ltx like \gamedata\config\scripts\proba.ltx. It seems like postprocess.script was used to create PPEs - or at least read PPE configurations from .ltx'.

Every PPE file contains multiple sets of rules. The structure of these rule-sets can be guessed by looking at the files above. But to make things easier, here is an overview over the structure. If you open a PPE in HxD to compare the structure with this explanation, it can be useful to change the number of bytes per row to something like eight. It may help you to gain a better overview of the file segments.

File header

Every file starts with 01 00 00 00. This is most likely a signature to identify the file content (the camera animations share the same structure and have the signature 00 11 00 00). Then four bytes with unknown meaning follow. Usually they are 7C 00 00 00 but there are slight variations. So our file until here looks like 01 00 00 00 7C 00 00 00. Now the rule-sets follow.

Rule-sets

Every set begins with 01 01 XX 00 where XX is the number of rules that the set contains. For example 01 01 00 00 means that no rule follows, so the set is not active at all. Many mistakes happen if the number given at the start of the set does not fit the number of rules. Make sure to check it, every time you change something.

Rules always consist of 23 bytes! This makes keeping the overview more complicated because now we have even headers and odd content. So your lines will pretty fast break. If a rule-set started with 01 01 04 00 then there will be 04 x 23 bytes of rules following.

To get a better understanding, it might be good to look at an example file wit comments now, before we look at the explanation of the segments.

Example file with comments

The following example shows the structure of a PPE with comments. It is taken from the Russian article and translated with google. Since the translations do not always make sense, I left the Russian originals for future improved translations.

01 00 00 00 		;signature
 
;Colors twisted at a maximum 
;  Цвета выкручиваем на максимум
7C 00 00 00 		;unknown1
01 01 02 00 		;color_add_red
00 00 80 3F 00 00 00 00 00 00 80 00 80 00 80 00 80 00 80 00 80 00 80 
00 00 80 3F 00 00 00 41 00 00 80 00 80 00 80 00 80 00 80 00 80 00 80 
01 01 02 00 		;color_add_green
00 00 80 3F 00 00 00 00 00 00 80 00 80 00 80 00 80 00 80 00 80 00 80 
00 00 80 3F 00 00 00 41 00 00 80 00 80 00 80 00 80 00 80 00 80 00 80 
01 01 02 00 		;color_add_blue
00 00 80 3F 00 00 00 00 00 00 80 00 80 00 80 00 80 00 80 00 80 00 80 
00 00 80 3F 00 00 00 41 00 00 80 00 80 00 80 00 80 00 80 00 80 00 80 
 
;Do not understand how, but this triad podkrashivaet already translated into
;  Не понимаю как, но эта триада подкрашивает уже переведенное в 
;chb image, that is doing slightly sinevatym result, at the same time
;  чб изображение, то есть делаем слегка синеватым результат, заодно
;rusticate slightly red or green.
;  огрубляем слегка красные или зеленые.
 
6C 10 00 00  		;unknown2
01 01 02 00 		;color_base_red
CD CC CC 3D 00 00 00 00 00 00 80 00 80 00 80 00 80 00 80 00 80 00 80 
CD CC CC 3D 00 00 00 41 00 00 80 00 80 00 80 00 80 00 80 00 80 00 80 
01 01 02 00 		;color_base_green
CD CC CC 3D 00 00 00 00 00 00 80 00 80 00 80 00 80 00 80 00 80 00 80 
CD CC CC 3D 00 00 00 41 00 00 80 00 80 00 80 00 80 00 80 00 80 00 80 
01 01 02 00 		;color_base_blue
CD CC 4C 3E 00 00 00 00 00 00 80 00 80 00 80 00 80 00 80 00 80 00 80 
CD CC 4C 3E 00 00 00 41 00 00 80 00 80 00 80 00 80 00 80 00 80 00 80 
 
;In the gray mode all red objects - white, blue and green - black
;  В сером режиме все красные обьекты - белым, синие и зеленые - черным
 
7C 00 00 00  		;unknown3
01 01 02 00 		;color_gray_red
00 00 80 3F 00 00 00 00 00 00 80 00 80 00 80 00 80 00 80 00 80 00 80 
00 00 80 3F 00 00 00 41 00 00 80 00 80 00 80 00 80 00 80 00 80 00 80 
01 01 02 00 		;color_gray_green
00 00 80 BF 00 00 00 00 00 00 80 00 80 00 80 00 80 00 80 00 80 00 80 
00 00 80 BF 00 00 00 41 00 00 80 00 80 00 80 00 80 00 80 00 80 00 80 
01 01 02 00 		;color_gray_blue
00 00 80 BF 00 00 00 00 00 00 80 00 80 00 80 00 80 00 80 00 80 00 80 
00 00 80 BF 00 00 00 41 00 00 80 00 80 00 80 00 80 00 80 00 80 00 80 
 
;Fully black-and-white image, subject to the rules color_gray_ *
;  Полностью черно-белое изображение с учетом правил color_gray_*
 
01 01 02 00 		;gray
00 00 80 3F 00 00 00 00 00 00 80 00 80 00 80 00 80 00 80 00 80 00 80 
00 00 80 3F 00 00 00 41 00 00 80 00 80 00 80 00 80 00 80 00 80 00 80 
 
01 01 00 00 		;blur
 
;Dvoeniya in the eyes will not be
;  Двоения в глазах не будет
 
01 01 00 00 		;duality_h
01 01 00 00 		;duality_v
 
;Noise will not be
;  Шума не будет
 
01 01 00 00 		;noise_intensivity
01 01 00 00 		;noise_granularity
01 01 00 00		;noise_fps
Personal tools
In other languages