Author Topic: Chat Tracker  (Read 1200 times)

Illysia

  • Forum Addict
  • *
  • Posts: 2774
    • View Profile
Chat Tracker
« on: October 20, 2012, 11:00:23 pm »
It would be nice if there was a function that would allow you to designate certain players text to be highlighted in your chat, kinda like a cross between groups and the effect when someone mentions your own name. However, it wouldn't need player confirmation like group and wouldn't require it's own tab or channel. Then once you are through focusing on a player, you can simply take them off the list.

It would help when there are multiple conversations going on at the same time. I rather like having more than one group of people RPing at the tavern, but it is still confusing and hard to follow your own conversation when there are several distinct conversations going on.

Bonifarzia

  • Hydlaa Notable
  • *
  • Posts: 718
    • View Profile
Re: Chat Tracker
« Reply #1 on: October 21, 2012, 02:11:32 am »

This looks like a very reasonable and useful idea to me. So far, the only way to highlight anything is to include the names of the ones you speak to.

Aiwendil

  • Hydlaa Citizen
  • *
  • Posts: 463
    • View Profile
Re: Chat Tracker
« Reply #2 on: October 21, 2012, 07:23:59 am »
Actually that would be pretty simple to do.

Idea:
- Command "/addHighlightName <char-name>" - Adds a name to a list and highlights all it's chat lines in main
- Command "/delHighlightName <char-name>" - Well..the opposite ;)
- Command "/clearHighlightList" - Removes all names from the list
- Command "/printHighlightList" - Writes the names of a people that are highlighted to system chat
- Modifying the in-game chat options to allow setting the highlight color.
- Modifying the chat window to print out lines from chars with names on the list in a special color.

The chat window is already capable of coloring text so not many changes needed there at all. Probably should be a new color to make a difference between lines that include your name and lines that are only spoken by people you have a conversation with.

Questions:
- Is a gui options tab necessary for this? I mean, it would be no big deal to add something like the tab-completion or spellchecker options tab that allows editing the whole list of highlighted names. I'm just not sure if that is reasonable. Most of the time you will want to add a name quickly..so will use the /commands.
- Saving of the highlight list?. I think it would be a good idea to save the list when logging out and starting at the next login with the same list (main reason: You crash during a conversation in Kada El's...wouldn't want to re-add all names again). If people want to start with a empty list each time they could just add "/clearHightlightList" to their autoexec. This comes with a second question: I assume it would be best if the highlight list is saved per char or would one list for all chars be enough?
- I think this will only make sense for main chat. As soon as it is used for more than one chat tab plenty of questions come up: One shared list for all chat tabs? An individual list for each tab? How to configure the individual list then? So really...if nobody has a good point why it would make sense for the guild chat tab as well it's probably best to only do it for main.
- Better names for the commands! I mean...they are long. This should be something that can be done very quickly...so these command-names will only work if it is possible to tab-complete them after 2-3 letters already. No clue at the moment if there are other /commands that interfere there.

Problems:
-Haven't looked closely at the code yet. Not sure if I have the name of people speaking available or if I need to parse it from the chat lines. In the parsing case this might cause some interesting results with /impersonate leading to players being unable to identify if a GM talked for someone else or if it really was the person. No big deal if you trust GMs...but you know me. ;)
-Client side only...so unlike the friends list this can't be easily transfered between different computers

And now the real problem ;)
I could probably easily make a patch for this Illy...but if I make a patch it will never get included. On the other hand...wishes on the wishlist also never get included so it's a game you can't win. Leaves the option that you use your female charms to seduce one of the PS coders, I make a patch and that coder says he did it..probably the easiest way to get anything submitted in SVN at the moment. Nah..in all seriousness, I think it wouldn't take very long to do this and if there is some interest I might be willing to write a patch. But we all know that won't help the majority of players who don't compile their own clients as it will never get included in the game.

Candy

  • Hydlaa Notable
  • *
  • Posts: 962
    • View Profile
Re: Chat Tracker
« Reply #3 on: October 21, 2012, 10:45:31 am »
This would be amazing. In fact I'm kinda surprised this hasn't already come up unless I've missed a thread...you're a genius, Illy :D
Role Play Preferences
Quote
[1: gossip] Glaciusor: There's now a guy in skimpy armor having war flashbacks about daemons. Have fun Hydlaa

Gilrond

  • Hydlaa Notable
  • *
  • Posts: 764
    • View Profile
Re: Chat Tracker
« Reply #4 on: October 21, 2012, 11:42:12 pm »
I thought about this a idea a while ago. One can use a generic method - allow using regular expressions for highlighting anything you want (with various colors).  Users who aren't familiar with using regexps can ask for help from other players for defining their hilighting patterns. It's a very flexible method, even though it comes with some learning curve if anyone wants to use it on their own.

No special GUI is needed to implement a "beta" version of this feature, since expressions can be added inside some config file. It's useful for some advanced cases, like highlighting damage during fights and so on.

I.e. in result - you have a list of pairs: [ regexp <-> color ]. For every message just run it through that list with highlighting anything that matches with needed color. If the list won't be overly huge - it'll give only a minimal overhead in the client.

Later, GUI can be implemented to make it adjustable from within the game without restarting the client.

The idea can be expanded. For example each expression can contain several matching patterns - in regular expression they are declared in brackets like this: (...). Configuration can assign the color for the whole expression, plus special colors for each pattern.

Something like this:

<color_regex>
  <expr>You summon a large meteor and hit (.+) with it, doing (.+) damage\.</expr>
  <base>#00ff00</base>
  <pattern>#0000ff</pattern>
  <pattern>#ff0000</pattern>
</color_regex>

Resulting match will look for example like this:

You summon a large meteor and hit Onyx Dagger with it, doing 124.35 damage.
« Last Edit: October 22, 2012, 01:22:35 am by Gilrond »

Aiwendil

  • Hydlaa Citizen
  • *
  • Posts: 463
    • View Profile
Re: Chat Tracker
« Reply #5 on: October 22, 2012, 06:21:56 am »
While I like Gilrond's regex idea as well I think this is a different topic. I just don't think it's possible to offer the freedom Gilrond wants and the easiness Illy needs with the same solution.(Yeah Yeah...of course you can do everything Illy wants with regex too...but for making it quickly usable for every player during a fast conversation in Kada El's it would need a huge front-end with predefined regex for certain use-cases already that can be invoked with almost no overhead for the player). In general I think Gilrond's suggestion is more something for a complete chat window rewrite. With his ideas large portions of the current code could be dropped as they can be replaced by regular expressions. Would be another huge step away from hardcoding to a more data driven approach but I don't see that happening too soon.

In general a "beta version", as Gilrond calles it, of this is no real problem. CS supports posix regex already, so should be possible to include it in all supported platforms without the need of additional libraries (Though I have of course no clue how well the regex implementation of CS works). It could be easily included in the pawsChatWindow::FormatMessage method  or a new method that is called from pawsChatWindow::HandleMessage in src/client/gui/chatwindow.cpp. From the looks of it this is only called once a new chat line arrives at the client so the performance impact of the regex should be indeed no big problem. It probably would need a new class representing the regex and containing the different colors of all matches but also no big deal.

There are a few things to consider with a regex approach.
-The way I understand it Gilrond would like to have it for all chat tabs. This means regex needs always to be as narrow as possible to not accidentally fit on a chat line another user wrote. (And probably other users still will be able to trigger regex that are originally meant for the system chat if they really want to)
- Writing proper regex is hard work...and the majority of PS players will never do it. So there should be a easy way to exchange regex between players...at the least each regex should go in it's own file so that players can exchange those files.
- There is no way to prevent two regex fitting the same text. Could lead to "interesting" effects.

Edit: Added a point to consider
« Last Edit: October 22, 2012, 06:28:56 am by Aiwendil »

Gilrond

  • Hydlaa Notable
  • *
  • Posts: 764
    • View Profile
Re: Chat Tracker
« Reply #6 on: October 22, 2012, 04:34:09 pm »
If CS regex support isn't good enough, adding PCRE to the build shouldn't be too hard. PCRE is one of the best (features wise) and high performance regex libraries out there: http://www.pcre.org
« Last Edit: October 22, 2012, 09:48:46 pm by Gilrond »

LigH

  • Forum Legend
  • *
  • Posts: 7096
    • View Profile
Re: Chat Tracker
« Reply #7 on: October 23, 2012, 12:59:36 am »
I don't mind a simpler solution for non-programmers... ;)

Gag Harmond
Knight and Ambassador
The Royal House of Purrty

Aiwendil

  • Hydlaa Citizen
  • *
  • Posts: 463
    • View Profile
Re: Chat Tracker
« Reply #8 on: October 23, 2012, 06:46:13 am »
Well...yeah...no! I mean, yes, pcre is great but nothing -I- would like to add to PS. I made my experiences with adding hunspell for the spellchecker. Up to today it still doesn't work in windows even though the library is of course available there. I just have no clue about MSVC in general and so I am not much help to include it there and others why tried to help me told me it's pretty difficult to get hunspell to work with PS in windows..I have no reason to doubt their words there. Just meaning...adding new external libraries in a multi-platform program is almost never easy. It would be still a nice-to-have so maybe someone who feels adventurous is willing to provide a patch for pcre integration.

Aiwendil

  • Hydlaa Citizen
  • *
  • Posts: 463
    • View Profile
Re: Chat Tracker
« Reply #9 on: October 23, 2012, 12:17:10 pm »
First draft of a patch: http://pastebin.com/K6AJc5CP
(this one also includes http://www.hydlaaplaza.com/flyspray/index.php?task_id=5792 and http://www.hydlaaplaza.com/flyspray/index.php?task_id=5645 as I was too lazy to seperate them again)

Still doesn't save the highlight names at logout. Didn't add the optiosn gui yet to change the color...only possibible in options/chat.xml for now.

Without anything:

/addhighlightname Nelece
/addhighlightname Terendul


/delhighlightname Nelece
/addhighlightname Lepene

Cairn

  • Hydlaa Notable
  • *
  • Posts: 555
  • Older than a few mountains.
    • View Profile
    • Creative Minds Forum
Re: Chat Tracker
« Reply #10 on: October 23, 2012, 12:23:12 pm »
I feel like you had way too much fun with that
I regret to announce that this is the end.

I bid you all a very fond farewell

Gilrond

  • Hydlaa Notable
  • *
  • Posts: 764
    • View Profile
Re: Chat Tracker
« Reply #11 on: October 23, 2012, 03:59:40 pm »
I agree. If that can be done using already existing regex tools within CS - it'll be preferable.

Illysia

  • Forum Addict
  • *
  • Posts: 2774
    • View Profile
Re: Chat Tracker
« Reply #12 on: October 23, 2012, 05:20:11 pm »
I feel like you had way too much fun with that

I'm glad I wasn't the only one distracted by that exchange. Who knew Aiwendil was so nihilistic and given to existential crises? XD And poor little Terendul... Smacked and the result of a failed roll. Poor little thing but I suppose he isn't that little now. And who is this fenki I've never seen before?  :detective:

...what was this thread about again? ;D

Aiwendil

  • Hydlaa Citizen
  • *
  • Posts: 463
    • View Profile
Re: Chat Tracker
« Reply #13 on: October 24, 2012, 10:32:22 am »
I feel like you had way too much fun with that
Can happen if you play with yourself.

And who is this fenki I've never seen before?
That's the funny part...I have not the slightest idea. I mean, yes, I must have created her but I can't remember when, why and for what. Empty inventory so definitively no mule. Most likely was meant for an event that never took place or something similar.

...what was this thread about again? ;D
* Aiwendil is tempt to smack Illy
No matter what I do, if I want it or not, I derail threads it seems. ;)
But I really had preferred a "You are a genius, that was exactly what I was looking for" or a "*Illy smacks her head against the desk*Men...why do they always over-complicate things. All I wanted was....not this bloated crap of a patch."...or everything in between of course. ;)

Cairn

  • Hydlaa Notable
  • *
  • Posts: 555
  • Older than a few mountains.
    • View Profile
    • Creative Minds Forum
Re: Chat Tracker
« Reply #14 on: October 24, 2012, 05:26:35 pm »
I feel like you had way too much fun with that
Quote
Men..
Can happen if you play with yourself.

...what was this thread about again? ;D
* Aiwendil is tempt to smack Illy

I must be losing it.

On the flipside, I thought that was a well done patch, Aiw. At least someone's trying.
I regret to announce that this is the end.

I bid you all a very fond farewell