08 Feb, 2009, quixadhal wrote in the 1st comment:
Votes: 0
As a teaser for this week's meeting, here's my condensed summary of what the popular Lope's colour codes are. See if you can spot the point of inconsistency, and also, tell me what pretty-much essential part is missing!

COLOR CODES:

{b blue
{c cyan
{g green
{m magenta
{r red
{w white
{y yellow
{B hi-blue
{C hi-cyan
{G hi-green
{M hi-magenta
{R hi-red
{W hi-white
{Y hi-yellow
{D grey (bright black)
{* bell
{/ CRLF
{- ~
{{ {

answer (bright yellow) {f
answer_text (bright white) {F
auction (bright yellow) {a
auction_text (bright white) {A
fight_death (red) {1
fight_ohit (yellow) {3
fight_skill (white) {5
fight_thit (red) {4
fight_yhit (green) {2
gossip (magenta) {d
gossip_text (bright magenta) {9
gtell_text (green) {n
gtell_type (red) {N
immtalk_text (cyan) {i
immtalk_type (yellow) {I
info (yellow) {j
music (red) {e
music_text (bright red) {E
prompt (cyan) {p
question (bright yellow) {q
question_text (bright white) {Q
quote (green) {h
quote_text (bright green) {H
reply (green) {l
reply_text (bright green) {L
room_exits (green) {o
room_text (white) {S
room_things (cyan) {O
room_title (cyan) {s
say (green) {6
say_text (bright green) {7
tell (green) {k
tell_text (bright green) {K
text (white) {t
wiznet (green) {B
09 Feb, 2009, quixadhal wrote in the 2nd comment:
Votes: 0
No takers, eh?

I'll give you a hint… wiznet isn't Miles Davis, and can't be Blue in Green.
09 Feb, 2009, David Haley wrote in the 3rd comment:
Votes: 0
What, the inconsistency is that wiznet is color code {B, even though it's green, and b/B are both blue?
09 Feb, 2009, quixadhal wrote in the 4th comment:
Votes: 0
Actually, b is blue, B is bright blue. :)

But yes, since wiznet is also bright blue, if you use {B to specify "wiznet" colour, and then you set your colour preference to something else (like the default green), well… you get bright blue. Unless, of course, the actual code checks the channels first, in which case you can never specify bright blue at all.

Also, there's no reset code to turn whatever colour you set off. Usually a pretty handy thing to have, especially when the user disconnects so their screen isn't some funky colour in their shell.

It's kindof weird though…. I mean, if wiznet was added later, they should have known B was already taken. If it was that way at the start… why B? w.i.z.n.e.t – no b's there… I'd say they liked blue, but then why make the default wiznet colour green?
09 Feb, 2009, kaervos wrote in the 5th comment:
Votes: 0
Nice catch. I'm surprised it hasn't come up before.

My biggest beef with Lope's code is that he chose a left brace as the escape character, and then put them ALL over in the patch. If you wanted to replace it with something else, you'd have to do a painful manual replace. I modified the patch a while ago and replaced the left brace with the ` character. This way a search and replace if you didn't like the character is easy.
09 Feb, 2009, David Haley wrote in the 6th comment:
Votes: 0
There is some irony in complaining about a hard-coded character and fixing it by using another hard-coded character :wink:

A nice feature in C/C++ is that string literals concatenate naturally…

#define COLOR_CODE "`"
const char* color = COLOR_CODE "B"


color will be the string literal "`B".
09 Feb, 2009, quixadhal wrote in the 7th comment:
Votes: 0
DavidHaley said:
A nice feature in C/C++ is that string literals concatenate naturally…

#define COLOR_CODE "`"
const char* color = COLOR_CODE "B"


color will be the string literal "`B".


Actually, I'm not sure if that was part of C92, or C99, but it wasn't true in Ye Olde K&R days. Being a dinosaur, I was rather surprised the first time I saw it used (and pleased too!).

const char * foo = "This actually does work\r\n"
"So you can avoid having to stick annoying \\'s\r\n"
"At the end of every line!\r\n";


Oh, and I hate using `, almost as much as I hate using {. As a perl programmer AND a bash script writer, ` has too much meaning to use as an escape symbol. However, that topic was beaten to death with many dead horse legs in one of the first RaM meetings, where (almost!) everyone agreed we wanted colour, but nobody would agree on what bloody escape character we should use.

Point in fact, we are using { because Lope's *IS* the defacto standard colour system used amongst ROM muds. If we were building something from Smaug, we'd be using &. If we were using an LpMUD, we'd probably be using Pinkfish codes (^%).

I have an idea I'll be trying out that would make it easy to replace the default symbols, but the default will be {.
09 Feb, 2009, David Haley wrote in the 8th comment:
Votes: 0
quixadhal said:
Actually, I'm not sure if that was part of C92, or C99, but it wasn't true in Ye Olde K&R days

Well, it's ANSI C at least.

$ cat test.c

#include <stdlib.h>
#include <stdio.h>

int main()
{
const char* txt = "Hello ""world!""\n";
printf(txt);
return 0;
}

$ gcc -ansi -Wall –pedantic test.c
$ ./a.out
Hello world!
$
09 Feb, 2009, Guest wrote in the 9th comment:
Votes: 0
Yes, the decision to use & as a color escape seems a lot more annoying to me than using { - but that's not the half of it as Smaug uses more than one escape character depending on what you want the color to actually do. & is for normal stuff, ^ is for background color, and { was added in FUSS for blinking color :)
09 Feb, 2009, Sandi wrote in the 10th comment:
Votes: 0
quixadhal said:
Oh, and I hate using `, almost as much as I hate using {. As a perl programmer AND a bash script writer, ` has too much meaning to use as an escape symbol. However, that topic was beaten to death with many dead horse legs in one of the first RaM meetings, where (almost!) everyone agreed we wanted colour, but nobody would agree on what bloody escape character we should use.

Point in fact, we are using { because Lope's *IS* the defacto standard colour system used amongst ROM muds. If we were building something from Smaug, we'd be using &. If we were using an LpMUD, we'd probably be using Pinkfish codes (^%).

I have an idea I'll be trying out that would make it easy to replace the default symbols, but the default will be {.


As I recall, several of us were in agreement, we just didn't agree with you. :wink:

Are you are planning on embedding Perl in ROM, or do I misunderstand your concerns with ` ?

{ is not part of ROM. The native escape in ROM is $. As long as you think of it as a 'color code', your implementation will be severely limited, just like Lope's.
09 Feb, 2009, quixadhal wrote in the 11th comment:
Votes: 0
Sandi said:
As I recall, several of us were in agreement, we just didn't agree with you. :wink:

Trivial details… *waves hands*

Heh, I do recall we had a couple of points where we agreed things, and then something else brought up the argument again and resulted in a different agreement.

However, my solution (when I get around to finishing it) should make it fairly easy to change your mind. :)

Sandi said:
Are you are planning on embedding Perl in ROM, or do I misunderstand your concerns with ` ?

{ is not part of ROM. The native escape in ROM is $. As long as you think of it as a 'color code', your implementation will be severely limited, just like Lope's.


Nope, just that if you embed any colour codes in strings, "foo`rbar" and "foo{rbar" are equally annoying to many editor syntax highlighting schemes. "boo says '`rfoo!`bfoo!`gfoo!'" is mildly more annoying than "boo says '{rfoo!{bfoo!{gfoo!'" to my eyes.
10 Feb, 2009, Tyche wrote in the 12th comment:
Votes: 0
Sandi said:
{ is not part of ROM. The native escape in ROM is $. As long as you think of it as a 'color code', your implementation will be severely limited, just like Lope's.


A compelling argument on the face of it. What's the intersection with existing escape codes?
One should also rid ROM of the tilde restriction and allow escaping it with $~.
10 Feb, 2009, Sandi wrote in the 13th comment:
Votes: 0
You have no idea how much I tremble at the prospect of answering you, Tyche, but I'm sure you'd be tickled pink. I just don't have your theory, and I'm sure I'll say something wrong, and of course, you won't let it pass. I wish I could read books. It's a real shame, but I do my best with what I've got. :redface:

I think the intersection would be the ability to put color codes in 'acts' along with the existing pronoun and name substitutions. Or rather, you might look at it as the ability to put name substitutions in any of the text strings,including descriptions. Natch, you know where this is coming from.
10 Feb, 2009, quixadhal wrote in the 14th comment:
Votes: 0
You can say what you want, but if Lopes system isn't considered the "standard" for ROM based MUDs, why are there sooooo many out there which make it the first thing they add in? It boils down to a simple question.

Do you want to code a colour system that works the way, historically, the community expects it to work? Or, do you want to invent a new system that works "better"?

I would argue that people who have worked on ROM derived codebases that have colour are probably going to expect Lope's { style colour codes. That is, for better or worse, part of the community's sense of the feel of ROM. Is that worth preserving, or is it something best replaced by a newer idea?

$ isn't actually any kind of standard escape… it's the escape for the act() subsystem from DikuMUD. The act codes serve a different purpose than colour codes, and are far more situational. $o in a room description, for example, means nothing. In the description of an ACTion though, it gets replaced by the object name. If we merged the colour codes into the same system (not entirely without merit), it would be confusing for new builders which letters belonged to which kind of functionality.

The tilde problem is another issue entirely, and that's a weird artifact of fread_string and/or fread_eol.

One of the things I did in the Smaug code, when I rewrote part of its colour system, was to add a full tagging system. You can still use the standard one-letter codes, but I also added a string based lookup via &[word]. The idea was, instead of having to specify "red" or "blue" you could say "elven" or "shout" and if there was a colour mapping for that named thing, those codes got used.

Lope's code attempts this, but is crippled by still using a single character, so {B is supposed to mean "whatever colour the user set wiznet stuff to show up in", even though B is not helpful for recognizing that it's wiznet (and in fact, overlaps with the code for bright blue).
10 Feb, 2009, Scandum wrote in the 15th comment:
Votes: 0
quixadhal said:
See if you can spot the point of inconsistency, and also, tell me what pretty-much essential part is missing!


256 color support is missing. Black is incorrectly named Dark. {d is missing.
10 Feb, 2009, quixadhal wrote in the 16th comment:
Votes: 0
Scandum said:
quixadhal said:
See if you can spot the point of inconsistency, and also, tell me what pretty-much essential part is missing!


256 color support is missing. Black is incorrectly named Dark. {d is missing.


I'm still waiting on a reasonable 256 colour terminal emulator, so I'll pass on that one. {d is actually "gossip", which defaults to magenta. There is no black, Lope couldn't see black so it's not a colour. :)
10 Feb, 2009, David Haley wrote in the 17th comment:
Votes: 0
gnome-terminal does just fine with 256 colors :wink: The difference it makes is actually very considerable, e.g. when doing things like syntax highlighting.
10 Feb, 2009, Hades_Kane wrote in the 18th comment:
Votes: 0
Is it possible to actually code in black as a color?

I know that would make the text it was used in essentially invisible, but I could think of some neat quest or area hidden type of applications for it.
10 Feb, 2009, Hades_Kane wrote in the 19th comment:
Votes: 0
On second thought, people would probably just change their client to make black show up a different color…

If there was some way to force their foreground text with a particular color code to show up as the same color as their currently set background, that'd be neat, but yeah, I think any applications for black text could easily be gotten around with a mod in their client.
10 Feb, 2009, David Haley wrote in the 20th comment:
Votes: 0
What is the point of sending text that the person can't see?
0.0/80