This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
notgodsarmy666's profile picture

[1.4/next version] colored output

Started by notgodsarmy666, 13 March 2012 - 10:20 PM
notgodsarmy666 #1
Posted 13 March 2012 - 11:20 PM
would be neat to change the text-color on the fly.
within the mod (with a program) for each letter…
pieiscool32 #2
Posted 13 March 2012 - 11:23 PM
The program needed might take a while to code, also as far as i know there is no colored text. Also the colored text might cause more lag, because it needs more processing power to run multiple colors.
Neowulf #3
Posted 14 March 2012 - 03:06 AM
Nah, shouldn't take much processing to give the option for 16 colors (4bit color palette).
A full 8bit color range would probably spawn entire servers of ascii movie theaters.
kamnxt #4
Posted 25 March 2012 - 03:00 PM
Maybe you could choose one color for the text and one for the background?
Xfel #5
Posted 25 March 2012 - 03:47 PM
One wouldn't need to send the color which each letter processed. It would be enough if you could call "term.background = color.red", and everything written afterwords has red background. If the colors were limited to the 16 default minecraft colors, transferring foreground and background would only need one byte.
Casper7526 #6
Posted 25 March 2012 - 04:35 PM
We've had color before it might come back eventually, it was using the minecraft color pallette, but it caused issues with functions in lua itself. However, the biggest fact about color changing is the same thing with graphics. The "asshole" factor.


Lets take Xfel's idea… and use term.color = red (something like that affect)

Then, everything after that is colored red (therefor you only needed to send a small amount of extra data cause you just changed the color.

Well this where the asshole factor comes in when users are given "pretty things"

text = "Hello World"
while true do
term.clear()
term.setCursorPos(1,1)
	 for x = 1, text:len() do
	 term.color = math.random(1,16)
	 write (text:sub(x,x))
	 end
end

Your now sending twice as much data as before for the same amount of text.

Now, this really isn't "too" bad for colors, but it REALLY prevents graphics like people want. Cause imagine if someone used the same setup, but decided to try each PIXEL as a different color.

So all in all, i would say we can expect text foreground coloring in the future, after the issues with lua functions can be resolved, but I don't believe it's a "high" priority item atm.
Liraal #7
Posted 25 March 2012 - 05:01 PM
An idea: make the color change client-side only. So a term.color ran on the computer triggered by one clients alters the color of only one client terminal.
Sebra #8
Posted 25 March 2012 - 05:08 PM
bad idea
grinchfox #9
Posted 25 March 2012 - 05:32 PM
Guys is it too hard to send additional 8 bit of color data ? (i mean make terminal use 16 colors) Its not too laggy, look how its done in wiremod's console screen in garrysmod, it was done on lua and its not too laggy for network (only in good usage).
Xfel #10
Posted 26 March 2012 - 09:12 AM
Do you know Remote Desktop Connection? This windows function transmits a whole Computer Screen through the network. And i didn't experience performance problems with it. And that is much more data to be transmitted.
Casper7526 #11
Posted 26 March 2012 - 10:25 AM
Now try sharing your remote desktop connection to 20 people at once, see how well you do :o/>/>

I'm not saying that "when used correctly" it's too much data. I'm saying the "asshole" factor causes this to become a problem.
Amunak #12
Posted 27 June 2012 - 12:00 AM
Now try sharing your remote desktop connection to 20 people at once, see how well you do :P/>/>

I'm not saying that "when used correctly" it's too much data. I'm saying the "asshole" factor causes this to become a problem.

Everything has poor performance if it's written by an asshole :)/>/> - no reason to not implement colors
Xfel #13
Posted 27 June 2012 - 07:04 PM
Just for your information: in java, a character has TWO of space, but the cc monitor can only display ascii characters, which are only ONE BYTE long. even though minecraft uses utf-encoding to transmit network data, it still means that in half of the cases even a normal ONE-BYTE character needs TWO BYTES. As far as I see, there is one byte that could be used otherwise. Like for colors.
MysticT #14
Posted 27 June 2012 - 07:33 PM
Just for your information: in java, a character has TWO of space, but the cc monitor can only display ascii characters, which are only ONE BYTE long. even though minecraft uses utf-encoding to transmit network data, it still means that in half of the cases even a normal ONE-BYTE character needs TWO BYTES. As far as I see, there is one byte that could be used otherwise. Like for colors.
Yes, I think someone suggested this before, and it seems a good way to do it. It's pretty efficient, since it uses space that is wasted now.
Let's hope dan adds this :P/>/>
D3matt #15
Posted 29 June 2012 - 01:30 AM
The people saying adding an additional ONE BYTE per character will cause servers to lag into the ground make me laugh.
Cloudy #16
Posted 29 June 2012 - 08:25 AM
Agreed. It isn't about network space concerns why it isn't implemented. We will all have to wait and see, but there are no plans to add colours right now.