wow, minecraft really is just like real life... a dozen competing color formats for no discernable reason
@lasercraft325 ай бұрын
lol accurate XD
@mgord95185 ай бұрын
It actually makes sense in real life because there are tradeoffs for using various color formats, which may suit a specific application better. Most applications that use colors stick to one specific format. Makes zero sense in a game like Minecraft though, where the only point is to get color on screen. Should've just used hex RGBA for everything (since it's by far the most common representation) and have the named colors as a nicety.
@Jan127005 ай бұрын
As always xkcd Comic 927: Standards
@Akniy5 ай бұрын
There is an actual reason. RGB makes it easier for computers Whilst HSL and HSV make it easier for humans. There's CMYK for printers because RGB it's subractive and thus works for ink. Then there's the many attempts at a perceptual colour space because nobody has not figured how to create a perfect perceptual colour space. And then you have the different Gamut color formats because of evolving technology. You've got sRGB, then P3 after sRGB and then Rec 2020 after P3
@mtarek20055 ай бұрын
@@mgord9518Minecraft has 3 or 4 different formats for position in its code which is weird
@iloveflareon5 ай бұрын
that is a very strange thing for mojang to do. at some point there will have to be another 'great flattening'-type update where things like this get fixed (1.22, maybe?).
@ignore24665 ай бұрын
If we're really lucky, an dev might see this video and bring it up. Since they've done the entire NBT rework, and we're in pre-releases for 1.21 now, we might expect to see this in 1.21.1 :)
@the_luna_lily62345 ай бұрын
it seems like thats what they are trying to do with 1.20.5 with the datapack changes (They have to do changes like this in one go, as even smaller things would break datapacks, so might as well put all the changes that break datapacks into 1 update, so datapack creators only need to remake it once) But since they havent done it with colours, i assume we got to wait for the next big datapack update, which could be ages away
@soomuchlag20385 ай бұрын
Wekl technically you can change the color of maps I guess
@ignore24665 ай бұрын
@@the_luna_lily6234 When I see videos like Gneiss' content, I always hope and pray that devs from that game are watching too. This very well might be something they're not aware (enough) of.
@Tylorean5 ай бұрын
Ten bucks that bug report is gonna be „won’t fix“
@Beefmanington5 ай бұрын
That anole got so excited 💀
@gneissname5 ай бұрын
I was cracking up watching him. the tail just gets more and more out of control.
@robinsparrow16185 ай бұрын
i love it!
@dwarian52525 ай бұрын
@@gneissname I think the tail spins faster and faster to confuse the fly in some way. Letting the anole get close enough to strike the fly without flying away.
@zacharyevans84895 ай бұрын
@@dwarian5252 This is what I was thinking too, by slowly increasing the tail speed the fly gets used to the rapid movements and is no longer afraid of the Anole moving to eat it.
@erdmannelchen88295 ай бұрын
@@gneissname I imagined the sound of its tail tip whipping against the rock lol.
@Lookerman5 ай бұрын
Him pulling up all the coloured amor stands and it slowing the game was sudden, but wow it really is alot.
@Pog0ed5 ай бұрын
well if it was every RGB colour then his computer would most likely freeze.
@candy68525 ай бұрын
@@Pog0ed armor stands are entities. You can use them crash servers 💀
@simonwillover41755 ай бұрын
Bro's got a nice PC, bc desmos just won't put up w/ that, it's only redering dots, not 3D models.
@tsawy65 ай бұрын
In case you're not aware, he was not by any means understating when he said he wasn't using all of them. There are 5.7 million makeable just in the game.
@simonwillover41755 ай бұрын
@@tsawy6 ?! Where did you get that number from???
@error-teapot-4185 ай бұрын
I believe the 16 color choices descend from the 16 colors IBM PCs could use when they first started supporting color, those colors became ubiquitous for text based interfaces. You can find more info here: en.m.wikipedia.org/wiki/Color_Graphics_Adapter#With_an_RGBI_monitor
@ThreeEy5 ай бұрын
they indeed do, except for gold (and another color iirc)
@rogerwilco25 ай бұрын
But why are there two different variants in Minecraft then? Why have both Gold and Orange? Why is Dark Grey Grey and Grey Light Grey?
@Stettafire5 ай бұрын
Yes, but this doesn't really apply to modern programming languages, which support hexadecimal colour codes.
@RK-wz4cc5 ай бұрын
java color is those colors
@chnhakk5 ай бұрын
I bet it's because notch wanted the wools metadata to be a whole number.
@tortoise-chan5 ай бұрын
Not sure if this is relevant since beacon colors aren't part of the block (so can't / don't need to be defined in commands), but I figured I'd chime in. Funnily enough, beacons also use a completely different system. It's similar to leather armor, in that each successive stained glass block averages its RGB values with a "running total," but it's not exactly the same system as dying leather armor (which has some extra processing that tends to produce lighter and more saturated colors).
@gneissname5 ай бұрын
I really wish beacons were able to the summoned or manipulated by the player somehow, besides the normal way.
@random8325 ай бұрын
The main difference between armor and beacons is that beacons blend the new color 50% with the old one each time, whereas with leather if you craft an armor with more than one dye it'll blend all the colors [including the armor's existing color if it had one] together evenly. Like with a beacon if you have red, green, blue blocks it'll go red first, then (red+green)/2, then ((red+green)/2+blue)/2, whereas if you dye armor with all three dyes it'll go (red+green+blue)/3
@tortoise-chan5 ай бұрын
@random832 according to the wiki, armor dying also scales each color value by a 'gain factor,' which is computed as the [average of the maxima] / [maximum of the averages]. I don't know the color theory behind why.
@random8325 ай бұрын
@@tortoise-chan Ah, yeah, I'd missed that part because all the variables are named weirdly in the decompiled code
@cinnamoncat89505 ай бұрын
oh hey i recently watched some videos about beacon colors by @squibble111 they remade their first beacon color video cause it was incorrect
@exotic-gem5 ай бұрын
Minecraft’s internal data formats are insane. There are at least six ways to store coordinates (and I don’t mean different precision) The warden stores its animation data in its “brain”, which was supposed to be for villager memories. No other entity saves its animation data, so I don’t even know why it does this. Even the casing has no consistency. The variables names are a random mix of snake_case, camelCase, UpperCamelCase, Upper_Snake_Case, and I think I’ve even seen a bit of SCREAMING_CASE here and there…
@exotic-gem5 ай бұрын
More detail : coordinates are sometimes stored as an array of three (unlabeled) numbers. They can also be stored as a compound tag, with names. They are also stored with the same name adding a suffix, like “positionX” “positionY” and “positionZ” These three formats exist both in 2 and 3 coordinate variants, for a total of 6 different possibilities before accounting for precision. If you add precision, coordinates can be ints, longs, floats or doubles. Therefore, in NBT alone, there are at least 24 ways to store coordinates.
@mystic-malevolence5 ай бұрын
And structure blocks were changed to not allow uppercase, forcing me to use snake_case instead of camelCase I know this is tangential I just wanted to complain
@apollo49505 ай бұрын
Correction on the brain info: Most post-1.14 entities use the brain system for storing non-permanent information (such as cooldowns). Breezes, Piglins, Piglin Brutes, Hoglins, Wardens, Allays, Armadillos, Axolotls, Camels, Frogs, Goats, Sniffers, and Tadpoles all use them. Casing is a mess due to so many different people working on the game over the years, but more recently there has been a push to move to snake_case. Pretty much all new fields are in snake case and everything related to the item format was converted to using it when item components were added. Entities will likely also be unified under snake case once entity components exist.
@MattTOB6185 ай бұрын
No wonder why it's so hard for them to add anything into the game; they're working with a foundation of broken glass and duct tape! (To clarify: I'm being sympathetic.)
@finian25 ай бұрын
'tis the side effects of an indie game with no plans of becoming a AAA game, suddenly inflating with no concrete code guidelines.
@apollo49505 ай бұрын
There's a 7th format, technically. Recent code additions mean we can get a peek at some of the fields that data-driven blocks will have. Gravel and sand blocks both have a "falling_dust_color" field which is an ARGB string (e.g. gravel's is "#FF807C7B"). Edit 1: Biomes use the leather armor format for grass/water colors. Guess this is what happens when legacy code is everywhere :P Edit 2: Oh yeah, I forgot about the 8th format: map colors. Map colors are a mess of legacy code, and we're actually very close to running out of them (we have 2-3 slots left iirc)
@nixel13245 ай бұрын
@@apollo4950 This feels like IPv4 all over again, where I only learn it's running out when we've already almost run out.
@HolarMusic5 ай бұрын
i wish they didn't go with 8-bit hex rgb
@colevilleproductions5 ай бұрын
are data driven blocks really coming?? I thought that was just a wonderful fairy tale
@apollo49505 ай бұрын
@@colevilleproductions They're being worked on, yeah. Still a long way to go in the backend (lots of networking changes + item groups and stats need to be data-driven), but progress is happening.
@hannah420695 ай бұрын
@@HolarMusic why would you need more?
@nixnox48525 ай бұрын
This sent me off into a rabbit hole on why the Anole was wagging it's tail. Apparently they do this for a few reasons (predator evasion, aggression towards competitors, stress, mate attraction, and hunting), but in this case of hunting, the term involved is likely “caudal luring" or "caudal distraction”. The paper "Caudal Movements in Western Fence Lizards (Sceloporus occidentalis) Prior to Attempted Prey Capture" notes this behavior, but is uncertain of what function it actually performs. I've seen a few other videos of Anoles doing this that are also going after flies.
@SuperCityscan5 ай бұрын
I thought it did it to overload the visual sensory part of the brain of that fly
@random8325 ай бұрын
The alternate set of 16 color names are the chat formatting colors, they're the ones with the old § codes, and used to be the only colors that could be used for text components, until 1.16 the support for full hexadecimal color was added. Their hex values are also much simpler, mostly combinations of 00, aa, and 55. The signed integer is really annoying, it's basically the raw conversion of the hex to a 32 bit value - usually negative since alpha is usually FF, and it shows up a lot in the decompiled output when modding too. Modding also has to deal with ABGR/RGBA colors too for certain purposes (the normal representation is ARGB but a few things like texture image data use the other format). And some things in modding you have to use a Vec3 or Vec4 with floats between 0 and 1 for the R/G/B/A values. There are three color values internally associated with each dye color, the "diffuse texture color", the firework color, and the text color [used for dyed signs]. The diffuse texture color is the one used for both armor and for beacon beams, even though those are blended differently when you mix them together. It's also used for sheep, though the sheep color is darkened by 75% [except for white, which has a different hardcoded value] before mixing with the texture. And then there's the map colors. There are 62 different map colors, and each one also has four different brightnesses used for showing topographic variation on maps.
@griffinrupe5 ай бұрын
I love this kind of thing because you just know this could only ever happen in a game with as long of a development as Minecraft. Like entirely different teams of people could've implemented each of these color systems and they probably thought nothing of which color space they should use. I'm more surprised by the more recent additions like the glowing effect not being more standardized, but dyed leather armor has been around for *checks notes* twelve years?? I don't think I've dyed leather armor once in a survival world in the entire twelve years it's been around lmao
@gunkwizardry5 ай бұрын
neither have i! it's a shame too, because it's a cool mechanic but there's no incentive to use it outside of server-side stuff.
@sam007mac5 ай бұрын
Hey Gneiss, a quick command tip: if you want to point at text but not have the block outline show (3:42), you can set the block_interaction_range attribute to 0
@gneissname5 ай бұрын
Hey that is a great tip! It has bothered me in the past and I would just back out of range. I considered converting them all to blocks entities here so they don’t have it.
@layla.meowes5 ай бұрын
The reason: Mojang doesn't have color codecs, so each codec just does its own thing when converting a Java object to SNBT, as these commands were all added years apart. Basically, tech debt.
@avematthew5 ай бұрын
When those 16 colour sets didn't match it threw me for a loop so bad. I guess the main lesson I have to take away from this is that coordination is hard. For context, even in a team of two people we both ended up writing different code to format addresses. The same address field. We were working like 15 feet apart. So, this doesn't surprise me, but it's a good lesson.
@khakers2.0995 ай бұрын
Especially when done over the course of a decade plus of time and a dramatically changing codebase
@rogerwilco25 ай бұрын
A real software engineer would ask themselves "have we done this before somewhere else in the code". I would actively check for consistency and coordinate with my colleagues on such things. We also have agreements within the office that everything is coded in SI units for example. I see this as a form of professionalism.
@nettalie44355 ай бұрын
The one thing I don't get is why basically everything uses a different colour format If it was two or three different formats I could definitely understand, it's really easy to go ahead and implement something a certain way without thinking too much about it even though a different implementation already exists and would work just fine. But this isn't a case of just two or three different implementations. Almost everything works differently from one another, which means we either have a weirdly extreme case of lacking coordination on our hands (possibly due to lacking documentation? Who knows), or (the less likely option) for some reason they thought using a different format for nearly every instance of colouring would be better. Somehow. Or it's the secret third option and we're all being played like fools.
@Stettafire5 ай бұрын
@@rogerwilco2Then product comes along and says doing it the original way is too expensive and would take too long, do you're stuck using some newfangled system. As a software engineer, you must be aware of the limitations of working in a corporate environment. Coding at home is not the same beast as working for a major company.
@williamdrum98995 ай бұрын
"Big endian or little endian?"
@tiggerbiggo5 ай бұрын
This is a bit long, and it's **mostly pure speculation**, but it attempts to describe why this sort of stuff can happen in big software, not just games. If the same dev had been tasked with all the colour related tasks and had complete control over how they actually accomplish that, we probably would have gotten a standard format for colour, but picture this: Minecraft used to have only the 16 colours, and they were accessed only by block IDs, back before blocks all had unique names like minecraft:stone You're a developer who has been tasked with adding one of these colour systems. I think leather armor was first, and they designed that so it would be usable in game with dye items. So now you need to write code that takes the current colour of an armor piece, and mixes it with the dye's colour. You could store R, G and B separately, or store a hex code as a string. There's many ways you could do this, and all we have now is the 16 base colours accessed by an ID, which means we need to **make up** something entirely new. The thinking probably went like this; "The player isn't going to see this value since they will just dye these, so why store it in a hex string and have to convert it back and forth? If I store them as a single 32 bit integer, I can use bitwise operations to do the mixing on every colour at once, and just store the raw number. No need to convert to / from hex or store multiple values" (I don't know if this is why, but replace this with whatever reason sounds good to you) So armor works like that now. To change it would mean a rewrite of the code for storing and mixing those colours, and also writing code to convert old save files, since they are all storing it in the numeric format. Some time passes, players get used to armor dyeing. Let's say the boss bar / titles came next. So now you need to write code to allow a command to show a title / boss bar with a specific colour. You don't want players to have to work out the number like they do with the dyes, since at least with dyes there's no expectation that you interact with them via commands, but we're adding an explicit way to choose colour via a command so it needs to be sensible to interact with it. So they make it a bit friendlier. Some designer somewhere says that they don't like the old "Green" colour, or something about the way those old colours are named doesn't fit with a focus group (I don't agree with this imaginary reason, but the point is manager influence may have played a role in some cases). So they make a new list of colours, and allow you to use rgb as well. So titles work like that now. To change it would mean a rewrite of the code for storing and displaying titles, and also breaking backwards compatibility for old command block setups which would no longer work with the new colour format. This cycle repeats because of the scale of the existing code, lack of freedom to change it due to the locked in nature of both working in a corporate environment, and having to make sure anything you change doesn't break too much of what players have made. I'm not saying they shouldn't have maybe thought a bit further ahead, but we all know that minecraft doesn't have the smoothest history when it comes to how it has been managed. This is where I did a bit of a dive into the wiki and discovered the true scale of just how many dynamic colours minecraft actually has: * Biome colours (and the transition between them) use an image as the texture to define what colours to use, but some are hardcoded and don't use these images * Tree leaves (and other foliage) are controlled by their species as well as their biome, the block texture has that colour applied afterwards, the texture is grey. * Water, both in cauldrons and in the world, also determined by biome * Some specific blocks have a hardcoded colour despite falling into one of the above categories, nobody knows why * Sheep colours look mostly like their dyes, but they also use a completely different set of colours which are similar but slightly different to the dyes * Banners, Beacon beams, Wolf / Cat collars, and End gateway beams all use dye colours (end gateway only uses "Magenta" and "Purple") * The world border has its own colours which don't match any of the dyes So the fun doesn't stop at just the ones you can access via commands! This isn't a completely exhaustive list of reasons why minecraft colours are the way they are, it's meant to be my general thoughts when I see stuff like this. Layers upon layers upon layers of spaghetti weaving in and out, and it ends up being easier to slap on another blob of code that does the same thing again, than untangle the mess and do it properly. Also your manager is on your back about it and if you do it properly you'll be told you're wasting time.
@Stettafire5 ай бұрын
Best comment
@real_Clone_Gordon_Freeman5 ай бұрын
This channel reminds me so much of SethBling videos from back in the day
@Sollace5 ай бұрын
Must be the armor stands
@plighting_engineerd5 ай бұрын
Yay, another ✨colors ✨video!
@Bentroen_5 ай бұрын
Situation: There are six competing standards. - Six?! We need to develop one universal standard that covers all the use cases! Situation: There are seven competing standards.
@mattidragon8355 ай бұрын
There's quite good reasoning for most of these. The underlying rendering system of minecraft uses 0-1 colors, but those are quite inefficient to store (4 * 32 bits). Because of this minecraft often packs colors into a 0xAARRGGBB format (consuming only 32 bits). In some places minecraft force sets the top byte of 0xff meaning that your specified alpha is ignored. Because java only has signed integers this gets converted into decimal as signed integers for storage. My guess is that they decided to use 0-1 for particles because that's how the old (very janky) way of specifying them worked. The 16 named colors used in most places are minecrafts text colors. They have been in the game since the notch days (notch made quite a few questionable choices in the code) and probably differ from the dye colors because some of them don't look good on text. Rgb color for text is a newer feature and as such not supported quite everywhere. If you have any questions, feel free to ask.
@Soraphis915 ай бұрын
feels still like a questionable design choice to make the players enter the number as a decimal number in some places instead of straight up RGB. Also having one place with RGBA and another with ARGB... Especially regarding the commands these conversions to the internally used Color object should be done by the game, not by the player.
@Stettafire5 ай бұрын
Best comment. The comments about "lazy Devs" when people don't understand the technical limitations of working with legacy code totally pisses me off.
@dedodododedadada54785 ай бұрын
@@Soraphis91Entity NBT isn't supposed to be user-friendly, Mojang just lets players use it in commands because it doesn't break anything. It's primarily used to store the data in save files, and it makes the most sense to store color as a decimal number.
@VirtualScallop5 ай бұрын
Not to mention, isn't dyed armor also relatively ancient? It may not have been the Notch Days(TM), but I started playing in 1.1, and I remember leather armor being dyeable starting... 1.4 (Pretty Scary Update)? Which would be late 2012. Nearly 12 years ago.
@thezipcreator5 ай бұрын
@@dedodododedadada5478 I mean I wouldn't see the issue of allowing hex values in commands; like why not let players type 0xFF8000FF or something into a command, and then the parser can turn that into an int32 the same way it does with decimal
@META_Tommy5 ай бұрын
Fun fact: display entities sometimes use radians and sometimes use degrees and it’s really annoying
@joeking31815 ай бұрын
I mean, I feel like that's just the nature of making a game over the years. One developer might decide to use a certain color format as that's what they are most familiar or comfortable with, then another dev might come along and maybe doesn't like that format, so decides to use their own, but it may take more work to remove or change the old format used on certain things, or maybe they just forget they had a color format set elsewhere, or maybe they never even worked on that part of the game. Even back in the day you had them changing "Cotton" to "Wool" and changing the color palette.
@Ghorda95 ай бұрын
this is really just unique to minecraft and MMOs, any studio worth their salt would stick to preexisting formats outlined in the GDD or just leave the game alone and move onto something else.
@pleasestopsubscribingtomyc33605 ай бұрын
cloth
@nikkiofthevalley5 ай бұрын
@@Ghorda9There are no GDD colors for this, none of these things were originally supposed to be in the game. It was originally supposed to be a simple caving & crafting survival game, hence the name.
@TobiasHarms5 ай бұрын
Still by now, as in the last decade, there should be a lead developer or architect who signs off on planned changes and/or doing code reviews.
@joeking31815 ай бұрын
@@TobiasHarms That’s true, but then you also gave them coding two separate games to be as similar to each other as possible which adds an additional challenge. I’m sure they have some checks and balances when it comes to making sure things are moving in the direction they want, but they also have a quota to fill now since the game is so much bigger and not just a couple guys coding this game in their basements. They can’t put too much into any one thing or they won’t meet their set deadlines.
@BakeBakePi5 ай бұрын
And there's also the formatting codes with the section sign (§), which can be used in written books and in some text files for things like resource pack names! Great video!
@Katniss2185 ай бұрын
those are the same as the named chat colors
@ack75 ай бұрын
That anole looks so cute 10/10 best part of the video
@cerulity32k5 ай бұрын
1:12 These colors are ANSI colors, which are colors available on terminals that meet ANSI's terminal formatting standard. Nowadays, terminals on desktop environments support all of 24-bit RGB (Truecolor), however those 16 ANSI colors are often used past terminals.
@Kellerberger1285 ай бұрын
Funfact: The ANSI colors were represented by just 4 bits in the past and probably still today. With a bit for R(ed), G(reen), B(lue) and I(ntensity).
@photophone55745 ай бұрын
3:19 I know this would be an absurd amount of work, but I really want to see an armor in between every two sets of armor.
@gneissname5 ай бұрын
I think my computer would have exploded
@TheUnlocked5 ай бұрын
The leather armor color format is probably also two's complement but it's only using the lower 24 bits of a 32-bit integer, so it looks the same as an unsigned int. For both that and the background color it's almost certainly just a straight reinterpretation of the hex code in binary to a 32-bit signed int.
@falkreon4 ай бұрын
The hex code is one of minecraft's many representations of the actual 32-bit integer color-with-alpha that it uses everywhere, yes. It's only even signed because Java doesn't have an unsigned 32-bit integer type.
@merosii5 ай бұрын
THANK YOU THIS HAS BEEN BUGGING ME for so LONG. It’s such a hard detail to describe to others and you describe it so well
@matthewparker92765 ай бұрын
Some time in the future they'll probably introduce a data driven "color" component with different ways of defining it like the 16 dye colours, hex, argb, etc.
@Howzieky5 ай бұрын
This is a really interesting video, and it's one of my favorite kinds. The only request i have though is to use a larger GUI scale in the future. This scale is great if you have a large monitor and can get good resolution, but if you've got bad Internet or you're watching on a phone, it's a bit hard to see. I may just be going blind though. Either way, great video! It's really weird that Minecraft is like this
@gneissname5 ай бұрын
thanks, I thought the same thing when i was editing but it was too late at that point :/
@Mikemk_5 ай бұрын
The integers look like remnants of pre-nbt data values. RGB as an unsigned integer and ARGB as a signed integer are actually the same if the game ignores the top eight bits.
@kitlith5 ай бұрын
They could (and probably are) both 32 bit signed integers, but since one doesn't have alpha, it doesn't set the most significant bit which makes it negative. (was gonna write my own comment to the effect, but went looking for someone else's first)
@atpstorages69172 ай бұрын
@@kitlithCorrect. They are both 32 bit integers - ints. If you want the nitty gritty see the AWT Color class.
@griffinwolf57045 ай бұрын
Nice little clip of the anole
@qfurgie5 ай бұрын
Java programmer here, the default Color library in Java consists of the following: black, blue, cyan, darkGray, gray, green, lightGray, magenta, orange, pink, red, white, yellow. So neither list, but closest to the wool colors.
@falkreon4 ай бұрын
the game does not touch those color constants, because doing so would fire up AWT's Toolkit class which would crash macs running Minecraft. Those colors have nothing to do with the names Minecraft uses.
@goat.955 ай бұрын
For those who are curious, colour values from 0 - 1 is just openGL's native format for representing colour. As for why mojang doesnt convert it to rgb, who knows lol.
@Yackalips5 ай бұрын
yeah I noticed that too lol since ive been working with openGL. I have no idea why they wouldnt take a few more seconds and just divide by 255 on each so you can use rgb instead
@atpstorages69172 ай бұрын
@@Yackalips Ease of use to attach to RenderSystem.setShaderColor directly, most likely.
@LarsDonner5 ай бұрын
For the float one they should have used pre-multiplied alpha. Not just because it would cause even more confusion but also because it's the superior format.
@water17055 ай бұрын
the kind of formatting I'm expecting from minecraft
@ReddStrider5 ай бұрын
iirc the team colors are the command lines colors
@SchadenfreudeUY5 ай бұрын
I forgot dyeing leather armor was a thing, I loved that mechanic... Like a decade or so ago when I played this religiously as a kid
@therealdia5 ай бұрын
I believe the 16 colors for the glowing effect are the same as the standard ANSI color codes, which are still used in modern terminals. If that’s the case, then it wouldn’t be shocking for those colors to be derived directly from Java
@user-xsn5ozskwg5 ай бұрын
The armour dyeing is so crazy. Like, I can fundamentally imagine why it works that way (all armour has unique data attached already, it's a worthy tradeoff to require 16 bytes instead of 1 to store colour given expected player behaviours, the same can't be said for wool or concrete), but when you compare it to the other systems for handling colour it's hard to imagine someone didn't take pause at the disparity and think about rectifying it.
@invalid_user_handle5 ай бұрын
It seems like all of these color methods were developed in soluation and the thought of 'what if we used the same system as (other customizable color object)' never really came around. This does seem like something that needs standardizing, but some of these color methods (such as armor) have been in the game for years, meaning just switching Leather Armor to use RGB values instead of the decimal system would need some sort of interpreter to convert older saves, not to mention how many server plugins and gamemodes use colored armor for various things, those would need fixing too.
@Yackalips5 ай бұрын
The reason why is uses this format is probably because thats how LWJGL (the framework minecraft java is built on) uses that format by default
@synt4x5055 ай бұрын
I guess the reason why these different formats exist has to do with in what kind of data structure they're embedded: The named colors (which have nothing to do with Java itself, they're probably based on the VGA/EGA colors which are used when the graphics output is running in text mode, or on the ANSI escape sequence 4-bit colors) are used in basic commands and JSON components. Named colors just make the commands easier to use. They're also used in the old colored text format using the `§` notation. Also the glowing effect is based on the team color, which is used for the player's name, so it is also a text color and thus a named color. The hexadecimal colors are always found within JSON components. It's just common practice to denote colors in hexadecimal when styling text (e.g. in HTML/CSS). The integer and floating-point formats on the other hand are used within NBT tags. I'd assume that particles use the floating-point variant so that you can easily control each channel and create effects with commands. Normalized floating-point values are just a standard way of representing colors in graphics APIs like OpenGL. And the ARGB and RGB integer formats are not really different from each other: both formats are signed 32-bit integers, it's just that the RGB variant is implicitly opaque. They both use the same conversion rules for converting from hexadecimal to decimal: If the value is larger than the maximum value of a signed 32-bit integer (2^31-1), flip all bits, add one, and put a `-` in front (2's complement). These (probably) don't use hexadecimal formats because of the way NBT data is (de)serialized, and always converting the hexadecimal string to its integer representation would just be bad performance-wise, especially if you have a lot of such objects. Also it'd be annoying to add this single exception for colors into the code while everything else works uniformly. Some variants just don't support alpha channels because it wouldn't make sense to use them there (e.g. with leather armor). It also kind of makes sense why the particles are in RGBA format and the text etc. in ARGB: when you don't want an alpha channel, you can just copy and paste the RGB variant and it'll still work as intended. 0xABCDEF in RGB is still 0xABCDEF in ARGB. {0.0, 0.5, 1.0} in RGB is still {0.0, 0.5, 1.0} in RGBA (assuming an implicit alpha channel). It might be a bit confusing at first, but I think most of these formats are perfectly reasonable for their use case.
@juliand6655 ай бұрын
To be clear, both RGB and ARGB hex values are signed 2's complement integers, it's just that the RGB ones' top bit is always 0 so they never turn negative.
@Solid_Fuel5 ай бұрын
and you have maps: with each pixel on a map uses the average (?) color of the block and whether it is lower or higher in elevation than the block north of it
@elnico56235 ай бұрын
the set of 16 colors you say maybe are in java are actually standard, they're the 16 colors from CGA, and are everywhere, 99% of vscode themes define them, 100% of terminal themes define them, you can output them in like almost all langs, etc
@su2so35 ай бұрын
Wow, this is unhinged, thanks for demonstrating all the formats! If I am not mistaken, the ARGB twos complement and integer are actually the same format -- set A to 0 in your ARGB two's complement calculator, and it should always give you the exact same result as the RGB integer. Going off memory, though, so if you try it, let me know if I'm right :P
@sinom5 ай бұрын
Funnily enough Java only has 13 default colours built in BLACK, BLUE, CYAN, DARK_GRAY, GRAY, GREEN, LIGHT_GRAY, MAGENTA, ORANGE, PINK, RED, WHITE, YELLOW So those don't even line up. Maybe those colors are instead part of some openGL library (but I can't find that)
@Yackalips5 ай бұрын
I think its because those 16 colors used to be the only ones that showed up in terminals, so when using commands in the terminal you’d know what color it was. But for the rgb alpha value at the beginning from 0 to 1, thats because its how openGL formats it by default
@posterboymc5 ай бұрын
Speaking of names not matching when it comes to map item colors, white wool blocks renders as color 8 SNOW instead of 3 WOOL. I believe this is because there was only one wool in early development then wool became white wool when they added all the wool colors. It would make sense to change the render color of white wool at this time to compliment the other colors added.
@stefanbergung55145 ай бұрын
The main reason is spaghetti. The secondary reason is: Spectral colors are adjusted block colors, because they don't like the result of one to one translation. Leather amor needs to be tied in a game mechanic, but when you give them per command you want have convenience. As to why the comments that can give the same spectrum use different formats? There is no reason!
@Ariamaki5 ай бұрын
They do it because it's important for cross-platform compatibility, computer science history, and generally fitting the format's function.
@Ariamaki5 ай бұрын
Like, seriously, this is incredibly straight-forward. These things are purpose-built to serve specific functions, and there is no universality for it. Pretending there's some ideal color space or color display format is ignorant.
@Ariamaki5 ай бұрын
Since you're not capable of basic research or even independent creative thought on this topic for some reason: Effects, RGB + Alpha. These need to have transparency available, RGB is a the compsci default. Dusts, RGB no Alpha. Same deal, same concerns. Literally nothing unusual here: Dusts can't be transparent, so no Alpha is needed or wanted. Glow Effect, named colors: These are hard-coded and so the colors are set. This is also 'commonly player-facing', which is to say more laypeople are going to interact with it as opposed to things that will only come up for experimental modders and people making datapacks (which is less than 1% of 1%). Text Display, Named OR RGB, 0-255. Again, this is player-facing common content, so having named default options increase accessibility, and it's in 0-255 spread instead of 0-1 decimal because that's how text display WORKS (IE, granularly), whereas effects and dusts go through a different process that has different needs and potential. Text Display (Background), ARGB hex'd to a limit. YET AGAIN, surprise surprise, that's because that's... literally how it works. Backgrounds can have transparency values so you use an Alpha channel, and there are program limitations that require the other conversion. Leather Armor, RGB converted to decimal. Wow, shocker: It's because that's HOW IT WORKS. Item data has to be formatted in order to work, so it has to behave a specific way. It would have taken less time to figure this all out just from looking at things and asking yourself "Gee how does this actually function" than it does to WATCH this video, much less make it. I'm so disappointed in you.
@cobaltmn57165 ай бұрын
The 16 color system is probably a result of minecraft's text command system. A lot of games (including minecraft) format text by inserting special characters like '§' into the text. this is why text data in games looks weird. when you see a line like "OK §NAME, that will be \$§0 for that §1, is that fine? $DIALOG_YESNO" every one of those strange sets of characters is a special text command that signals the game to either insert some text there, format it in some special way, or run some sort of script. minecraft speciffically uses the section sign ('§') followed by a one-letter code that specifies a specific format command.
@AaronTheGerman5 ай бұрын
It looks to me like the text display background and leather armor both encode the color as a 32bit signed integer, but since the leather armor doesn't have the alpha channel you never see it wrap around into the negative numbers
@CaptainZark5 ай бұрын
Theres only one reason I can think of for this. This sort of thing is a very common effect of the way minecraft is designed. Specifically it is designed piece by piece with no specific end goal or vision. Just whatever the developers think would be cool at the time. Usually by different teams who dont have a full understanding of all the games systems. Since they dont have some central design document or standards they just choose whatever system works best for whatever theyre designing, and probably dont even know that it conflicts with the way other mechanics work. Tldr: No central planning means devs just do what they think is best in the moment unaware its different from everything else.
@ziphhy5 ай бұрын
They should keep the color names for everything for the less advanced users and then for more advanced users they should have hex with an occasional alpha 0-255
@JurassicJordan5 ай бұрын
I forgot about the dye-able leather. I had thought they removed it since 1.12 but I’m glad it’s still here
@gdps83715 ай бұрын
The reason why is 2 reasons in my opinion 1. Some of them have different purposes this doesn’t encompass all of them obviously but I think it does affect it partly 2. The overcomplicayed NBT system different command formats have different systems I think it’s changeable but just naturally changes because of the format TL;DR a they could make it consistent across 2-3 types but it initially made more sense/was easier for it to not be and there is no reason to change it
@tryoxiss5 ай бұрын
The colors for glow are ANSI colors, which is basically a standard to define how to Color text in a terminal. It used a 4-bit Color format (1 bit of each of red, green, and blue, and a fourth for if it should be bright or not). Because it’s very standard, it is likely that your theory is correct and they do exist in Java in the standard library or simillar.
@CaptainBeebi5 ай бұрын
So here's my best guesses based on my own experience with OpenGL: *Particles:* The RGB(A) 0.0-1.0 has to do with the way the effects are colored by OpenGL. Since we use normalized color values for vertex coloring, Minecraft's just trying to save a bit of processing time by avoiding the need to calculate (1/255)*V. This approach saves 108-264* compute cycles per particle, which doesn't seem like a whole lot but it'll add up over time. IIRC the reason Dust particles don't have use alpha value while Effect particles do is because Dust particles don't have a way to alter their transparency in the game code. *Glow Colors:* These may be locked to those 16 entries to match the color range for chat messages. The reason they're different from the dyes is because they're visibly distinct to people with colorblindness, while the dye colors are much harder to differentiate. *Text Display:* Likely uses hexcode for ease of use, since you can just copy-paste 6 characters from Photoshop or Paletton instead of 0.0-1.0 or 0-255 for each channel. Since it only needs to do the (1/255)*V calculations when initializing the entity, the tradeoff of readability vs processing time is much better than for particle generators. As for why the alpha transparency is 0-255, hexcodes don't include the alpha channel and people are better at picking random integers than random decimals. *Text Background:* I think Mojang just hates you guys, because I can't think of any reason they'd have you convert the hexcode to an integer _before_ entering it into the command block. *Leather Armor:* is stored as an integer for space-saving purposes when saving the game. One 32-bit integer takes 4 bytes of data, while three 32-bit floats take up 12 bytes. And since they only need to do the (1/255)*V calculations on loading the game like the text entities, the time spent converting the integer to floats isn't that big a deal. _*Division is very slow, taking 30-60 compute cycles to perform a single operation. Multiplication is faster, but still takes ~6 compute cycles to perform a single operation. This seems like nothing, but when you're generating hundreds or thousands of particles each second, that adds up._
@Agent_Matt_65 ай бұрын
Now I find myself remembering a video I recently watched about rainbow beacons
@jaykebird2go5 ай бұрын
I know that anole's tail going wild like that is for some kind of different reason, but it amused me so much since it reminds me of my dog wagging his tail wildly when he's excited about a treat!
@JavaJumper5 ай бұрын
Some technical info. For some reason in Minecraft you can pass any information in particle packets. And any type of particle can specify information server will be able to send to client. For example, when I was making mod I specified radius and speed of particle effect and was able to modify this value using code that spawned particles or using /particle command Also hex and decimal number is just different representation of same number. So if you have like 0x00FFFF it is just representation of number 65535. It is used because it stores each color component in one byte of 4 byte integer and it is useful when you need to store lots of color info compactly (in images). What I think about named colors (not dye ones) is those are just legacy system, as those are just aliases for color values. There is literally just class Colors in Minecraft's code that just stores each color name and it's value. But I'm not sure, maybe it is used somewhere for a different reason
@jursamaj5 ай бұрын
All of that misses the point. There shouldn't be 6 distinct ways for humans to specify colors, unless they are alternates (like the one where you can choose between the name or the RGB hex value) that are all available in all contexts. Honestly, any modder using the names should have those as macros for the RGB. Then you can just have 1 format: hex ARGB. If somebody leaves off the A part, assume no transparency.
@Stettafire5 ай бұрын
Bingo. The guy about saying you "missed the point" ironically missed the point
@BlueDavrial5 ай бұрын
I actually recently made a mod, ANC Indicators if anyone wishes to look it up, and in the process of that i had to do a lot of stuff with colors, specifically the block dye colors and the text colors. It's less notable than the weird hex vs decimal stuff you show going on in this video, but what was odd to me is that 0 of the Text Colors and Block Colors match, despite many sharing names. Block White is different than Text White. Text Gray is almost the same as Block Light Gray, while Text Dark Gray is darker than Block Gray (there is no Text Light Gray or Block Dark Gray)
@evidence28395 ай бұрын
for the team colours, they're the ones you can do with § and text, like §2 → dark green in book and quills
@thomasmcdermott57235 ай бұрын
Love the content as always Gneiss. Nice lizard video!
@StCost5 ай бұрын
That day I feel like using specific format I didn't forgot yet. As long as it works
@alysoffoxdale5 ай бұрын
Flippy tail! What a cutie! Meanwhile, I'mma guess what's up with the different color schemes is too many different programmers being too fond of their own coding preferences to match up with any existing scheme.
@jursamaj5 ай бұрын
And nobody reviewing their work and *insisting* on a standard.
@Stettafire5 ай бұрын
Nah, more like working with a legacy code base is a nightmare and there is always a time crunch
@alysoffoxdale5 ай бұрын
@@Stettafire Those points are _always_ salient factors, yes!
@Adowrath5 ай бұрын
One thing I can chime in with: The reason wool colors are limited to 16 is because that's what the original metadata system supported: 1 nibble, aka. 4 bits, aka. 16 variants per block. An idea I have why the text chat colors are usually limited to 16 as well (though I don't know why they chose different ones) is that they can (though not in-game) be written by prefixing with §x, with x ranging from 0-f. Again, they probably chose 16 to overlap with a hexadecimal integer, and so they could use separate ones like §r to reset, and l-o for bold/strikethrough/underline/italics (and §k for garbled text).
@miroaja19515 ай бұрын
I believe you can use the named colors in any text color component like item lore, name and the tellraw command
@dianacruzpestana51193 ай бұрын
The particle colors are just the Color Graphics Adapter (CGA) 16-color pallete, but with different names. The weird color format you mentioned is used inside OpenGL, which minecraft uses to render things.
@kras_gk5 ай бұрын
dude you are amazing!! I have been trying to learn about the color perception on YT, but you are the most useful and clear! I wish i knew to add "minecraft" to my search request earlier haha xDD
@Mulakulu5 ай бұрын
I wish it was all ARGB and either the 16 team colors or the 16 dyes and you would be able to choose based on how exact you want to specify the color. Like if youre coloring a team or a bossbar, you can just use "aqua", but you could also use [1,0,0.6,0.8]. Maybe having the A in ARGB only be applicable with stuff that can be transparent. This would be 4 systems rather than 6, and you would be able to pick and choose which you feel like using
@sirati97705 ай бұрын
i think one reason is that in memory these numbers are indeed just one number, when they write the command they need to set setting for each argument on how that be processed from the human input into the internal state. the default for that is decimal numbers, so they just forgot to set that those arguments should be hex in the command. as for items they do not have a special way to say that a property is to be interpreted/displayed differently when interacting with the human, at least that was true in the old nbt way or storing things before tags. so for item those properties are just you setting the nbt manually and because it just knows this has to be a number the architecture does not allow to ask for that number in hex.
@sirati97705 ай бұрын
the 16 colours for formatting text in older versions as well as the team colours correspond to the 16 colours available in ansi terminals (and old standard for displaying coloured text on computers were having more than 16 colours would still overwork the cpu and gpu) in may-june 2009 when notch added coloured text messages and coloured wool for the first time, he just coded those 16 colours into the code. the colour for wools was only changed in 1.2 when notch decided to add dyes to the game and especially choco beans as one of the colours. so far no brown existed
@sinom5 ай бұрын
The two taking ints looks like an oversight. In java and other langauges you can usually specify ints in a hex format, and the compiler than converts them to normal ints automatically. So maybe there you can use 0xFFFFFF or 0xFFFFFFFF for those instead of the signed integers?
@atpstorages69172 ай бұрын
Compiler doesn’t run at runtime. Converting hexadecimal to packed integers uses Integer.parseInt(x, 16), which then needs to be converted to 4 floats for rendering (usually the latter part is abstracted away.)
@Gandhi_Physique5 ай бұрын
Cool lizard, and also cool flies too actually. I hate flies, but I like how the iridescent ones look.
@spcraftsman26565 ай бұрын
Some parts of minecraft code really feels like the implementation teams don't have a consistent style guide within them
@palker5 ай бұрын
When I read through minecraft code, classes of different blocks and items with their own logic, I often think: "what psycho wrote this?"
@LoganDark43575 ай бұрын
It's a historical artifact: - wool colors and names came first - then section-sign formatting (the ancestor of the color names) which didn't reuse the wool colors (at this point the colors were not named, they were only accessible by /§[0-9a-f]/) - leather armor which needed RGB, so used that - eventually "text components" were made a thing in I think 1.16 which introduced hex *strings* (as opposed to hex values) - particles aren't text so don't use that etc. some other stuff can be inferred from here but basically it's legacy stuff.
@TheLoosestOfGooses5 ай бұрын
OHH I did not know you could stack colors on leather armor... thats really interesting
@SkedgyEdgy4 ай бұрын
-- the 16 text colors in minecraft are legit based off of the CGA text mode color pallet, down to the color codes, just with gold being changed to a different shade
@MayorOfLuckyBoyNV5 ай бұрын
You say that but they refuse to add painted wood planks
@seandorr75645 ай бұрын
I love every single one of your videos. Thank you for all the hard work and love put into them!!
@radar125645 ай бұрын
I love Gneiss so much. I’d honestly LOVE to see a “Geology of Chicago” video at some point if that’s in your wheelhouse!
@wolfieeeee2565 ай бұрын
The 16 colours correspond with the 16 colours available in the Windows command prompt. I suspect it goes back much further than this, but it seems common to support these 16 colour names when not supporting any custom colours.
@AB-Prince2 ай бұрын
for the color words, they correspond to the 16 colors of CGA or more broadly the RGBI format.
@JackDaniels-ex9mf5 ай бұрын
Theres a fundamental thing to understand about the gaming industry. Very, very few peopl stay in the same position for more than a year, job hopping is extremely common changing roles and companies very frequently especially in big companies because it often includes pay raises. So every time content is added to these games different people with different backgrounds are solving the problems, and all have different solutions. If the same people were to have made each of these color formats they would likely be more in line with eachother, but they were designed completely independent of eachother
@DqwertyC5 ай бұрын
It can't be done with commands, but there's also the beacon color, which is recolored with dyed stained glass, and different colors can be stacked. I'd assume it has a similar gamut to leather, but I don't really have any evidence to back that up.
@boyboiling5 ай бұрын
the leather armor dyeing system has always been so so cool to me ily dyed leather armor
@Im_actually_a.shark_5 ай бұрын
Lmao same
@jerrolkay46285 ай бұрын
At 2:11 I think it should have been noted that you don't need to put the dye on a piece of armor one craft at a time. For example, instead of dyeing the helmet red then combining the red helmet with orange dye to get the red-orange helmet you can put the red and orange dye in the crafting grid with the plain helmet and it will output the red-orange helmet.
@MithicSpirit4 ай бұрын
The RGB format for leather armor is technically the same as that for the text display background. The lack of 2's complement is because it doesn't get large enough to reach a point where that matters (the alpha bits are always 0, so the sign bit can never be set).
@Zero-47935 ай бұрын
100% agree with this. i noticed this (or got angry at it) when i tried to summon leather. other than that ive really only had to deal with the old dust particle system
@NotKnafo5 ай бұрын
didnt talked about custom potion color which uses a similar format to leather armor color
@Grafii21983 ай бұрын
Somebody probably got it answered but I assume it is either 2 things (or maybe mix of both): 1. is that some types are more efficient to store in different places, like I would assume storing 1 value is more efficient than storing 4 values; 2. From my limited knowledge of modding, I assume some methods require specific format, they probably use different methods for different things which makes sense and therefore as they probably need a different format for whatever the reason (iirc usually shaders require series of RBG represented with 0-1 floats, but different things may require different format) and as such to simplify the code so that it doesn't need to recalculate different formats, the input is made in that format already, there is no 1 specific unified format that it would be then translated to as it for them seems redundant, after all the fact that we can manipulate these things is just an addition, for them their code is top priority
@soninhodev78515 ай бұрын
if you were wondering, yes, there are default named colors in the JAVA programming language, i did not know the count though.
@aabb-nx9ij5 ай бұрын
There is also another color format for books which uses the paragraph symbol (§) and has the same values as glowing, but is inputed differently (§0 for black, §a for green, §c for red, etc, ill try to reply with a link but youtube might hide it).
@aabb-nx9ij5 ай бұрын
youtube hides the comment with link :( you can google "minecraft book color codes"
@sebastiangrau84095 ай бұрын
It would be interesting to learn just what the leather armor color mixing mechanic actually does to determine which colors are obtainable and what is the optimal way to reach a certain color code using the fewest number of steps or least dyes.
@Paint_The_Future5 ай бұрын
Seven. There are SEVEN. The one you are missing is the stupidest one, and it's one I personally discovered. You won't find this in any change log! 8 years ago, I was messing around with the note particle effect 🎶 and discovered something odd. By messing around with the dx, dy and dz numbers, you could change the colour of the note. I could change it from default green to... a slightly lighter shade of green? But why? And how? This wasn't entirely unheard of. In 2024, changes were made to the particle command so you could more-intuitively summon dust and effect particles with a specific colour, but before that change, you had to use dx, dy and dz because they were like R G B. But NOT for note particles, something different was happening... something much dumber. Through some testing, I discovered exactly how it worked: It's only taking into consideration the dx value; dy and dz don't contribute to the colour changing. That makes things simpler I guess. But how do you fit the whole spectrum of note particle colours on one value? Well, imagine tuning a note block in Minecraft. You imagine those particles shifting in colour as the note gets higher, right? Imagine the first note has a value of 0, the last note has a value of 1, and the rest of the notes are equal intervals in-between 0 and 1. Do you want that deep indigo note that you get when you tune a note block exactly 14 times? Well, the dx value you should use is 14/24 (you tune a note block 24 times before it resets), or to put it in decimal because you'll have to type this into a command, that's 0.583. From 0 to 1, the colour shifts from green, to yellow, to orange, to magenta, to purple, to indigo, to cyan, to teal and back to green. Just like when you tune a note block in Minecraft. Intuitive, right?? I actually don't fault them for this, I'm not even sure this was an intended feature. Maybe a weird by-product of how they coded note particles. 8 years ago I made a post on Reddit about it titled "Image Tutorial: How to create particles of a specfic colour, including note particles, which was previously thought to be impossible." In the tutorial I use a table, which mis-labels which colours you'll get because at the time there was a bug where some note particles where weirdly greyish, but that was fixed 5 years ago. Give it a read! Final fun fact: If your dx value is 32768 or higher, the note particle will be black, which never appears in the game under normal circumstances. Fun!
@gneissname5 ай бұрын
This is great. such an odd thing that probably made sense when the programmer was working on it. I'll have to check it out.
@Swagpion5 ай бұрын
3:16 last time I checked, you can mix the dyes for WAY more possibilities. Granted some colors would still be inpossible, but still.
@PercyPanleo5 ай бұрын
With the team glow colors, that is the standard color set used in Linux and Unix terminals, so it probably is part of Java itself
@musclechicken90365 ай бұрын
I was really happy that I got to see the little bonus at the end of the video (:
@baccocraft5 ай бұрын
Yeah, this is super annoying and I kept noticing it when i was developing my colour picker mod. Another weird colour format you didn't mention is map_colour. It changes the colour of the scribbles on the filled_map texture. It uses hex value converted to decimal, like leather armour. But, the command syntax is different for some reason. For armour its: dyed_color={rgb:16711680} For maps its: map_color=16711680