L* R*
HOME FORUM DOWNLOADS
Content
  Links
     Browse SVN
     SVN Commit log
     Documentation (Wiki)
  Developers
     Taskmanager
User
Welcome, Guest. Please login or register.
Did you miss your activation email?
December 01, 2008, 01:50:31 PM

Login with username, password and session length
Search



Advanced search
Support GoPHP5.org
BeBot - An Anarchy Online/Age Of Conan chat automaton > Forum > Development > Coding and development discussion > Topic: Standardizing colors using the colors module
Pages: [1] 2 3   Go Down
« previous next »
Print
Author Topic: Standardizing colors using the colors module  (Read 1698 times)
0 Members and 1 Guest are viewing this topic.
Blueeagle
Omnipotent
BeBot Developer
Expert
********
Offline Offline

Gender: Male
Posts: 313



Standardizing colors using the colors module
« on: March 05, 2007, 05:04:54 PM »

I am liking the colors module very much even though I misunderstood its purpous a bit in the start.

What I am really missing is a "bot" color scheme with colors for stuff that the bot outputs. This would make for easier themeing of the bot imo as a person wanting a color for a nickname in one module most likely wants it in another module aswell.

I propose we make a predefined set of colors such as

* bot_nickname (default color of nickname)
* bot_level (default color for text containing the level of a toon)
* bot_ai_level
* bot_ai_rank
* bot_firstname
* bot_lastname
* bot_breed
* bot_gender
* bot_profession
* bot_guild_name
* bot_guild_rank

* bot_guild_text (default color for text sendt to GC)
* bot_tell_text (for tells)
* bot_tell2_text (for tells to people not member of the bot)
* bot_privgroup_text
* bot_gmsg_text
* bot_window_text (for the info windows)

* bot_omni (next three would be useful with whois and tower attacks)
* bot_clan
* bot_neutral

Please add to the list with colors you think we need to standardize the modules.


An alternative would be to check if a color has been defined for that module and for that text type (ie nickname) and use that. If such a color doesn't exist look in the default bot scheme and use that. That way end users could define colors separately for all modules and still have sensible (question of definition I know) defaults for others. They can also alter the default colors and have that reflected in all modules. This would however require some reworking of the colors module methinks.

Thoughts and ideas are welcome

- Blueeagl3
Logged

The only problem that can't be solved by adding another wrapper is having too many wrappers.
Alreadythere
BeBot Maintainer
Administrator
Grandmaster
********
Offline Offline

Posts: 1085


Re: Standardizing colors using the colors module
« Reply #1 on: March 05, 2007, 05:42:23 PM »

I've though about an extension of the basic color and scheme model.

One thing that I'm missing is that there is no way to define defaults (like your bot_* colors) that can be used in schemes, but aren't defined as pure colors.

Basically something like using schemes in scheme definitions. Basically that's possible, but you'd have to be extremely careful not to run into long circles.

To solve the circle problem while giving more flexibility I though about adding another layer between pure colors and pure schemes, something that can be used in schemes but still be fairly easy edited - with a change then being carried over to all schemes referring to it. I think the AO scheme Glara added as well as some of the global and most of the colors proposed by Blueeagle would end in there.

I'll try to add something like this to the colors and colorchange modules tomorrow.
Logged
Glarawyn
BeBot Developer
Champion
********
Offline Offline

Posts: 414



Re: Standardizing colors using the colors module
« Reply #2 on: March 05, 2007, 06:35:50 PM »

Are we adding too much complexity? Cheesy

My initial thinking on this module was to define a number of elements ie:

##tell_out##, ##headline##, ##infotext##, ##warning##, etc.

Then set a theme for the bot. ie: theme == bebot default. New themes could be easily defined in XML, txt, whatever as it would be ##element## => hex code.

Then if the end user changes the theme, all the color output would change to the selected theme.

Example color theme, where default is error messages are red.
Code:
<xml>
<theme>
<name>BeBot Default</name>
<element>
<name>error</name>
<description>Color for Error Messages.</description>
<htmlcc>#FF0000</htmlcc>
</element>
</theme>
</xml>

So maybe Glarawyn decides that error messages should be yellow. Glarawyn would create a new theme:
Code:
<xml>
<theme>
<name>Glarawyn</name>
<element>
<name>error</name>
<description>Color for Error Messages.</description>
<htmlcc>#FFFF00</htmlcc>
</element>
</theme>
</xml>

The actual output code would be:
Code:
$this -> bot -> send_tell($name, "##error##You are an idiot.##end##");

but the output color would change depending on which theme is in use.

Make sense? Maybe...? Whatever... Cheesy
Logged
Vhab
BeBot Contributor
Experienced
*******
Offline Offline

Posts: 158


WWW
Re: Standardizing colors using the colors module
« Reply #3 on: March 06, 2007, 01:08:12 AM »

About the xml structure, try not to nest elements without really needing it, just makes parsing a hassle Tongue (I'll remember to post my xml parser later if we end up using xml for stuff)
So assuming there's only 1 <theme> in each file, we can lose the outer <xml>.
And maybe for the ease of editing, use attributes rather than elements
<element name="error" htmlcc="##557799" description="Color for WTFUSUX messages">
Logged
Alreadythere
BeBot Maintainer
Administrator
Grandmaster
********
Offline Offline

Posts: 1085


Re: Standardizing colors using the colors module
« Reply #4 on: March 06, 2007, 06:02:08 AM »

My idea is similar to yours Glara - I want to add a layer between pure colors (which aren't supposed to change right now) and the schemes (which always refer to a color, the color can be selected and changed among all existing colors).

That layer should be something that refers to a color like a scheme, but can be refered too by schemes too like a color. A bunch of basic and global aliases.

My idea was to keep it in the db, with an interface in the bot.
Logged
Vhab
BeBot Contributor
Experienced
*******
Offline Offline

Posts: 158


WWW
Re: Standardizing colors using the colors module
« Reply #5 on: March 06, 2007, 06:18:23 AM »

XML files with themes wouldn't be bad at all really.
If each theme would be a seperate file, people could easiely exchange color themes and we can ship a bunch of themes with the releases without hardcoding queries in the source.
Logged
Glarawyn
BeBot Developer
Champion
********
Offline Offline

Posts: 414



Re: Standardizing colors using the colors module
« Reply #6 on: March 06, 2007, 11:01:28 AM »

Quote from: Vhab on March 06, 2007, 01:08:12 AM
About the xml structure, try not to nest elements without really needing it, just makes parsing a hassle Tongue

The source of that XML is my butt, so by no means does it have to be in that format. It was just an example. Wink
Logged
Vhab
BeBot Contributor
Experienced
*******
Offline Offline

Posts: 158


WWW
Re: Standardizing colors using the colors module
« Reply #7 on: March 06, 2007, 11:45:30 AM »

Quote from: Glarawyn on March 06, 2007, 11:01:28 AM
Quote from: Vhab on March 06, 2007, 01:08:12 AM
About the xml structure, try not to nest elements without really needing it, just makes parsing a hassle Tongue

The source of that XML is my butt, so by no means does it have to be in that format. It was just an example. Wink
Better safe than sorry. always a hassle to edit something after it was implemented Tongue

on the main topic, I think that set of colors is a tad too much.
for example, for vhabot I use 3 different colors + base colors (orange/blue/red/green/etc).
the first 3 colors are configurable and the rest are static colors.
the colors are called header, highlight and normal.

imo, the key to getting standardized colors to use only a strictly defined set of 3 or 4 colors.
« Last Edit: March 06, 2007, 11:52:04 AM by Vhab » Logged
Alreadythere
BeBot Maintainer
Administrator
Grandmaster
********
Offline Offline

Posts: 1085


Re: Standardizing colors using the colors module
« Reply #8 on: March 06, 2007, 11:57:42 AM »

I don't mind offering some way to read and write themes to xml files for easy distribution.

I think that themes should be written to some table too though, so the bot got easy and fast access to them.

The interface could be some bot commands or some simple scripts which parse the xml files or creates them if wished.
Logged
Vhab
BeBot Contributor
Experienced
*******
Offline Offline

Posts: 158


WWW
Re: Standardizing colors using the colors module
« Reply #9 on: March 06, 2007, 12:17:06 PM »

you'd only read the xml once imo.
read the xml and cache the results. when a different theme is selected from the interface it loads that xml and caches it.
if you make the xml files editable from ingame, you write the files and update the cache.
imo, keeping a few variables > doing a query every time to fetch colors.
Logged
Blueeagle
Omnipotent
BeBot Developer
Expert
********
Offline Offline

Gender: Male
Posts: 313



Re: Standardizing colors using the colors module
« Reply #10 on: March 06, 2007, 05:20:31 PM »

Quote from: Vhab on March 06, 2007, 11:45:30 AM

imo, the key to getting standardized colors to use only a strictly defined set of 3 or 4 colors.


Actually that might be a much better approach. Because too much configurability might make the whole feature worthless.

Perhaps reducing the list of colors would be the way to go?

Also the base colors need not be strict strict. Ie if someone wants a blue-ish theme they can chage ##red## to something more like purple to keep in with the theme (that is defining ##red## to be #FF8000 (orange) using for example xml or in-game commands)

That would make the default list:

Code:
//Primary colors:
red -> #FF0000
green -> #00FF00
blue -> #0000FF

//Secondary colors
yellow -> #FFFF00
magenta -> #FF00FF
cyan -> #00FFFF

//Contrasts
black -> #000000
white -> #FFFFFF

//Definable colors
heading -> #??????
highlight -> #??????
normal -> #??????

That still leaves us with the question of which color goes where. Take fore example the !whois reply. Should we only use normal + highlight + green (for ai-level) here?

And we should have a list to keep the use of anything but normal, highlight and header (which use should be quite apperant) standardized thruought the script. (ie all errors are ##red##.

Now the question is this: Would it be possible to make "##red##You need to have access level ##highlight##ADMIN##end## or higher to access this command##end##" show as a red-ish highlight not identical to for example "##normal##Relay was turned ##highlight##OFF##end## by ##highlight##Blueeagle##end####end##" in which case the two highlights would be lighter versions of what ever ##normal## would be. Ie. ##highlight## takes the current color and brightens it.
I am not sure how that would be implemented since you'd have to keep a table in the output functions that sais which color you're currently using. It might even be "a bad idea"(tm) to attempt, but methinks it would be cool. :p

Also drabing down the primaries might be a good idea as bright green is just plain ugly imho. But that's something for the default theme.xml if such a thing is made.

Blueeagle
Logged

The only problem that can't be solved by adding another wrapper is having too many wrappers.
Blueeagle
Omnipotent
BeBot Developer
Expert
********
Offline Offline

Gender: Male
Posts: 313



Re: Standardizing colors using the colors module
« Reply #11 on: March 06, 2007, 08:29:35 PM »

I just had quite the eureka moment here. It actually got me out of bed just to type this.

Why don't
$this -> bot -> send_tell($target, $msg);
automagically set $msg = "##normal##".$msg."</font>"
and that all colors (ie. ##red##) go from being translated as '<font color="#FF0000">'
to being translated as  '</font><font color="#FF0000">'.

And that ##end## gets translated into '</font><font color="$normalcolor">'.

That way the line:
##highlight##You ##end####normal##turned relay ##end####highlight##OFF##end##
could be written as
##highlight##You ##end##turned relay ##highlight##OFF

The first would be translated into
<font color="$highlight">You </font><font color="$normal">turned relay </font><font color="$highlight">OFF</font>

While the second would be translated into
<font color="$normal"></font><font color="$highlight">You </font><font color="$normal">turned relay </font><font color="$highlight">OFF</font>

Now checking if a line starts with a color code should be quite easy and then removing the first (now empty) <font> tag-pair and leaving exactly the same output for both inputs.

That would be a lot less color codes in the strings and thus making them much easier to read (and write).

This should be quite doable with minor changes to the current color module methinks.

Any thoughts?

Logged

The only problem that can't be solved by adding another wrapper is having too many wrappers.
Alreadythere
BeBot Maintainer
Administrator
Grandmaster
********
Offline Offline

Posts: 1085


Re: Standardizing colors using the colors module
« Reply #12 on: March 07, 2007, 07:10:44 AM »

I don't see any point in reducing the amount of available colors in the colors table (and predefined in the module). Especially if themes are going to use those color definitions.

Right now the send_gc, send_pgroup and send_tell functions already colorize the output. Only small bug is that pgroup and gc use the same scheme right now, should perhaps be seperated into two.

Quote from: Vhab on March 06, 2007, 12:17:06 PM
you'd only read the xml once imo.
read the xml and cache the results. when a different theme is selected from the interface it loads that xml and caches it.
if you make the xml files editable from ingame, you write the files and update the cache.
imo, keeping a few variables > doing a query every time to fetch colors.
I'm caching the colors tags anyways. Doing any correlating between themes, colors and schemes once by hand instead of in the db engine shouldn't create any noticeable overhead, so doesn't matter much either way.
Logged
Alreadythere
BeBot Maintainer
Administrator
Grandmaster
********
Offline Offline

Posts: 1085


Re: Standardizing colors using the colors module
« Reply #13 on: March 09, 2007, 01:18:58 PM »

If you take themes to define default behavior for most output in standard form I think the following colors should be in a theme:

  • normal output
  • highlighted output
  • error text
  • blob text
  • blob title

Normal output could additionally be split for the three channels - tells, private group and guild chat.
Logged
pusikas
Experienced
****
Offline Offline

Posts: 161


Re: Standardizing colors using the colors module
« Reply #14 on: March 09, 2007, 09:05:26 PM »

Some modules use additional colors like a "light highlight" (!whois uses it for level and profession, and the "real" highlight, yellow, for the nickname). And, yes, stuff like green for AI levels, orange for clan and cyan for omni (some tower wars modules). But in the end, limiting oneself to 5 colors is probably better, anyway. I gotta say that I like the very sparse use of color in Vhab's bots for example. And the more colors you use, the harder it is to find a good fit that is pleasing to the eye.
But... if you split normal output into three, you maybe need to split highlighted and error output as well. Again, to make it easier to find a nice match of colors. If you split those as well, you only have to find a nice set of 3 colors, which is (for me at least) easier than to find one for 5. Although, that means finding 3 sets of 3 colors. But then again, I am a lousy artist. Smiley
Whatever format is being used for color schemes, would be cool if you could reuse the stuff you have defined already. Like, if you already defined gcerror (error message in guildchat, whatever) to be #FF0000, you can set pgerror to gcerror instead of setting it to #FF0000 as well.
« Last Edit: March 09, 2007, 09:12:56 PM by pusikas » Logged

Luuv  Bot-Keeper of Vengeance ^^*
Pages: [1] 2 3   Go Up
Print
BeBot - An Anarchy Online/Age Of Conan chat automaton > Forum > Development > Coding and development discussion > Topic: Standardizing colors using the colors module
« previous next »
 
Jump to:  

Recent
[request] Raid timers
by Alreadythere
[Today at 11:42:32 AM]

Shared DB online list
by Temar
[Today at 01:55:47 AM]

relay colors
by Temar
[Today at 01:54:56 AM]

BeBot v0.6.0 released
by Alreadythere
[November 30, 2008, 05:32:00 PM]

Change to Bid.php
by Temar
[November 30, 2008, 11:41:44 AM]

OnlineOrg
by Jiheld
[November 29, 2008, 12:44:27 PM]

Silly Newbie Question.
by Temar
[November 29, 2008, 12:00:02 PM]

massive_pvp_time_table 1
by gerborg
[November 29, 2008, 06:55:35 AM]

Bot not see Guild Chat
by Delvar
[November 28, 2008, 08:30:34 AM]

Starting Bot
by Allisande
[November 28, 2008, 07:08:21 AM]
Stats
Members
Total Members: 1243
Latest: Whackoeng
Stats
Total Posts: 11143
Total Topics: 1505
Online Today: 21
Online Ever: 168
(July 01, 2007, 09:30:02 PM)
Users Online
Users: 1
Guests: 12
Total: 13

Powered by SMF 1.1.7 | SMF © 2006-2008, Simple Machines LLC
TinyPortal v0.9.8 © Bloc | NewDef design by Bloc
Page created in 0.442 seconds with 28 queries. (Pretty URLs adds 0.034s, 4q)
Loading...