graphics.dat item 560: "inventory palette colours repla

Discuss Chaos Strikes Back for Windows and Linux, an unofficial port of Chaos Strikes Back to PC by Paul Stevens, as well as CSBuild, an associated dungeon editor.

Moderator: Zyx

Forum rules
Please read the Forum rules and policies before posting.
Post Reply
User avatar
Adamo
Italodance spammer
Posts: 1534
Joined: Fri Apr 22, 2005 11:59 am
Location: Poland
Contact:

graphics.dat item 560: "inventory palette colours repla

Post by Adamo »

ChristopheF wrote ( http://dmweb.free.fr/?q=node/1396 ):

Code: Select all

030h (0048), 16 bytes, Unknown

Values: 0 0 0 0 0 0 0 0 0 0 0 0 40 0 0 0
MissingMissing: An explanation of the role of these bytes
If you can help, please E-mail me!
*(40 dec = 28 hex)

These are 16 bytes representing usual DM palette:

colour 0 (#000000) (black)
colour 1 (#6D6D6D) (grey3)
colour 2 (#919191) (grey2)
colour 3 (#6D2400) (brown)
colour 4 (#00DADA) (pale blue)
colour 5 (#914800) (pale brown)
colour 6 (#009100) (green)
colour 7 (#00DA00) (pale green)
colour 8 (#FF0000) (red)
colour 9 (#FFB600) (orange)
colour 10 (#DA916D) (skin)
colour 11 (#FFFF00) (yellow)
colour 12 (#484848) (grey4)
colour 13 (#B6B6B6) (grey1)
colour 14 (#0000FF) (blue)
colour 15 (#FFFFFF) (white)

These bytes shows, which colour should be swapped in the "use weapon" section (when a character holds a weapon, it is showed on a blue background instead of a hand bitmap). As you can see, the 13th byte is changed to 28.
It`s originally set to "00 00 00 00 00 00 00 00 00 00 00 00 28 00 00 00".
It means that colour nr 12 (grey4 colour) is replaced by the pale blue (values from 28 to 31). All other colours are set to black (values 00 to 0f). So all colours of the weapons, originally used in a game are replaced with black. The grey4 background is replaced with pale blue. That`s why when you hold a weapon, it is showed all black on a pale blue background. But it can all be changed as you wish.
Take a look at the graphics.dat parts from "0042: item graphics0 (32 items)" to "0047: items and body parts graphics6 (32 items)".

:arrow: Background of every item is grey4; if it was red, for example (colour nr 8 ), then you should change the 9th byte (representing red) to 28 (representing pale blue) and all other like this: "00 00 00 00 00 00 00 00 28 00 00 00 00 00 00 00".

:arrow: If you want all items to be shown in yellow, instead of black, on a pale blue background, you should change all other colours like this: "6e 6e 6e 6e 6e 6e 6e 6e 6e 6e 6e 6e 28 6e 6e 6e"

I`ll write a description in hexes:

00-09: black
0a-13: grey3
14-1d: grey2
1e-27: brown
28-31: pale blue
32-3b: pale brown
3c-45: green
46-4f: pale green
50-59: red
5a-63: orange
64-6d: skin
6e-77: yellow
78-81: grey4
82-8b: grey1
8c-95: blue
96-9f: white
Spoiler
(\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/)
Spoiler
(@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@)
Spoiler
(>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<)
User avatar
ChristopheF
Encyclopedist
Posts: 1538
Joined: Sun Oct 24, 1999 2:36 pm
Location: France
Contact:

Post by ChristopheF »

Thanks a lot for this information!

I have updated the web page on my web site accordingly.
User avatar
zoom
Grand Master
Posts: 1819
Joined: Tue Sep 23, 2003 1:27 am
Location: far away but close enough

Post by zoom »

cool job adamo
User avatar
Adamo
Italodance spammer
Posts: 1534
Joined: Fri Apr 22, 2005 11:59 am
Location: Poland
Contact:

Post by Adamo »

there`s even cooler stuff on 562, Zoom:

graphics.dat 562:

:arrow: offset 444-447 (descripted as i8 Byte1386[4]; ): Colour of the character text (ex. when reincarnating) PLUS colour of the character at top right section:

offest 444- 1st char
offset 445- 2nd char
offset 446- 3rd char
offset 447- 4th char

00 means black
01 means grey3
02 means grey2
03 means brown
04 means pale blue
05 means pale brown
06 means green
07 means pale green
08 means red
09 means orange
0a means skin
0b means yellow
0c means grey4
0d means grey1
0e means blue
0f means white

:arrow: offset 464-479 (descripted as i8 Byte1382[16]; ): object in hand palette (when on viewport): it works exactly as I described in my last post of item 560 (00-09: black, 0a-13: grey3, 14-1d: grey2 etc. ). Changes 16 actual colours to 16 new ones.

:arrow: offset 448-463 (descripted as i8 Byte1366[16]; ): same as above, but applies to the shadow of the item, not the item itself, when displayed as a cursor. And, shadow is drawn on the whole screen, not only on the viewport.


As for the hand cursor and arrow cursor, I don`t have idea how they are drawn??? i8 Byte1350[128]; and i8 Byte1222[128];
Last edited by Adamo on Tue Nov 17, 2009 12:40 pm, edited 1 time in total.
Spoiler
(\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/)
Spoiler
(@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@)
Spoiler
(>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<)
User avatar
Gambit37
Should eat more pies
Posts: 13715
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Post by Gambit37 »

Cool stuff! Allows even more customisations. Excellent work Adamo!
User avatar
Adamo
Italodance spammer
Posts: 1534
Joined: Fri Apr 22, 2005 11:59 am
Location: Poland
Contact:

Post by Adamo »

graphics.dat item 562:

Usual DM palette 16 colour sets. But each colour is coded by 2 bytes here (I think the second byte is for the colour brightness, but I`m not sure!). Anyway, you can choose from 512 Atari colours.

offset 1278-1309 [32]: viewport palette 1 (full light)
offset 1310-1341 [32]: viewport palette 2
offset 1342-1373 [32]: viewport palette 3
offset 1374-1405 [32]: viewport palette 4
offset 1406-1437 [32]: viewport palette 5
offset 1438-1469 [32]: viewport palette 6 (darkest)
offset 1470-1501 [32]: entrance palette
offset 1502-1533 [32]: credits palette

So if you want, for example, change the GREEN colour from 3rd palette (1342-1373) to WHITE colour, you take 7th colour (colour nr 6), which are 13th and 14th bytes from this palette (bytes 1354 and 1355) and change them to ff ff.

All the palettes can be completely rearranged! You have 512 colours to choose. For example, the darkest palette may have 16 greyish colour (now it uses only 9 dark colours), while the full light palette might use only dark red and glowing yellow. Etc, etc, it`s up to the designer.
But changing the full light palette also applies inventory mode!
An area ABOVE y1=33 can never use palettes 2-6 I think.

Usual DM colour order:
colour 0 (black)
colour 1 (grey3)
colour 2 (grey2)
colour 3 (brown)
colour 4 (pale blue)
colour 5 (pale brown)
colour 6 (green)
colour 7 (pale green)
colour 8 (red)
colour 9 (orange)
colour 10 (skin)
colour 11 (yellow)
colour 12 (grey4)
colour 13 (grey1)
colour 14 (blue)
colour 15 (white)
Spoiler
(\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/)
Spoiler
(@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@)
Spoiler
(>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<)
User avatar
zoom
Grand Master
Posts: 1819
Joined: Tue Sep 23, 2003 1:27 am
Location: far away but close enough

Post by zoom »

So you could go monochrome all the way..
I think there was a filter or something in csbuild doing this kind of stuff, no? Probably Adamo, your explanations can be used there somehow...
User avatar
Gambit37
Should eat more pies
Posts: 13715
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Post by Gambit37 »

Amazing! Some hard-cored editing could create a totally different looking game :-)
User avatar
Adamo
Italodance spammer
Posts: 1534
Joined: Fri Apr 22, 2005 11:59 am
Location: Poland
Contact:

Post by Adamo »

@zooom: CSBwin filters can be used independently (for example, in special situations).
Hex editing of coded values must have been done very carefully and must depend on the wallsets, used by the designer. They will affect on the whole inventory bitmaps, for example!

Sadly, the DM palettes allign not only to the ingame viewport, but also to the interface area on the right of the viewport.

CSBwin graphics filters applies only to the viewport, while coded values applies also to the stuff to the right of the viewport (like spell casting area etc), and to the ingame inventory mode (first "full light" palette). So the priority for a designer should be setting these palettes first for an inventory mode and interface to look good, and modyfying the viewport window by CSBwin filters right after (for example, to get back to previous state on the viewport, wchich is to reverse the interface affects on the viewport).
With these both thing used carefully, the game can be totally rearranged (both viewport palettes AND interface bitmaps seemingly independently), but it would require a lot of work- is Zyx near?? ;)

---------------------------
Oh, and I don`t know a lot about 2 bytes coding of 512 colours from Atari palette. You should ask Paul Stevens I believe. What Iknow is that there might be only 16 colours in a line (Atari limitations).
Spoiler
(\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/)
Spoiler
(@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@)
Spoiler
(>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<)
User avatar
zoom
Grand Master
Posts: 1819
Joined: Tue Sep 23, 2003 1:27 am
Location: far away but close enough

Post by zoom »

we should by all means produce a sample of all this viewport changeing!
User avatar
Adamo
Italodance spammer
Posts: 1534
Joined: Fri Apr 22, 2005 11:59 am
Location: Poland
Contact:

Post by Adamo »

graphics.dat562 again:
http://dmweb.free.fr/?q=node/1398

Code: Select all

 i8  Byte156[16];   //        ... 16 bytes = { 0, 10, 20, 30, ...}
               // special lightning bolt/fireball/poison/dispel palette?
yes, the bytes from offset 1674-1689 are used to replace colours of:
1. missiles at D1 (but not D0 and D2-D3!),
2. clouds & explosions at D1-D4 (yes, some clouds are visible from distance=4!), but not at D0!

The palette modifier of the clouds and missiles was implemented into the game, but never actually used (it replaces all the colours with the same ones). A designer might change the palettes if he wants to, but it seems pointless, as it`s much easies to modify the bitmaps... 11th colour (colour nr 10= skin) must stay untouched (64hex= 100dec= skin), because it`s transparent.
For example, if the code is changed to 50 50 50 50 50 50 50 50 50 50 64 50 50 50 50 that would mean every missile at D1 and every cloud except D0 will be always 100% red.
Spoiler
(\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/)
Spoiler
(@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@)
Spoiler
(>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<)
User avatar
Adamo
Italodance spammer
Posts: 1534
Joined: Fri Apr 22, 2005 11:59 am
Location: Poland
Contact:

Post by Adamo »

REASUMING.

Modifible by:

Code: Select all

----------------------------------------
| byte | HEX| DEC| colour    | RGB     |
| order|    |    |           |         |
----------------------------------------
|  01  | 00 | 00 | black     | #000000 |
|  02  | 01 | 01 | grey3     | #6D6D6D |
|  03  | 02 | 02 | grey2     | #919191 |
|  04  | 03 | 03 | brown     | #6D2400 |
|  05  | 04 | 04 | pale blue | #00DADA |
|  06  | 05 | 05 | pale brown| #914800 |
|  07  | 06 | 06 | green     | #009100 |
|  08  | 07 | 07 | pale green| #00DA00 |
|  09  | 08 | 08 | red       | #FF0000 |
|  10  | 09 | 09 | orange    | #FFB600 |
|  11  | 0a | 10 | skin      | #DA916D |
|  12  | 0b | 11 | yellow    | #FFFF00 |
|  13  | 0c | 12 | grey4     | #484848 |
|  14  | 0d | 13 | grey1     | #B6B6B6 |
|  15  | 0e | 14 | blue      | #0000FF |
|  16  | 0f | 15 | white     | #FFFFFF |
----------------------------------------
:arrow: colour of character text palette modifier + colour of characters at top right section modifier
(graphics.dat item562, offset 444-447[4])

Modyfible by:

Code: Select all

------------------------------------------------
| byte | HEX   | DEC     | colour    | RGB     |
| order|       |         |           |         |
------------------------------------------------
|  01  | 00-09 | 00-09   | black     | #000000 |
|  02  | 0a-13 | 10-19   | grey3     | #6D6D6D |
|  03  | 14-1d | 20-29   | grey2     | #919191 |
|  04  | 1e-27 | 30-39   | brown     | #6D2400 |
|  05  | 28-31 | 40-49   | pale blue | #00DADA |
|  06  | 32-3b | 50-59   | pale brown| #914800 |
|  07  | 3c-45 | 60-69   | green     | #009100 |
|  08  | 46-4f | 70-79   | pale green| #00DA00 |
|  09  | 50-59 | 80-89   | red       | #FF0000 |
|  10  | 5a-63 | 90-99   | orange    | #FFB600 |
|  11  | 64-6d | 100-109 | skin      | #DA916D |
|  12  | 6e-77 | 110-119 | yellow    | #FFFF00 |
|  13  | 78-81 | 120-129 | grey4     | #484848 |
|  14  | 82-8b | 130-139 | grey1     | #B6B6B6 |
|  15  | 8c-95 | 140-149 | blue      | #0000FF |
|  16  | 96-9f | 150-159 | white     | #FFFFFF |
------------------------------------------------
:arrow: palette modifier to display items in action area
(graphics.dat item562, offset 48-64[16])

:arrow: object in hand palette modyfier
(graphics.dat item562, offset 464-479[16])

:arrow: object in hand palette shadow modifier
(graphics.dat item562, offset 448-463[16])

:arrow: D1 missiles and D1-D4 clouds palette modifier
(graphics.dat item562, offset 1674-1689[16])

:arrow: viewport palette1 modifier
(graphics.dat item562, offset 1278-1309[32])

:arrow: viewport palette2 modifier
(graphics.dat item562, offset 1310-1341[32])

:arrow: viewport palette3 modifier
(graphics.dat item562, offset 1342-1373[32])

:arrow: viewport palette4 modifier
(graphics.dat item562, offset 1374-1405[32])

:arrow: viewport palette5 modifier
(graphics.dat item562, offset 1406-1437[32])

:arrow: viewport palette6 modifier
(graphics.dat item562, offset 1438-1469[32])

:arrow: entrance palette modifier
(graphics.dat item562, offset 1470-1501[32])

:arrow: credits palette modifier
(graphics.dat item562, offset 1502-1533[32])

Warning! Each colour of Viewport Palette Modifiers has additional byte for each colour, probably for the colour brightness!

Warning2! palette modifier to display items in action area, object in hand palette modyfier, object in hand palette shadow modifier and D1 missiles and D1-D4 clouds palette modifier probably uses actual colours of viewport palette1! And, below y1=33, they use actual colours of other viewport palettes equivalents depending on current brightness!
Spoiler
(\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/)
Spoiler
(@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@)
Spoiler
(>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<)
User avatar
Adamo
Italodance spammer
Posts: 1534
Joined: Fri Apr 22, 2005 11:59 am
Location: Poland
Contact:

Post by Adamo »

According to the Encyclopedia ( http://dmweb.free.fr/?q=node/1394 ), in graphics.dat item558 there are also:

:arrow: monsters at D2 palette modifier
(graphics.dat item558, offset 618-633[16]),

:arrow: monsters at D3 palette modifier
(graphics.dat item558, offset 664-649[16]),

:arrow: flooritems & flying objects(*) at D2 palette modifier
(graphics.dat item558, offset 1502-1517[16]),
(*)- every flying objects, like compass or missile

:arrow: flooritems & flying objects(*) at D3 palette modifier
(graphics.dat item558, offset 1518-1533[16]),
(*)- every flying objects, like compass or missile

:arrow: D0-D4 death cloud palette modifier
(graphics.dat item558, offset 1534-1549[16]),

:arrow: door decorations at D2 palette modifier
(graphics.dat item558, offset 3058-3073[16]),

:arrow: door decorations at D3 palette modifier
(graphics.dat item558, offset 3074-3089[16]),

:arrow: wall decorations + doorbuttons at D2 palette modifier
(graphics.dat item558, offset 3090-3105[16]),

:arrow: wall decorations + doorbuttons at D3 palette modifier
(graphics.dat item558, offset 3106-3121[16]).
Spoiler
(\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/)
Spoiler
(@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@)
Spoiler
(>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<)
Post Reply

Return to “Chaos Strikes Back for Windows & Linux (CSBWin) / CSBuild”