Ive been developing my game for a little more than a month now. I've always known i will build a chat feature into the game. My initial idea was to build a chat table, where i would track id, sender, msg and timestamp, then i could either crone ever 5-10 seconds or use some sort of update each time user refreshed on an activity. I guess mypoint is, if youre like me, you enjoy chat as much in a game as playing itself. so i wanted opinions on my idea of this crone or "on view" based chat, or should i look into a more live action chat using some other language? I'm probably not advanced enough to write a chat function in anything besides php/mysql but i could probably learn fairly easily if pointed in the right direction.
All opinions are welcome.
-Klown
shoutbox or live chat?
shoutbox or live chat?
if( $myGames != "Crap" ) {
- please_donate( $money );
- just_enjoy();
Re: shoutbox or live chat?
Try to be as basic as possible, whichever one you are more comfortable with, go with it. Even if the players don't like it as much at first (though i'm sure they won't mind) you can always change/upgrade it later!
Languages: C++, C#, Javascript + Angular, PHP
Programs: Webstorm 2017, Notepad++, Photoshop
Current Project: HP Destiny
Programs: Webstorm 2017, Notepad++, Photoshop
Current Project: HP Destiny
- hallsofvallhalla
- Site Admin
- Posts: 12026
- Joined: Wed Apr 22, 2009 11:29 pm
Re: shoutbox or live chat?
there are a ton of free chat clients out there. If you want to make your own check out my ajax tutorial and it will show up the basics so you could create your own that updates per seconds.
- Jackolantern
- Posts: 10891
- Joined: Wed Jul 01, 2009 11:00 pm
Re: shoutbox or live chat?
As Halls said, there are literally hundreds of free chat systems out there you can integrate into your game. And if you absolutely want to make one yourself (not many good reasons to except for learning), then go with #dude's advice, and make it as simple as you need it to be to make sure it works properly. There will always be time to go back later and make it real-time, and honestly, most PBBGs don't even have chat so having any way outside of a forum for players to interact puts you ahead of the curve.
But don't bother with crons when it comes to a chat system, unless you are using the crons for database manipulation outside of player-triggered scripts. A cron cannot send any data to the player's browser, so there would be little reason to run a cron for a shoutbox-type feature. For a real-time solution you are on the right path, thinking something needs to "check" for new messages every so often, but that something is Javascript through AJAX techniques, not a server-side cron.
But don't bother with crons when it comes to a chat system, unless you are using the crons for database manipulation outside of player-triggered scripts. A cron cannot send any data to the player's browser, so there would be little reason to run a cron for a shoutbox-type feature. For a real-time solution you are on the right path, thinking something needs to "check" for new messages every so often, but that something is Javascript through AJAX techniques, not a server-side cron.
The indelible lord of tl;dr
Re: shoutbox or live chat?
i appreciate the input everyone. I know that alot of PBBGs dont have any sort of real chat available, and i really think thats a downfall. no one really sits around a shout box refreshing to see who else has typed in the last few minutes. i think if i could incorporate a more live chat, people would actually stay there awhile and chat. ive never really messed with js or ajax except manipulation of some very small simple scripts written by others to fit my needs in the past. i will check out halls video tut on the chat and see if its something that would work for me. i would need to be able to write it so that i could charge for a chat msg. ie: 1 msg = 1token or something so i would need it to interact with my database or somehow modify the number of allowable msg's each time a msg is sent - 1.
Thanks for the continued help and i appreciate the input.
As always, all suggestions are welcome. If i cant make a game everyone will like, no one will play it
-klown
Thanks for the continued help and i appreciate the input.
As always, all suggestions are welcome. If i cant make a game everyone will like, no one will play it
-klown
if( $myGames != "Crap" ) {
- please_donate( $money );
- just_enjoy();