Might & Fealty Community

Gameplay => General Discussion => Topic started by: Andrew on August 12, 2018, 04:44:52 PM

Title: Conversations 2.0: What is the ideal setup?
Post by: Andrew on August 12, 2018, 04:44:52 PM
So, i've been looking at the conversations system the last few days when I've had time, and the more I look at it, the more I come to think that modifying it to track who has access when to a conversation would be more of a pain than it's worth, based on how it's setup. You might expect that it just track which user has access to what conversations and what messages are in them, when it really tracks which user has access to which conversation and message metadatum and which conversations and messages those relate to, repsectively, and which have what relations to what users. Which makes it a but of a tangled mess, and one I'm not sure it's worth me sitting down trying to untangle.
Thus, I'm entertaining creating a new conversation system, and would like to know what you'd like it to include. I'm entertaining this because if I write one from the ground up, it becomes far easier to track who has access to what messages when, along with fixing most of the problems the current one has (like, how to handle people having access to part of a conversation that they've been since kicked out of--which I've already got a good idea on how to handle).
I'm thinking a rewrite will consist of 3 main parts: conversations, messages, and permissions. Conversations and messages will work mostly how they do now, but permissions will double both as a "who manages this convo" and a "who has access to what messages". When someone joins, they get added to a conversation's permissions with a given start and end period. When permissions change, the old one's get ended and a new one added.
If you're wondering why there's no "User" for this new system, that's because it'll tie straight into M&F rather than be a quasi-dependency like we have now.
Thoughts? Input?
Title: Re: Conversations 2.0: What is the ideal setup?
Post by: Weaver on August 12, 2018, 10:59:35 PM
It should have the ability to display MOTD (or 'mood' if it's a roleplay); People should be added manually to the creator's wishes, with the creator also able to select who else has these powers. Additionally, there should be an option to select who gets auto-added based on several conditions, like 'joins Realm' or 'Walks into this place'. That's all I can think of.
Title: Re: Conversations 2.0: What is the ideal setup?
Post by: Andrew on August 13, 2018, 01:02:35 AM
Mmmm.... I was thinking after I posted that it'd need a fourth table to track what it's associated to (a realm, a settlement, a place, an event, etc.), but that still keeps it slimmer than what we have now. Even flags would still only be a fifth table, compared to the 9 we have now. I'm thinking for system controlled conversations, join/leave will be automatic. This will handle things like realms and places n the like. For manual convos, I definitely want a join/leave ability, and it shouldn't be hard to do.

Thus far we have the following tables (not counting flags):
Conversations - Tracks conversation topic, start date, convo-level settings, and any system info, with relations to who started it, which group it's for (realm, settlement, etc.), and who has permissions to it.
Messages - Tracks message subject (if we want it, setting perhaps?), who sent it, when they sent it, individual message contents, and (maybe) what message it is in reply to (if we want it?)
Permissions - Tracks who is active in the conversation (current participants) and who has access when. For active participants, tracks their rights to a conversation.
Groups - Associates a conversation to a particular in-game entity, be it a realm, house, place, etc. System controlled.

And because I'll forget this later, I'm going to post some shorthand logic on how to grab all messages a person sees below:

Code: [Select]
$permquery = SELECT entity:permission FROM msg_perms WHERE permission.user = :character_id;
$msgs = array();
foreach ($permquery->getResults() as $permission) {
$start = $permission->getStart(); $end = $permission->getEnd(); {
$msgquery = $qb->select('m')->from('Message', 'm')->where($qb->expr()->between('m.time', ':start', ':end'))->setParameters(array('1'=>$start, '2'=>$end); $msgs[] = $msgquery->getResult();
Title: Re: Conversations 2.0: What is the ideal setup?
Post by: Cipheron on August 14, 2018, 02:35:53 AM
I'd suggest streamlining it in ways that take into account how normal messaging systems work.

For example when you currently send a 1:1 message to someone it creates a new "conversation" so you can have multiple "conversations" between you and a particular other person. Ideally, sending a message to one other person should be streamlined, and the resultant conversation should all be in a single log. Streamlining the way that characters initially get in touch with each other would be good too. Perhaps a global mail system, but with a time delay to make the initial connection based on geographic distance.

It would also be really good to separate the concept of personal messages from group conversations. Perhaps, if there were separate sections for message board activity vs personal messaging, then people would be more responsive when you need to talk to them. Currently there's one single indicator for personally-addressed messages and realm-wide spam.

This could be an existing design flaw. The message notification system should be tailored/customizable to make sure that the player sees relevant unread messages notifications for each character. If someone logs in after a whle and sees "you have 3 new messages" but knows they're relevant messages actually for them, rather than "you have 133 new messages" but knows most of them will be irrelevant realm-wide chatter, they'd be more likely to seek out and read the actual messages.

There could be a system where there's one general "message thread" for each in-game entity. Characters of each entity could choose to turn on/off "notifications" for each conversation. That would determine whether that particular conversation ends up on your "unread messages" counter or not. So players logging in could choose which things get reports as unread for which characters. Personal messages would always count as a notification, unless you put that person on the ignore list.
Title: Re: Conversations 2.0: What is the ideal setup?
Post by: Andrew on August 14, 2018, 11:36:36 AM
It just occurred to me, while reading your post, I hadn't figured out how to track whether or not you've read something. Shouldn't be too hard to add that to the permissions table though.

It may also be fairly easy to have per-conversation ability to disable notifications as well, again, in the permissions table.

Permissions would look something like: id, conversation, character, active, start, end, ignore, write, manage, owner, unread.

Code: [Select]
id is a system field.
conversation is the relevant conversation.
character is the particular character in question.
active is whether or not they're actively a participant (they get new messages or no)
start is when they had permissions to see messages
end is when they lost permissions to see messages
ignore is whether or not they want notifications
write means they can send new messages
manage lets them add/remove people (except the owner?)
owner is who started the conversation and has full rights
unread is how many unread messages they have in the conversation

This means that you can add someone for a bit, send them some messages, have them send some messages, then remove them, talk more, add them again, and they can once again send/receive, etc.

That means that they can read some old messages, but not ones they weren't present for.

It may be possible to have the game alert you to direct messages on the character list, and I can imagine how I'd implement it (as a character attribute rather than querying all conversations with only 2 participants or no group association) but it's not something I'd like to launch this new setup with. That said, when I add it, that means it'll probably load that page a fair bit faster compared to when all your characters have even a single unread message, but still, not a launch feature.
Title: Re: Conversations 2.0: What is the ideal setup?
Post by: Desideratus on August 18, 2018, 08:35:45 PM
Okay so, if we're going for a complete overhaul with an ideal setup, here's the things I would want.

Title: Re: Conversations 2.0: What is the ideal setup?
Post by: Andrew on August 18, 2018, 08:59:49 PM
In order:

I don't plan on having the in-line reply setup we have now, so I'm not sure this is relevant, exactly. I do have an idea about how to do a relatively useful reply-jumping thing.
You'll be able to jump to specific replies to a message.
Maybe? If I can figure out how, anyways.
I find this unlikely. I do have an idea how I could implement a screen that displays all messages from the last X days though, with relevant info on which topic. Sort of like how BM works.