Jump to content
Cm_blast

Colours.bin RESEARCH

Recommended Posts

I did a good amount of research about the file "colours.bin", which decide the colours from all the eight factions. This post is to show to you all I know about this: the meaning of the valors, what to do, etc... 

First. To open this file, is needed a hex editor. In my case (I am someone who barely never used a hex editor) I found the webpage "hexed.it" which contains an online version of a hex editor; so if you don't want to install another program but just mess around a bit, this is a good choice.

After entering that web-page, and using the "open file" in the menu to open "colours.bin" (in the data/bin folder), this will appears.
en.png

The first thing about this, is how the first two lines (selected with cyan) refers to Atreides, the next two are Harkonnen, Ordos, Emperor, Fremen, Smugglers, Mercenaries and Sandworm, respectively. (the same order that in the Dune 2000 editor).

Now, the colours are defined by 4 values. So, "84 04" (the very first line) will refer to a specific colour in a specific part of the Atreides. I don't know exactly what will change, although not all affect to units (some seems to affect a very small in the refinery but not the factories (is recommended to use a map editor and place all the buildings and units to see what changes).

At least I know for sure that the four group "2D D2" (first 4 numbers in the second line) refers from the colour in the radar. Change this four valours and the colour in the radar (minimap) will change.

Now, the biggest problem I found, is how to know what number means what thing. In the colour code from HTML they are a total of six numbers. Two referring for Red, Green and Blue respectively. so 00-00-00 is black, 127-0-0 is a mid Red-bright, and 0-0-255 is the brightest Blue possible.

HOWEVER. Here this not work this way, thus making it a bit confusing: "00 00" is black; FF FF is white, but 88 88 is not gray. In fact, don't even have red.
To know exactly what the values are, I changed the values from the "minimap" and then check in the minimap (with photoshop) during the game and created an Excel to have it well documented. Here the table I did.
table v2.png

So, taking my previous example, using 88 88 it means this:
1º 8 = 32 of Green
2º 8 = 66 of Blue
3º 8 = 0 of Red
4º 8 = 16 of Red
So, 88 88 gives this colour editor 03.png <--

Just for adding more examples. The brightest of the three colours will be this way:
For Red: 00 FC --> 0 + 231 +  0 + 24 = 255 (and zero of Green/Blue)
For Green: E0 03 --> 48 + 0 + 0 + 195 = 243 (and zero of Red/Blue)
For Blue: 1F 00 --> 132 + 0 + 123 + 0 = 255 (and zero of Red/Green)
Note: I didn't found a way to make the green goes 255.

Here I upload the excel, so people can have access to it. Feel free to download it and changing the spanish words to english (Or any other language you understand better). I hope this will help people to create intereseting colours, like a cyan or a magenta or... for houses or enemies.
colores y hexadecimal.xls

Just remember that this will change the original colours forever. Create a back_up first, so you can revert the changes.

Finally, to show how it looks, Look at this original campaign levels, affected by a simple palette spaw done by me. For now is just a swap pallete bewteen the Houses, but Maybe is possible to make a new color that is not confused with the other players (like happens now with Atreides and Fremen tanks and quads).

Dibujo 01.PNG

Dibujo 02.PNG

Dibujo 03.PNG

 

Edited by Cm_blast
  • Upvote 3

Share this post


Link to post
Share on other sites

Awesome, be sure to put this on the Wiki too! 

Share this post


Link to post
Share on other sites

I fixed the table and the excel. The 2º and 3º valor of the group of 4 were exchanged.
this way the two first number is about Blue (mostly) and the third valor is red.
Also, the examples with the 255 were fixed too (although I didn't found the 255 green).
In the other hand, changing the "sandworm" colours won't affect the creature, only the buildings/units (the color that distinguishes it, not the color of the buildings themselves).

Edited by Cm_blast

Share this post


Link to post
Share on other sites

Interesting research! Interesting site, that you recommended, HexEd.it.

As additional bonus, the site opened in my computer with interface in good Russian. Not bad!

Share this post


Link to post
Share on other sites
On 3/6/2016 at 5:31 AM, Shai-Gel98 said:

Awesome, be sure to put this on the Wiki too! 

I don't know how, anyway, Would be better if not me (not native english) could rewrite my post somehow to use it as part of a tutorial or a wiki or... but again, something that write proper english.

4 hours ago, Adriano said:

Interesting research! Interesting site, that you recommended, HexEd.it.

As additional bonus, the site opened in my computer with interface in good Russian. Not bad!

That's cool. I think there is more web-pages over there, but this was the very first page that appeared me. I was about to mess around a bit, but endend doing the whole research.

--- Edit ---

I bring my first test. Removing any trace of red, we get a cyan colour. I reemplaced "Fremen" so I could do a good comparison between the two colours using the same type of building.
my first test.png

I need to test if in a actual game the colours are confusing or no. I mean, like giving the player original Atr-colour, and then giving the IA the control of this "cyan" Atreides, so "2 Atreides vs whoever".

By the way. I usually play with a resolution of 640x400, so the units/buildings are big and seem easy to differentiate them. However maybe in a bigger resolution or in a big fight is harder... I don't know.

If someone want to give a try and test in a regular run (i will recomender to play with the same settings that you usually do: resolution, speed game...). Here I left a edited map, one from the ixian campaign made by akafeda and Galaxy with an ally for the player fighting near each other (thus I don't have to create a whole map or set of events or changing the behaviour of the Ias).
grupo de control.zip

This include "aaaaaaaa.mis", map, ini. and the colours.bin (remember doing a back up of the original colours.bin first). I changed the enemies to Harkonnen/ordos/emperor (just for clarify), and removed the mission fail/victory (this mean the game never end by itself), because this is just for testing purposes.

Pd: Choose Atreides in the mission launcher, or you can open the map with the editor and hit F8/F9.

Edited by Cm_blast

Share this post


Link to post
Share on other sites
On 6/4/2016 at 10:39 AM, Cm_blast said:

I don't know how, anyway, Would be better if not me (not native english) could rewrite my post somehow to use it as part of a tutorial or a wiki or... but again, something that write proper english.

Okay, I'll rewrite it and add it later on :happy:

  • Upvote 1

Share this post


Link to post
Share on other sites
1 hour ago, Shai-Gel98 said:

Okay, I'll rewrite it and add it later on :happy:

Good. Of course, I could be wrong in somewhere; but at least in general I'm sure about all of this.

By the way, I play the test-map using that Cyan as an ally and I could said: In general, is not too confusing. Is a bit confusing mostly the troopers and the Atreides combat tanks, HOWEVER. In this map there is some "Atreides tanks" controled by the Ordos, and that's even more confusing than the Cyan.

What I mean. Is harder to differentiate 1 Atreides "Atreides Tank" with 1 Ordos "Atreides Tank" than 1 Atreides "Atreides thank" with My_cyan "Atreides tank".

Now is a shame that there is only 1 Harkonnen side in the game, to create a "brighter/darker" (or Orange) versión, so Harkonnen and "new orange" Could play togheter. (The Emperor could work, at least until Tech 5).

Share this post


Link to post
Share on other sites

I've added some to the wiki, and I'm now checking what each two bytes changes, for example, the first two will change all the pixels in the sprites that are coloured black, or #000000. 

Share this post


Link to post
Share on other sites

So creating a new colour for a house seems to be a bit simple, and a bit hard. The easy part would be first choosing the colour and all the 15 shades for it, the hard part would be then converting the colour and shades to the hex format that the game uses. To do that I suppose you would need to look at the RGB values of the colour or shade and do your best to find a close match by adding them up using the chart. Although this whole process could probably just be automated using only the original colour that you've chosen, I'll look into doing this probably tomorrow. The wiki page by the way is here http://old.d2kplus.com/wiki/index.php?title=Colours_BIN 

Edited by Shai-Gel98

Share this post


Link to post
Share on other sites
10 hours ago, Shai-Gel98 said:

So creating a new colour for a house seems to be a bit simple, and a bit hard. The easy part would be first choosing the colour and all the 15 shades for it, the hard part would be then converting the colour and shades to the hex format that the game uses. To do that I suppose you would need to look at the RGB values of the colour or shade and do your best to find a close match by adding them up using the chart. Although this whole process could probably just be automated using only the original colour that you've chosen, I'll look into doing this probably tomorrow. The wiki page by the way is here http://old.d2kplus.com/wiki/index.php?title=Colours_BIN 

I can see there this line: "the chart said 2D D2 is 113 green but in reality is 115". (<-- I'm refering only to the green part).
I just use a "copy-paste" from the game to photoshop, so maybe in the transition some small points of green were lost. 

Previously I said I didn't found any combination to make the green increasing to 255 (only 243), So I would said to you to check mostly among the first and third values, since some values are repeated. You may check there and look if you find those missing 12 points of Green.

If you be able to find them, feel free to update the chart.

Edited by Cm_blast

Share this post


Link to post
Share on other sites

So that's why indexes greater than 7 in missions get those screwed up colors, since only 7 colors are properly defined, the rest seem to take random values. I guess the index number would be like a seed for those colors, or maybe it's using the index value, no idea. I tried getting an orange version in few minutes by choosing a bunch of orange shades, but didn't have time to document about what each byte represents exactly, so i ended up with a messed up color exactly like those indexes :D 

 

I don't really get the first chart. I mean the sprite colors. That's why i screwed up my color i guess, since i probably didn't apply the shades in the correct order. Can you please elaborate a bit about the order of those bytes? I mean row 1 #2, #3 #4 etc, how should it be?

Share this post


Link to post
Share on other sites
21 minutes ago, FedaYkin said:

So that's why indexes greater than 7 in missions get those screwed up colors, since only 7 colors are properly defined, the rest seem to take random values. I guess the index number would be like a seed for those colors, or maybe it's using the index value, no idea. I tried getting an orange version in few minutes by choosing a bunch of orange shades, but didn't have time to document about what each byte represents exactly, so i ended up with a messed up color exactly like those indexes :D 

 

I don't really get the first chart. I mean the sprite colors. That's why i screwed up my color i guess, since i probably didn't apply the shades in the correct order. Can you please elaborate a bit about the order of those bytes? I mean row 1 #2, #3 #4 etc, how should it be?

Yeah, I guess saying row #1 and such isn't very clear, it now just says the number of the defined colour, so there a total of 16 of them, and each defined colour is two bytes long. I'll add a little more to that on the page to explain it better. Also, there's 8 house colours, not 7, since the Sandworm house is defined too. 

Share this post


Link to post
Share on other sites
1 hour ago, Cm_blast said:

I can see there this line: "the chart said 2D D2 is 113 green but in reality is 115". (<-- I'm refering only to the green part).
I just use a "copy-paste" from the game to photoshop, so maybe in the transition some small points of green were lost. 

Previously I said I didn't found any combination to make the green increasing to 255 (only 243), So I would said to you to check mostly among the first and third values, since some values are repeated. You may check there and look if you find those missing 12 points of Green.

If you be able to find them, feel free to update the chart.

I'm not too sure why it varies by a slight amount between the chart and in-game. Sure, I'll look to see if I can find a combination that has 255 green. Also, I'm curious as to why the first value defines each colour twice. 

Edited by Shai-Gel98

Share this post


Link to post
Share on other sites
Just now, Shai-Gel98 said:

Yeah, I guess saying row #1 and such isn't very clear, it now just says the number of the defined colour, so there a total of 16 of them, and each defined colour is two bytes long. I'll add a little more to that on the page to explain it better. Also, there's 8 house colours, not 7, since the Sandworm house is defined too. 

Yea my bad, i was thinking it in the programming way of 0 to 7, which is indeed 8 :D

 

I did understand how the bytes are structured, but i just don't know what values to add to each of them to obtain a correct color. Like shade number 3 of my color, i don't know to which byte to add it, then shade #4 etc so that the color won't get screwed. I did add the shades both from darkest to brightest and vice-versa, as table #1 goes from black to white, but the color was still messed up.

 

Modifying a current color like cm_blast did works nice though, i removed green and i got a slightly brighter version of purple (something that was supposed to be magenta, but as you mentioned the game has them a bit different), which is not useful as it's almost impossible to differentiate the two. I guess removing blue would give us a gold/yellow one, same thing, useless. Cyan is good though, since there's no turquoise-style color in Dune2000. I was trying to get a new color, not just removing red/green/blue, but trying to get it done by the hex code. That's where i got stuck with this issue of not knowing what value to insert in which byte.

 

I think that probably the reason colors aren't as they would be supposed to is because a normal hex color has 3 bytes (1 for red, 1 for green, 1 for blue), but colors.bin uses 2 bytes only for the whole shade. It pretty much cuts 8 bits of color out. So colors are similar, but not exact.

Share this post


Link to post
Share on other sites
13 minutes ago, FedaYkin said:

Yea my bad, i was thinking it in the programming way of 0 to 7, which is indeed 8 :D

 

I did understand how the bytes are structured, but i just don't know what values to add to each of them to obtain a correct color. Like shade number 3 of my color, i don't know to which byte to add it, then shade #4 etc so that the color won't get screwed. I did add the shades both from darkest to brightest and vice-versa, as table #1 goes from black to white, but the color was still messed up.

 

Modifying a current color like cm_blast did works nice though, i removed green and i got a slightly brighter version of purple (something that was supposed to be magenta, but as you mentioned the game has them a bit different), which is not useful as it's almost impossible to differentiate the two. I guess removing blue would give us a gold/yellow one, same thing, useless. Cyan is good though, since there's no turquoise-style color in Dune2000. I was trying to get a new color, not just removing red/green/blue, but trying to get it done by the hex code. That's where i got stuck with this issue of not knowing what value to insert in which byte.

 

I think that probably the reason colors aren't as they would be supposed to is because a normal hex color has 3 bytes (1 for red, 1 for green, 1 for blue), but colors.bin uses 2 bytes only for the whole shade. It pretty much cuts 8 bits of color out. So colors are similar, but not exact.

So do you mean you don't know how to convert it from the normal hex format #000000 to the "00 00" format? 

Share this post


Link to post
Share on other sites

There is a formula, diving each color by 8 or something like that IIRC lol. I might be wrong tho :v

Share this post


Link to post
Share on other sites
14 minutes ago, FedaYkin said:

There is a formula, diving each color by 8 or something like that IIRC lol. I might be wrong tho :v

I haven't really tried it myself, but I think you would need to look at the RGB values of your colour. So for an example, the colour #df7123, it's RGB  values are 223, 113, and 35. To get as close to that as I can I just need to chose the 3rd value that gets as close as it can to 223, and that would be "F" which has a red value of 231. And for green, we need to choose one for the 1st and 4th value, and that would be "C" and "1", so that's 48 + 65, which is exactly 113. And finally for blue, the 2nd value would be "4", which has a blue value of 33. So the final colour is "C4 F1", or #e77121 and if you compare the two, they are pretty close, as close as they can be anyway. And just for the sake of saying, it appears in-game as #e77321

Share this post


Link to post
Share on other sites

Okay, but that's one shade, there must be 15 others. Of course you can use this for all of them, but that's gonna look more like a piece of orange shit rather than a decent color lol. So yes, let's suppose we have defined, using your method from above, all our 16 shades of the color. Now, in which order do we add them in?

Share this post


Link to post
Share on other sites
3 minutes ago, FedaYkin said:

Okay, but that's one shade, there must be 15 others. Of course you can use this for all of them, but that's gonna look more like a piece of orange shit rather than a decent color lol. So yes, let's suppose we have defined, using your method from above, all our 16 shades of the color. Now, in which order do we add them in?

Hah, yeah it does look pretty crap when it's all just one colour. The colour that you originally chose would be the 9th one, since that gets used as the colour on the mini-map, the 8 darker ones would be #1 - #8, and the 7 lighter ones would be #10 - #16. So like this: 

CqlhZiE.png

Share this post


Link to post
Share on other sites

This is the best result I could get for orange, and it took a while to calculate those hex values. Damn dune devs, they had to make it more special :v

 

IrlbTyk.png

 

It's not perfect, as it might look similar to yellow, however there are a few differences. In some specific angles it is proper orange, in others it's more like a gold/yellow. I tried to get as close to orange as possible. One thing is certain: orange does fit Harkonnen very well :D

Share this post


Link to post
Share on other sites

Ok, actually i tweaked it a little, and I got this:

 

c3bQ7x3.png

 

Looks pretty decent IMO. 

  • Upvote 2

Share this post


Link to post
Share on other sites

That's Cool.

In my opinion, The Harkonnen buildings looks great with any colour: Blue, green, Yellow... doesn't matter, those black buildings combine with anything XD.

Oh, I just did a quick test. With a bit less of red (or more green) maybe this will look better, but for now I got this.
a quick test to orange.PNG

 

Edited by Cm_blast
  • Upvote 1

Share this post


Link to post
Share on other sites
3 hours ago, FedaYkin said:

In some specific angles it is proper orange, in others it's more like a gold/yellow.

This color looks like gold. As metal the gold.

Share this post


Link to post
Share on other sites

Both those results look pretty great :laugh:

Share this post


Link to post
Share on other sites
2 hours ago, Cm_blast said:

In my opinion, The Harkonnen buildings looks great with any colour: Blue, green, Yellow... doesn't matter, those black buildings combine with anything XD.

Especially purple 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...