Thread: Live chatroom

    #1
  1. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2006
    Location
    America
    Posts
    146
    Rep Power
    9

    Post Live chatroom


    Hey, I want to make an online room where people are 2D characters (or whatever) and they can talk with each other by typing messages. I'm doing this to get me started on online gaming. Now I don't want to make an MMORPG, I realize that's impossible for one person to make. Just let me know what tools will I need, what languages, everything. I have experience with:

    - Actionscript
    - C
    - Objective C
    - PHP (not alot)
    - Assembly (although I don't think that would help)

    But I don't know absolutely nothing about networking. Just tell me what tools will I need and I'll get started.

    Thanks in advanced
  2. #2
  3. <?PHP user_title("gimp"); ?>
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jan 2005
    Location
    Internet
    Posts
    7,652
    Rep Power
    6084
    Well, let's look at your experience:

    Actionscript: That's flash, yes? You can use flash. XML sockets is what you need to look at, IIRC.
    C: Yep, C supports socket programming.
    PHP: Egh. Possible, yes. Two ways: Refreshing or ajax. What that means is that you can either have your php page keep refreshing or you can use AJAX (Javascript) to keep checking for new messages. AJAX is prettier and all that. Both are bandwidth hogs though - you keep refreshing and refreshing and checking and checking...
    Assembly: Well. Just about anything you could ever want is possible with assembly. I'm sure there are assembly libraries for socket programming. However, unless you're really hardcore, you don't want to get into this - if you had the abilities to go socket programming with assembly, you'd not be posting here.

    What tools? Depends on the language. There are a few other languages that make socket programming easy - for example, in java, there are a bunch of ways to make a chat program, including sockets, and they're fairly easy to learn (but difficult to master, of course).

    So pick a language.
    And really, the tools you need: A computer that can handle both a server and a few clients running at once, or two computers (or more). Not much else. An editor, an IDE maybe. Packet sniffer if you want to check your own stuff to see how it looks. Encrypter if you want to make your chat program hardcore.

    Yes, I've been going on about sockets even though there are different ways to do this. Why? Socket programming... well, the first thing someone does when they're learning socket programming is makes a simple chat program to see if they have the hang of it for a reason.
    Chat Server Project & Tutorial | WiFi-remote-control sailboat (building) | Joke Thread
    “Rational thinkers deplore the excesses of democracy; it abuses the individual and elevates the mob. The death of Socrates was its finest fruit.”
    Use XXX in a comment to flag something that is bogus but works. Use FIXME to flag something that is bogus and broken. Use TODO to leave yourself reminders. Calling a program finished before all these points are checked off is lazy.
    -Partial Credit: Sun

    If I ask you to redescribe your problem, it's because when you describe issues in detail, you often get a *click* and you suddenly know the solutions.
    Ches Koblents
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jul 2006
    Posts
    2,270
    Rep Power
    1737
    Here's how many mainstream languages (for app development) you narrowed down: 0. Because of all them have some way of displaying 2D graphics and all of them also happen to have networking libraries.

    But I don't know absolutely nothing about networking. Just tell me what tools will I need and I'll get started.
    The tool you actually need is knowledge. You're thinking in terms of "best tool", and there's no such thing. There's only constraints which you try to best fulfill. And you can't come up with any real constraints because you lack the knowledge to do so.

    If you're really fidgeting over the vast sea of choices, follow the recommendation I give to nearly everyone who wants to start programming. Pick a very high level but mainstream language like Python or Ruby. If neither suits you, either C# or Java is fine as well, as they have large libraries of code to draw upon.

    The thing about Flash is that you really need an intermediate. You need to know another programming language effectively. But Flash can get you good graphics for the web. Then again, you might be able to pull something off with an AJAX web app. That involves client-server communication which you can exploit as well.

    Gimp basically explained it though. A chat app is basically a choice test app for sockets and networking logic. You get to define your own protocol, or figure out another (I personally picked IRC). And the essential comes down to message passing between client and server, which effectively is what you need to understand. But the idea is that you know the underlying concepts.
    When you ask a question, be prepared to tell us: what have you tried? If you think you don't need to try anything, we will never be interested in helping you. If you agree with the link, and you refuse to answer that question, you are being a hypocrite.

    Need help with broken code? Your question should be like a good bug report: (1) It has the smallest number of steps to reproduce the problem you see (2) It tells us precisely what you expected to see and (3) It tells us what you saw and how it differed from what you expected. We need all three to help you.
    Want better answers? Tell us what you Googled for and what steps you took to answer your own question.
  6. #4
  7. Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Dec 2004
    Location
    Meriden, Connecticut
    Posts
    1,797
    Rep Power
    155
    RDG: It isn't impossible for one person to make an MMORPG. It would be a lot of work and would take quite some time, but Andrew Gower mostly made the original Runescape Classic alone. His brother helped out a little bit. Originally, it was just Andrew who was doing all the work.

    gimp: "assembly libraries for socket programming"? Why would you need such a thing? Unless you're creating an operating system of some sort or a software that runs on a game console or some other not-as-often-used-as-a-personal-computer device, then you would simply use what your operating system provides. If you're on Windows and you're writing a program that requires socket support, you would simply make calls to the Winsock library. If you're on Linux, you would make the proper system socket calls. If you're really smart, I'm sure you could even figure out how to use a platform-independent framework (ie. wxWidgets) through assembly to write a program which uses sockets. This could also give you the advantage of writing a cross-platform assembly software that supports the use of sockets (provided you also have the right assembler (GAS comes to mind) and skills for the job) if you're that "hard core" -- as you worded it.
  8. #5
  9. <?PHP user_title("gimp"); ?>
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jan 2005
    Location
    Internet
    Posts
    7,652
    Rep Power
    6084
    You're right. I meant that there are things you can use with assembly so you don't have to recreate socket programming. I worded myself poorly.
    Chat Server Project & Tutorial | WiFi-remote-control sailboat (building) | Joke Thread
    “Rational thinkers deplore the excesses of democracy; it abuses the individual and elevates the mob. The death of Socrates was its finest fruit.”
    Use XXX in a comment to flag something that is bogus but works. Use FIXME to flag something that is bogus and broken. Use TODO to leave yourself reminders. Calling a program finished before all these points are checked off is lazy.
    -Partial Credit: Sun

    If I ask you to redescribe your problem, it's because when you describe issues in detail, you often get a *click* and you suddenly know the solutions.
    Ches Koblents
  10. #6
  11. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2006
    Location
    America
    Posts
    146
    Rep Power
    9
    Ok, so is it possible to make an online chat room with Flash and php?
  12. #7
  13. <?PHP user_title("gimp"); ?>
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jan 2005
    Location
    Internet
    Posts
    7,652
    Rep Power
    6084
    Possible? Yes. Any language that supports and sort of networking has the capabilities.

    Some things you just don't want to do.

    Tell me, why are you set on using php? Flash chat rooms are alright, but PHP chat rooms are... well, not really good, mostly.
    Chat Server Project & Tutorial | WiFi-remote-control sailboat (building) | Joke Thread
    “Rational thinkers deplore the excesses of democracy; it abuses the individual and elevates the mob. The death of Socrates was its finest fruit.”
    Use XXX in a comment to flag something that is bogus but works. Use FIXME to flag something that is bogus and broken. Use TODO to leave yourself reminders. Calling a program finished before all these points are checked off is lazy.
    -Partial Credit: Sun

    If I ask you to redescribe your problem, it's because when you describe issues in detail, you often get a *click* and you suddenly know the solutions.
    Ches Koblents
  14. #8
  15. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2006
    Location
    America
    Posts
    146
    Rep Power
    9
    Well the reason is because I have php installed in Apache and I have Flash. What should I use then?
  16. #9
  17. <?PHP user_title("gimp"); ?>
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jan 2005
    Location
    Internet
    Posts
    7,652
    Rep Power
    6084
    Well, how good are you with flash? If you learn XML socket programming with flash you can make yourself a little map with people walking around chatting.

    Though personally I'd go with a real language and just pick up socket programming from there. C/C++/C#/Java/etc.
    Chat Server Project & Tutorial | WiFi-remote-control sailboat (building) | Joke Thread
    “Rational thinkers deplore the excesses of democracy; it abuses the individual and elevates the mob. The death of Socrates was its finest fruit.”
    Use XXX in a comment to flag something that is bogus but works. Use FIXME to flag something that is bogus and broken. Use TODO to leave yourself reminders. Calling a program finished before all these points are checked off is lazy.
    -Partial Credit: Sun

    If I ask you to redescribe your problem, it's because when you describe issues in detail, you often get a *click* and you suddenly know the solutions.
    Ches Koblents
  18. #10
  19. No Profile Picture
    Contributing User
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jul 2006
    Posts
    2,270
    Rep Power
    1737
    Flash + PHP is fine. I don't get what Gimp is saying about Flash chatrooms being OK, but PHP not. Flash chatrooms need an intermediate, which could be PHP or any million other possibilities.
    When you ask a question, be prepared to tell us: what have you tried? If you think you don't need to try anything, we will never be interested in helping you. If you agree with the link, and you refuse to answer that question, you are being a hypocrite.

    Need help with broken code? Your question should be like a good bug report: (1) It has the smallest number of steps to reproduce the problem you see (2) It tells us precisely what you expected to see and (3) It tells us what you saw and how it differed from what you expected. We need all three to help you.
    Want better answers? Tell us what you Googled for and what steps you took to answer your own question.
  20. #11
  21. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2006
    Location
    America
    Posts
    146
    Rep Power
    9
    As far as I know Flash XML socket programming needs something to send data to and recieve data from, and that is a php file. SO is this a good choice?
  22. #12
  23. No Profile Picture
    Contributing User
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jul 2006
    Posts
    2,270
    Rep Power
    1737
    As far as I know Flash XML socket programming needs something to send data to and recieve data from, and that is a php file. SO is this a good choice?
    Yes. It's fine. The point I've being trying to (implicitly?) make is that choice of language(s) is irrelevant in the end. As long as they have a straightforward way of creating sockets or working with network protocols, you're fine. Flash + PHP makes a perfectly good combination.
    When you ask a question, be prepared to tell us: what have you tried? If you think you don't need to try anything, we will never be interested in helping you. If you agree with the link, and you refuse to answer that question, you are being a hypocrite.

    Need help with broken code? Your question should be like a good bug report: (1) It has the smallest number of steps to reproduce the problem you see (2) It tells us precisely what you expected to see and (3) It tells us what you saw and how it differed from what you expected. We need all three to help you.
    Want better answers? Tell us what you Googled for and what steps you took to answer your own question.
  24. #13
  25. <?PHP user_title("gimp"); ?>
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jan 2005
    Location
    Internet
    Posts
    7,652
    Rep Power
    6084
    I thought RDG wanted to make a purely-php-based chat program, which is why I said it wasn't really ok.
    Chat Server Project & Tutorial | WiFi-remote-control sailboat (building) | Joke Thread
    “Rational thinkers deplore the excesses of democracy; it abuses the individual and elevates the mob. The death of Socrates was its finest fruit.”
    Use XXX in a comment to flag something that is bogus but works. Use FIXME to flag something that is bogus and broken. Use TODO to leave yourself reminders. Calling a program finished before all these points are checked off is lazy.
    -Partial Credit: Sun

    If I ask you to redescribe your problem, it's because when you describe issues in detail, you often get a *click* and you suddenly know the solutions.
    Ches Koblents

IMN logo majestic logo threadwatch logo seochat tools logo