Chat Bubble?
by DarkProfit · in Torque Game Engine · 04/07/2006 (9:14 am) · 10 replies
Has anyone tried implementing a "chat bubble" above a players head?
What I am looking to do is create a chat bubble above the characters head instead
of using the chat window and totally clueless on how to go about this?
So thought I would drop a note in here incase anyone has a resource or has done
this type of thing before.
Thanks in advance.
What I am looking to do is create a chat bubble above the characters head instead
of using the chat window and totally clueless on how to go about this?
So thought I would drop a note in here incase anyone has a resource or has done
this type of thing before.
Thanks in advance.
About the author
#2
www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=9805
EDIT: Orion's idea might be better. If you are getting rid of the chat hud altogether, you probably want to be able to show a word balloon coming from offscreen if you're not looking directly at the person you are talking to, and a gui-based solution would be a better way to do something like that.
04/07/2006 (9:22 am)
I don't think anyone has done exactly what you're trying to do, but this resource should help you out a bit:www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=9805
EDIT: Orion's idea might be better. If you are getting rid of the chat hud altogether, you probably want to be able to show a word balloon coming from offscreen if you're not looking directly at the person you are talking to, and a gui-based solution would be a better way to do something like that.
#3
@Drew: The resource is good for what i am trying to do, any thoughts on how I would intergrate this into the communications so the chat bubble displays when a new chat message comes in but only for the players in your radius like say 50 feet or something?
thanks for the quick responses :)
EDIT: After thinking about it you are probally right, the guicontrols would be a better idea was just thinking if you had them in 3d and the guy was like 50 feet from you it would be a little hard to read... still faced with the problem of only displaying the bubbles within radious so you dont get the entire chat session for everyone in the zone though, and while i am at it, anyone implement a /tell system yet to send a message to just 1 user? (if this is a dumb question and it is already in the engine just slap me lol).
04/07/2006 (9:30 am)
@Orion: Isnt the GUIControl 2d? and if so are you just resizing and reposition them on the screen? seems like the resource that drew submitted would be more suited for the chat bubbles in a 3d enviroment or is it less over head to draw the bubbles in 2d?@Drew: The resource is good for what i am trying to do, any thoughts on how I would intergrate this into the communications so the chat bubble displays when a new chat message comes in but only for the players in your radius like say 50 feet or something?
thanks for the quick responses :)
EDIT: After thinking about it you are probally right, the guicontrols would be a better idea was just thinking if you had them in 3d and the guy was like 50 feet from you it would be a little hard to read... still faced with the problem of only displaying the bubbles within radious so you dont get the entire chat session for everyone in the zone though, and while i am at it, anyone implement a /tell system yet to send a message to just 1 user? (if this is a dumb question and it is already in the engine just slap me lol).
#4
As for restricting the range of a /say, you just need to have the server check the distance between the players, and not sent the client command if the player is too far away. You wouldn't want to make the descision to display the bubble on the client, as it would allow a compromised client to see all of the /says for the whole zone.
Check out /common/server/message.cs and /common/server/commands.cs to see the existing chat system.
04/07/2006 (9:49 am)
It looks like there's already functionality for sending messages to only one team for team games. A tell system would be identical to that except that it just sends to one person, not a whole team. The server command needs a little more information passed to it (ie the recipient of the tell) along with the message text, then the server could send the command to the appropriate player.As for restricting the range of a /say, you just need to have the server check the distance between the players, and not sent the client command if the player is too far away. You wouldn't want to make the descision to display the bubble on the client, as it would allow a compromised client to see all of the /says for the whole zone.
Check out /common/server/message.cs and /common/server/commands.cs to see the existing chat system.
#5
04/07/2006 (9:54 am)
*slaps self in head*
#6
I have since moved all of my character graphics and chat stuff into TGB's scenegraph on top of TGE. Not only is it easier, but it works better with the style of what I am working on. I am strongly considering looking at the journal resources to see about combining the TGB graphical "bubbles" to the GUI system. My baseline text functionality was okay for prototyping, but it would have been a pain for anything larger.
04/07/2006 (10:26 am)
I played with this a little in TGB/TGE when I was thinking of doing something similar to the bubbles in Vagrant Story. Basically, I created a mount point on the model's "mouth". The reason that I created the mount point was so that I could pinpoint where the chat line should be to send that information to TGB. Then, I created a chat bubble on the upper/lower portion of the screen (depending on the location of the mount point for the speaker). I drew a line (nothing fancy since I was prototyping). I connected the line to the top/bottom of the chat bubble and updated the interior of the bubble as necessary. It wasn't graceful, and had some big problems, but that did not bother me as it was simply a prototype. This was not networked though. It was single-player, static text.I have since moved all of my character graphics and chat stuff into TGB's scenegraph on top of TGE. Not only is it easier, but it works better with the style of what I am working on. I am strongly considering looking at the journal resources to see about combining the TGB graphical "bubbles" to the GUI system. My baseline text functionality was okay for prototyping, but it would have been a pain for anything larger.
#7
I think stylistically it works well. Especially with online adventure/roleplying games
04/07/2006 (10:57 am)
I have been wondering how to do this too. I once tried working with the GuiControl just as Orion suggested but got lost in how to get what your character was saying into the bubble. I eventually scrapped the idea but qould love any new input on the subject.I think stylistically it works well. Especially with online adventure/roleplying games
#8
we've put a lot of work into it.
but if what you want is the same functionality as the typical chat hud,
except inside a bubble,
just make a GuiWindowCtrl with borders that look like a chat bubble,
and move the GuiScrollCtrl from the normal chat hud into that window..
here's a snapshot of the one i made, which has tails and stuff.
i'm not sure how you'd make tails on a GuiWindowCtrl.
04/07/2006 (11:28 am)
Chat management has turned out to be a major topic for us,we've put a lot of work into it.
but if what you want is the same functionality as the typical chat hud,
except inside a bubble,
just make a GuiWindowCtrl with borders that look like a chat bubble,
and move the GuiScrollCtrl from the normal chat hud into that window..
here's a snapshot of the one i made, which has tails and stuff.
i'm not sure how you'd make tails on a GuiWindowCtrl.
#9
It loks like this:
http://starwarsgalaxies.station.sony.com/images/features/ImpPilot9.jpg //i forget how to post images
This is why i thought it would be a good idea to use the guicontrol, specifically the namehud, to do this. I pretty much got stuck parsing the chat to the bubble and making it appear when and only when the player put info into chat. I scrapped the idea...
04/07/2006 (3:06 pm)
Yea thats not eactly what i had in mind. I was more looking for an effect much like a comic books style. It is similar to that of World of warcraft and Star wars Galaxies. The chat buuble appears above the characters head when he/she talks and then dissapears after a set amount of time. it is only visible within a certain distance.It loks like this:
http://starwarsgalaxies.station.sony.com/images/features/ImpPilot9.jpg //i forget how to post images
This is why i thought it would be a good idea to use the guicontrol, specifically the namehud, to do this. I pretty much got stuck parsing the chat to the bubble and making it appear when and only when the player put info into chat. I scrapped the idea...
#10
I'm not quite sure what the difference would be between the screenshot Orion posted and the one you posted except that in Orions, all of the characters "chatting" seem to be represented (by the three tails. In the shot you posted, they are each represented separately. You would have to extract each person's dialogue and add it to the dialogue box rather thna including each speaker in a single box. Each person would have their own chatbox gui.
Note in the picture that you posted that the tail is separate from the chat box (notice the outline of the box). It seems that their solution was somewhat similar to mine: create a chat GUI element (as I noted, I did it in TGB but it could be done in the GUI controls as well). Then find a way to render your tails from an easily discernable point (saw a mount point above the head).
I'm going to be working on something similar, except that the tails will not be coming from the 3D world to a 2D interface. All of the chat segments will be 2D in nature using TGB as the scenegraph overlay. It makes my life much, much easier that way. That's something that I'm thinking about working on in a couple of weeks (no time this week or next, sadly).
04/07/2006 (3:16 pm)
@RobertI'm not quite sure what the difference would be between the screenshot Orion posted and the one you posted except that in Orions, all of the characters "chatting" seem to be represented (by the three tails. In the shot you posted, they are each represented separately. You would have to extract each person's dialogue and add it to the dialogue box rather thna including each speaker in a single box. Each person would have their own chatbox gui.
Note in the picture that you posted that the tail is separate from the chat box (notice the outline of the box). It seems that their solution was somewhat similar to mine: create a chat GUI element (as I noted, I did it in TGB but it could be done in the GUI controls as well). Then find a way to render your tails from an easily discernable point (saw a mount point above the head).
I'm going to be working on something similar, except that the tails will not be coming from the 3D world to a 2D interface. All of the chat segments will be 2D in nature using TGB as the scenegraph overlay. It makes my life much, much easier that way. That's something that I'm thinking about working on in a couple of weeks (no time this week or next, sadly).
Associate Orion Elenzil
Real Life Plus
but i'm not at liberty to post the code.
basically i just subclassed GuiControl to make a "GuiBubbleControl" which floats around and has a custom border for rounded corners & tails. I update the position/size of the bubble in OnPreRender().
Then i put scroll and a GuiMessageVector control inside and voila.
sorry i can't be more help.
it's fun coding tho!