Results 1 to 8 of 8

Thread: "Line matching" or "How about coloured messages?"

  1. #1
    Join Date
    Mar 2008
    Posts
    599

    Lightbulb "Line matching" or "How about coloured messages?"

    How was this called again, Regex or something? This should be used, in one way or another, to make a custom CFG file that will colour lines of our choice (etc). Read on. You'll figure how much gain there is, for relatively little effort.

    This feature is often used in internet terminal stuff. Basically, the program will react upon a received line. Applied to ADOM/JADE, it would work like this: when program receives the "You feel hungry." message, it could react by, A) Colouring it with hue of our choice. B) Automatically get food and eat it. C) Substitute that text, and display a text of our choice. D) Anything else. Now, I dont favour anything automatical, but highlighting text of our choice into a colour of choice, is another thing.

    If we want to highlight names with variables, such as "Goblin hits you" AND "Rat hits you" in the same line of code, we would put something like this:

    "(%w) hits you." This is how the Regex that I know of, works. The (%w) is a wildcard that will match any word, meaning that command/highlight will be executed upon whoever hits us. Notice the issue if a Giant Rat hits us (name is made of 2 words, so we may use a slightly different wilcard to envelop such a name).

    Some of common wildcards are (%w) which matches words, (%d) which matches digits, (%*) which matches anything, and so on.

    A CFG file could be used for this. Same like the common ADOM cfg file, this one would also be created/edited by players themselves. A line or two would look like this:

    "You get hungry." {#HIGHLIGHT 0....16}
    [This line will change the matched line into an ascii colour; however, also allowing hex colours to be chosen would be nice]

    "The sun has finally appeared from behind a hill." {#SUBSTITUTE "Good morning!"; #HIGHLIGHT 9}
    [This code substitues/replaces the first line with the second one, and optionally highlights it in a colour that we choose.]

    "You see (%*) laying on ground." {Ctrl+P}
    "You see stairs leading downwards here." {Shift+<}
    [First line, when it sees something laying on floor (a red gem, or a hooded cloak) will execute the command stated, for instance, to pick it up (or any number of queued commands that we set); and the other line will go to another dungeon levels as soon as adventurer steps onto the stairs. Examples are not prime, and like I said, I dont like automation, but give it to players, and they'll find out where to use it.]

    One sidenote, probably wont have a lot of use in an engine like current JADE one, but since these wildcards recognise/retrieve a string, it could be used to store variables. I will gladly say more about this too, if this post sparks any interest at all.

    I will probably get varied response on this, I even wonder if everyone will read up to this point. I'm mostly interested in what Creator has to say, because, afterall, it's him who has the choice of implementing our wishes (or not). Me? I'm being realistic.

  2. #2
    Join Date
    Mar 2008
    Location
    Norway
    Posts
    104

    Default

    Good idea, methinks, I like the coloured font in Sage.

  3. #3

    Default

    Doesn't crawl do something like there, where you can modify the settings so that, for example, damage received is in red text? It's very handy.

  4. #4
    Join Date
    Mar 2008
    Posts
    6

    Default

    It's common in MUDs. And for Roguelike it would be handy also.

  5. #5
    Join Date
    Mar 2008
    Posts
    599

    Default Your thoughts, please?

    Artran, that was the actual idea. MUDs are online textual RPGs; 99% of whatever they had to display is in text, therefore text colouring and line matching gets a special care. I have truly grown to like the way that lines are matched and actions are performed upon them. Now that we're mentioning MUDs, I will mention yet another great feature that an ascii game like ADOM (especially ADOM2) should also have. A prompt!! Yeah, a place where we will simply type any text that we want, because not every command has to be attached to a keyboard shortcut; it could be effectively used for commands that are used less frequently than others. Some other roguelikes have such prompts with a number of useful commands, but I dont remember their names. I will just say that after days of playing a MUD, and then going offline to play ADOM, I couldnt get used to its lack of customisation... I think that ONE such customisation option existed in ADOM, though! You could change the colour of UNIDs =P But that's about it, so, yeah.

    Another reason why I'm actually writing about this idea, is that such a matching-code would be universal, one small set of codes can universally be applied to any line that gets shown on screen, from the beginning to the end of the game, definitely making a plenty of people happy, at a relatively diminutive effort from Creator.

    P.S. I have this same thread in here by mistake, so I dont know which is the better place for this kind of threads. As of here, it seems that people are far less concerned with how the game will work, and far more concerned with adding more and more and more ideas. My (biased) thought is that engine needs to be made more stable, to allow for a sooner release; because if Creator keeps adding all the (tiny) details that we want, the more we will wait for a release that we can try out on our own. Give some feedback here, say if you like this idea or not! Meow!
    ▼ All their fault. ▼

  6. #6
    Join Date
    Mar 2008
    Posts
    721

    Default

    Quote Originally Posted by Elone View Post
    How was this called again, Regex or something?
    Regular Expression

    Quote Originally Posted by Elone View Post
    This should be used, in one way or another, to make a custom CFG file that will colour lines of our choice (etc). Read on. You'll figure how much gain there is, for relatively little effort.

    This feature is often used in internet terminal stuff. Basically, the program will react upon a received line. Applied to ADOM/JADE, it would work like this: when program receives the "You feel hungry." message, it could react by, A) Colouring it with hue of our choice. B) Automatically get food and eat it. C) Substitute that text, and display a text of our choice. D) Anything else. Now, I dont favour anything automatical, but highlighting text of our choice into a colour of choice, is another thing.

    If we want to highlight names with variables, such as "Goblin hits you" AND "Rat hits you" in the same line of code, we would put something like this:

    "(%w) hits you." This is how the Regex that I know of, works. The (%w) is a wildcard that will match any word, meaning that command/highlight will be executed upon whoever hits us. Notice the issue if a Giant Rat hits us (name is made of 2 words, so we may use a slightly different wilcard to envelop such a name).

    Some of common wildcards are (%w) which matches words, (%d) which matches digits, (%*) which matches anything, and so on.

    A CFG file could be used for this. Same like the common ADOM cfg file, this one would also be created/edited by players themselves. A line or two would look like this:

    "You get hungry." {#HIGHLIGHT 0....16}
    [This line will change the matched line into an ascii colour; however, also allowing hex colours to be chosen would be nice]

    "The sun has finally appeared from behind a hill." {#SUBSTITUTE "Good morning!"; #HIGHLIGHT 9}
    [This code substitues/replaces the first line with the second one, and optionally highlights it in a colour that we choose.]

    "You see (%*) laying on ground." {Ctrl+P}
    "You see stairs leading downwards here." {Shift+<}
    [First line, when it sees something laying on floor (a red gem, or a hooded cloak) will execute the command stated, for instance, to pick it up (or any number of queued commands that we set); and the other line will go to another dungeon levels as soon as adventurer steps onto the stairs. Examples are not prime, and like I said, I dont like automation, but give it to players, and they'll find out where to use it.]

    One sidenote, probably wont have a lot of use in an engine like current JADE one, but since these wildcards recognise/retrieve a string, it could be used to store variables. I will gladly say more about this too, if this post sparks any interest at all.

    I will probably get varied response on this, I even wonder if everyone will read up to this point. I'm mostly interested in what Creator has to say, because, afterall, it's him who has the choice of implementing our wishes (or not). Me? I'm being realistic.
    You are doing it wrong, your explanations are terrible, the concept is too complicated and so on.

    In general, trying to match a game message seems like a bad idea. It might change, and you might miss stuff. I think it would be better to categorize different messages, e.g. "You are hungry" is a HungryMessage, which subclasses ImportantMessage. Or something like that. Regexxes just feel wrong here.

    All my personal opinion.
    Of course it's unfair - that's the whole point.

    The Adom wiki: everything you don't want to know about Adom.
    http://ancardia.wikia.com/

  7. #7
    Join Date
    Mar 2008
    Posts
    599

    Default Umm...

    I know that it's regular expression; I also saw the Wiki entry a long time ago, and I didnt like how it was described there (or I was sleepy; I'm sleepy even now). I'm not good with explanations, so you could have helped instead.

    You mentioned that we should set message classes, but each of them would: A) Have to be created individually by Creator; B) Would basically be a preset, which allows for less customisation for players. You didnt explain why Regexes are wrong (or inferior to classed messages), so, yeah. Go on, display the advantages and disadvantages of both, so that we can weigh them out.

    I'll just be preemptive here, and ask that you dont mention how it could be complicated for an average computer user to create the codes that I described. Such average users generally wont even look at ADOM, even less play it =/ (in other words, anyone who can handle the regular adom cfg file, would be able to handle these.)

    Well. Off to hug my pillow. See ya.
    ▼ All their fault. ▼

  8. #8
    Join Date
    Mar 2008
    Posts
    721

    Default

    Quote Originally Posted by Elone View Post
    I know that it's regular expression; I also saw the Wiki entry a long time ago, and I didnt like how it was described there (or I was sleepy; I'm sleepy even now). I'm not good with explanations, so you could have helped instead.

    You mentioned that we should set message classes, but each of them would: A) Have to be created individually by Creator; B) Would basically be a preset, which allows for less customisation for players. You didnt explain why Regexes are wrong (or inferior to classed messages), so, yeah. Go on, display the advantages and disadvantages of both, so that we can weigh them out.

    I'll just be preemptive here, and ask that you dont mention how it could be complicated for an average computer user to create the codes that I described. Such average users generally wont even look at ADOM, even less play it =/ (in other words, anyone who can handle the regular adom cfg file, would be able to handle these.)

    Well. Off to hug my pillow. See ya.
    Its. Wrong. Because. Its. Wrong.

    I know, not a great help, but what I said is the only right way.

    (Me sleepy too)
    Of course it's unfair - that's the whole point.

    The Adom wiki: everything you don't want to know about Adom.
    http://ancardia.wikia.com/

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •